GPGS reliable messages not reaching another player

I use the google game game service to work with multiplayer in my game, but I have reached a big stumbling block. I use real-time multi-user mode and periodically send reliable messages between users (on average 1 message per second, large files are split and can be sent at a speed of 10 msgs per second).

The problem I am facing is that the messages do not seem to reach the destination. I am sending messages to other users as soon as I connect to the room and I see that another user has joined. Sometimes the message reaches the goal, and sometimes it will not. If I set a delay of 10 seconds (for testing only) after I entered the room, the messages seem to always go through.

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

Is there any condition that needs to be met before you can start sending messages?

Update:

Actually, I have a system that allows me to send data when one of the following is called: onRoomConnected, onP2PConnected and onPeersConnected. Since one of them is called, I am sending a large message (6000 + bytes, which are broken into pieces of 1000) to a new user, using:

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

which was taken directly from the button click example. I was just waiting for onRoomConnected to be called, but I still saw that some of my messages did not go through.

+6
source share

Source: https://habr.com/ru/post/977250/


All Articles