Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way of detecting when a RTM player disconnects. #53

Open
RubiconDev opened this issue Jan 22, 2018 · 2 comments
Open

No way of detecting when a RTM player disconnects. #53

RubiconDev opened this issue Jan 22, 2018 · 2 comments

Comments

@RubiconDev
Copy link

I'm using v 2.1 of the cpp gpg SDK.

My app runs perfectly, sending and receiving data between player A and B.

If B switches his WIFI off, there is no callback to let A know that he has left the game.

OnP2PDisconnected() isn't triggered.
OnRoomStatusChanged() isn't triggered.
OnParticipantStatusChanged isn't triggered.

Surely this isn't correct? I don't really want to have to add keep-alive ping packets to my game when it seems like there is facility already available using these callbacks.

Why don't they work?

BTW:I tried updating to v3.0 of the SDK, this causes masses of linker errors.

Regards,

Steve.

@claywilkinson
Copy link
Contributor

The state changes I believe are triggered during send/receive/close events, turning off the wifi would not cause that. I believe the B gets the event if B tries to send something, and I believe after some time A gets the event if A sends something to B (and it wouldn't go through). It is designed like this to avoid connection "jitter" if you lose connectivity intermittently for example switching from wi-fi to LTE or going through a tunnel/ elevator, etc.

The linker errors might be caused by not upgrading your NDK? 3.0 requires NDK r14 or greater, and since gcc and gnustl are deprecated, you should use clang toolchain with the c++ STL. If you can't move away from gnustl for some reason, you need to use gcc, mostly to be safe.

@RubiconDev
Copy link
Author

RubiconDev commented Jan 27, 2018

Ah, it's nice to have it confirmed, cheers. The reasons you state are perfectly valid. It'd be good to have the docs updated to reflect this as I'm not the first to come across this.

I largely ignore any "message sent" callback, as a rule they return -2 (INTERNAL_ERROR), which isn't
massively helpful. Despite this, the game works fine.

GoogleGameServices->RealTimeMultiplayer().SendReliableMessage(m_RealTimeRoom, (*it), Data, [](gpg::MultiplayerStatus const &ss)
{
DebugPrintf("Send status : %d", ss); // PRETTY MUCH ALWAYS -2.
});

Re:Linker errors - Yeah, I'm on r12b so it looks like I've got some upgrading to do.

Thanks,

Steve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants