+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: client sometime doesn't receive the message sent from server

  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    42
    Thanks
    11
    Thanked 1 Time in 1 Post

    client sometime doesn't receive the message sent from server

    this is related to http://www.electrotank.com/forums/sh...ge-from-server.

    we have 5.3.2, and experienced client missing event from server. client connects to server ports 9899(tcp) or 8989(http). In server admin panel, server also listen to port 10000(udp) beside 9899 and 8989.

    when the problem happens, client still able to send plugin message to server and get response from server. So there is still connection between client and server.

    We use sendPluginMessagetoRoom() and sendPluginmessageToUser(), and don't use queue.

  2. #2
    Senior Member
    Join Date
    Feb 2011
    Posts
    234
    Thanks
    67
    Thanked 1 Time in 1 Post
    The client in this case does listen to connection closed event. The client is definitely online because it can still send plugin message to the server and get response from the server. The issue we see is with those server initiated messages (without client request). Those messages are suppose to be sent to everyone that is online, but we noticed sometimes a client may stop receiving those messages. For certain events, the only way to get those again is to logout and log back in again. (not 100% sure this is true for all server initiated events due to limited occurrences.)
    I don't think we are using queued message.
    Last edited by chengen; 08-20-2012 at 01:42 AM.

  3. #3
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,212
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    Can you give me a code snippet of the server side code that is generating the messages that not all clients get? There are several different ways to send messages to "everybody on the server", so I need to know exactly how you are doing it.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  4. #4
    Member
    Join Date
    Mar 2011
    Posts
    42
    Thanks
    11
    Thanked 1 Time in 1 Post
    here is the code to send message from server to a client
    EsObject oEvent = new EsObject();
    oEvent.setString("action", actionName);
    ...other oEvent property

    getApi().sendPluginMessageToUser(user, oEvent);

    user occasionally misses the message.

  5. #5
    Member
    Join Date
    Mar 2011
    Posts
    42
    Thanks
    11
    Thanked 1 Time in 1 Post
    during a game, server constantly sends users game score, and when game ends, server will send won message to the winner(with highest score). occasionally when game ends, the winner sees his score listed as highest, but doesn't receive the won message.

  6. #6
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,212
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    If it is always the "won" message that sometimes doesn't arrive, then there's a problem with your plugin logic somewhere. Are you sure that the server is sending that message to him? Try logging the message on the server.

    If one plugin message doesn't arrive, but the client continues to process other messages from the server, then for some reason that one plugin message just wasn't sent to this client. Since you are using getApi().sendPluginMessageToUser(user, oEvent); we rule out UDP and queued messaging. How large is the oEvent EsObject being sent? The only other thing I know of that can suppress an outgoing message is if it is too large (as configured in ES Admin General Settings).
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  7. #7
    Member
    Join Date
    Mar 2011
    Posts
    42
    Thanks
    11
    Thanked 1 Time in 1 Post
    the message size is small. It is less than 1KByte. For this won message, we have so far one incident for missing message. We do have missing messages in other cases, but we are not that sure the cause to be es5 issue than this incident. For this one, we are more inclined to believe it is an es5 issue. But as you point out server might send the message to a different one instead of winning user. Since we don't log this event, we can not confirm it is the case. So we will add log to track this message to see if we can get more insight of it and go back this topic again.

  8. #8
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,212
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    If it helps, when I develop multiplayer games I usually send a message to the entire room giving the final score and the name of the winner.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  9. #9
    Member
    Join Date
    Mar 2011
    Posts
    42
    Thanks
    11
    Thanked 1 Time in 1 Post
    I just recall that right before sending won message to winner, we rewarded the winner some virtual items in our database. the database record shows the reward was given to the winner. So it indirectly shows that the message was indeed sent to the winner, not anyone else.

    in the course of game, we constantly send message to all user when the highest score owner changes. That is why that user seeing his name listed as highest score owner at the end of game complained he did not receive the won message.

  10. #10
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,212
    Thanks
    80
    Thanked 1,086 Times in 1,075 Posts
    Is it possible that the database transaction took longer than usual and the "game over" message arrived at the clients before the "you won!" message arrived at the winner, long enough before that the winner's client had started cleaning up?

    Unless you need to make sure that the database transaction has indeed finished before telling the winner "you won these items", you may be better off having the database transaction spawned to an async thread and then notifying the winner immediately without waiting for the transaction to finish.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts