Sign In Register

How can we help you today?

Start a new topic

Messages lost and not in order

I use script messages for broadcasting events in my game and they are needed to be in order.

(ex : A sent EVENT 0, and broadcasting EVENT 0 to all players

        B sent EVENT 1, and broadcasting EVENT 1 to all players , etc.)


But I encountered messages lost and out of order.

Ex : Some messages (msg0, 1, 2) sent to 3 players, but one of players lost 0 and got 2 first ,then 1, the other two were fine.


Is that normal? Do I need to build a re-sync mechanism by myself?


Thanks

Jo


Hey Jo,

I am very confused about the order of events, messages-sent and received. Could you please step through this problem for me?
Also, are you noticing this immediately or is this when and event has run, and then the player logs in after they were sent the message?

Thanks,
Sean

 

Hi


Sorry for confusing.


The timeline of the issue is following:


*Three Players A, B, C, iOS SDK clients.*


1. A sent EVENT 0, then Cloud code broadcasted Message 0 to A,B,C. 

    B,C got it immediately.

2. B sent EVENT 1, then Cloud code broadcasted Message 1 to A,B,C.

    B,C got it immediately.

3. C sent EVENT 2, then Cloud code broadcasted Message 2 to A,B,C.

    B,C got it immediately. 

    A got Message2 first, then Message1. Message 0 lost.


Thanks,

Jo

Okay, that is strange behavior.
So if you try the same procedure in cloud code, does the same thing happen? (you can log in as multiple users by having each user authenticated in a different tab)

In this case do B and C get their own messages (as it looks like A didn't receive their own message and this could be a server issue, but if B and C get their own messages i'd say maybe player A isnt on the list of players for their own message).

Hi


No, it rarely happens but did happen. So I don't think that A is not in the list.

B and C got their own messages.

Thanks


Jo

Hey Jo, sorry again for the delay.

Could i get the gameID for the game this is happening in?
Also, are you using the client listener when receiving these messages, or are you using a request to check the messages?

Thanks,
Sean

 

Hi


The gameId = 120246

I use iOS SDK message listener to listen the messages.


Sorry I have no time to make a simple duplicatable case.

I temporally to add a mechanism to detect if message lost and resync.

But still hope that the platform can make sure they are in order.


Thanks.

Jo


Hi


I found that if the SDK disconnects and reconnects several times, ALL messages may not be delivered at all.

I guess maybe your server does not send messages to the right socket since multiple sockets were built.

Please check it.


Thanks

Jo

Login to post a comment