I try to create realtime multiplayer game, based on sdkbox-sample-gpg; working with RealTimeMultiplayerScene.cpp
I’ve succeed to create the room and to start the match.
How can I ensure if a realtime multiplayer game player/participant is online?
I can use:
for (auto part : _room.Participants()) { part.Player().Valid() // sorry, wtf is this? part.Valid(); part.IsConnectedToRoom(); }
// two last both return true for all players, even before message sending and after player get notified other player has left the room. I use not the last cocos2d-x-3.15.1
SendReliableMessage(… SendReliableMessageCallback callback); - it doesn’t block the app, but from the callback function I can’t get, for with participant I get a response - if I have more than 3 players, and if I send info to all of them at one cycle/time without waiting response.
MultiplayerStatus SendReliableMessageBlocking( Timeout timeout, …) - it blocks the app, that’s not good.
Questions update: Q1: What real-time multiplayer games (using google-play-services) were been created on C++ on Cocos? Q2: Are there real-time multiplayer games free engines for C++?
Good idea, but not for me. I think I may try AngelList.
Google Play Games SDK supports C++
This is why my engine based on it. But fully implemented on Cocos2d-x.
What you did in your engine?
I tried two functions SendReliableMessage() and SendUnreliableMessage().
First one stops the app execution (as I remember); the second is unreliable, and has message size limitation - 1168 bytes.
So I have created the engine for my needs - it takes care about transporting you message to all or to some participants; without interrupting the app. Message size may be up to 64 Mb.
In this testbed app sending messages (images) size are limited to 300 Kb.
Also engine checks if all participants are online. After some timeout the engine offers to dismiss the participant, later it dismisses it.