Welcome, Guest
  • Author Topic: Take my nickname when I call a function  (Read 6001 times)

    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Take my nickname when I call a function
    « on: 11/16/07, 11:28 »
    Hi, I have a question.
    I have a chat and I send a message from client to server and server send this message to all client.
    Actually I sent to server 2 variables (whoSend, msgChat) that they are my nickname and my message.
    Now I want to send to server only 1 variable (msgChat for my message). It's possible take my nickname when i call this function?
    Code: [Select]
    Client.prototype.msgCHATall = function(whoSend, msgChat) {
    for (i=0; i<application.clients.length; i++) {
    application.clients[i].call("msgCHATallRISP", null, whoSend, msgChat);
    }
    };
    I've tryed this solution but doesn't works:
    Code: [Select]
    Client.prototype.msgCHATall = function(msgChat) {
    whoSend = gFrameworkFC.getClientGlobals(oldClient).username;
    for (i=0; i<application.clients.length; i++) {
    application.clients[i].call("msgCHATallRISP", null, whoSend, msgChat);
    }
    };

    p.s. I use Jorge's base_chat.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Take my nickname when I call a function
    « Reply #1 on: 11/17/07, 08:01 »
    If yo don't pass any key to identify (at least a reference to yourself) then can't be identify

    nc.call("msgChat", msg, this)

    function(msgChat, client)
    ...
    whoSend = gFrameworkFC.getClientGlobals(client).username;

    Jorge

    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Re: Take my nickname when I call a function
    « Reply #2 on: 11/17/07, 08:28 »
    OK.
    In client side I call function in server side with this method:
    Code: [Select]
    _root.client_nc.call("msgCHATall", null, whoSend, _root.chat.input_txt.text);
    Now, I don't use chat component an I use amfphp for login, but a good hacker can to play with this code in client side:
    Code: [Select]
    whoSend = "lyglgvluygvluhyvluyvlvlvlhlu";
    _root.client_nc.call("msgCHATall", null, whoSend, _root.chat.input_txt.text);
    Is there a solution?

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Take my nickname when I call a function
    « Reply #3 on: 11/17/07, 10:19 »
    Don't understand the "hacker" action. Recompile the movie to send arbitrary username?

    Jorge

    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Re: Take my nickname when I call a function
    « Reply #4 on: 11/17/07, 11:13 »
    Don't understand the "hacker" action. Recompile the movie to send arbitrary username?

    Jorge
    Yes.
    You can recompile the movie, change referrer, to do login with amfphp and to use another nickname...  :-[

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Take my nickname when I call a function
    « Reply #5 on: 11/17/07, 13:58 »
    But to login you should know the password. If anonymous login is enabled, then the action is legal

    Jorge

    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Re: Take my nickname when I call a function
    « Reply #6 on: 11/18/07, 02:16 »
    But to login you should know the password. If anonymous login is enabled, then the action is legal

    Jorge
    No Jorge, I can to do a login with username:Ruyto and password:MyPass, but at time to send a message in chat (after recompiler etc), I can use this code:
    Code: [Select]
    _root.client_nc.call("msgCHATall", null, "AnotherNick", _root.chat.input_txt.text);...and admin of chat never to know who send a message.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Take my nickname when I call a function
    « Reply #7 on: 11/19/07, 04:32 »
    Frankly, recompile a movie to send msgs as another person seems to me a little exotic, specially because the one who do this should have a decent level of actionScript knowledge. Anyway, if you care, store usernames in an array on login, find a match prior to broadcast a message

    Jorge

    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Re: Take my nickname when I call a function
    « Reply #8 on: 11/19/07, 04:39 »
    Another solution may be to login with amfphp to each new message. But I think that the chat would be very slow. I used this solution for private messages and the private room because they are not used very often.
    Thanks Jorge  :)

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Take my nickname when I call a function
    « Reply #9 on: 11/19/07, 04:54 »
    Quote
    Another solution may be to login with amfphp to each new message

    IMHO totally wrong

    Jorge

    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Re: Take my nickname when I call a function
    « Reply #10 on: 11/19/07, 04:58 »
    Quote
    Another solution may be to login with amfphp to each new message

    IMHO totally wrong

    Jorge
    IMHO? I don't understand this word.
    Log FMS-amfphp each time a user sends a new message undertakes unnecessarily slows the server and the application

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Take my nickname when I call a function
    « Reply #11 on: 11/19/07, 05:03 »
    IMHO -> In my humble opinion
    AFAIK-> As far as i know

    Jorge


    ruyto

    • Jr. Programmer
    • **
    • Posts: 89
      • View Profile
      • Email
    Re: Take my nickname when I call a function
    « Reply #12 on: 11/19/07, 05:06 »
    Ok Thanks again  :)