GPGS reliable messages not reaching other player
Asked Answered
A

0

6

I am using google play game service to handle the multiplayer in my game but I have reached major stumbling block. I use realtime multiplayer in game and send reliable messages periodically between the users (1 message per second on average; larger files are split and may be sent at 10 msgs per second).

The issue I am encountering is that the messages don't seem to be reaching their destination. I send messages to the other users as soon as I am connected to the room and I see that the other user has joined. Sometimes the message will reach the target and sometimes it won't. If I set a delay of 10sec (just for testing) after I have entered the room, then the messages seem to always go through.

I checked the status codes and I get STATUS_OK (0) from the message callback and positive or zero integer as the return value when sending a reliable message. So I am not getting an error, but the messages are not being sent (or received).

Is there some condition that needs to be satisfied before you can start sending messages?

Update:

I actually have a system that lets me send data when one of the following is called: onRoomConnected, onP2PConnected, and onPeersConnected. As soone as one of those are called, I send a large message (6000+ bytes which are split into chunks of 1000) to the new user using:

Games.RealTimeMultiplayer.sendReliableMessage(mContext.aHelper.getApiClient(), null,
      serializedData.getBytes(), mRoomId, getParticipantId()); 

which was taken directly from the button clicker example. I used to just wait until onRoomConnected was called but I still saw that some of my messages were not going through.

Amey answered 26/10, 2014 at 23:16 Comment(5)
have the sames error when using proguard, ok without himMccullum
status code of sent message also STATUS_OK, but opponent never receive itMccullum
do you also use proguard?Mccullum
No I do not, so far adding a 5 second delay works.Amey
Could you post some code? I have not seen this delay in my RTMP applications. Could you just show which callback you are using to determine that you are in the room and ready to send messages? Also showing the code where you send the message could also be useful.Saddle

© 2022 - 2024 — McMap. All rights reserved.