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.

eBehbahani
  • 1,579
  • 5
  • 19
  • 41

0 Answers0