[bug]realtime example server script

Sorry if this is the wrong spot to report such things, if i should post elsewhere please let me know.

I’m working on integrating realtime server protocol with my c++ game and have discovered a bug in the example realtime script found in the aws docs(the bug might be a deeper problem in rts scripts themselves). If a client opens a web socket connection, but never sends the login message, then disconnects, the script will call player disconnected, and decrement the active users without ever having incremented it(since the player was never accepted in the first place) since the script only ends when activeclients==0 this results in the script effectively never terminating.

I’m unsure if this is a deeper problem where an unauthenticated user is allow to trigger a disconnect even though they havent authenticated, but if not then the script should be updated to address this problem and make devs aware of its possibility.

1 Like

Hi, Can you provide more details on which script you are referring to?

The one found here: Creating a Realtime Script - Amazon GameLift

onPlayerDisconnect can be called without onPlayerAccepted being called, which means activePlayers can be negative and the script never ends.

secondly another bug exists in onPlayerDisconnect where the disconnect messages are sent to the disconnected player instead of all the still connected players.

1 Like