Skip to content

Handle pausing and resuming the game upon bot disconnect/reconnect #256

@MahdMalik

Description

@MahdMalik

Task Description:

After a bot disconnects, we want to pause the game until the bot is reconnected. And upon reconnecting, we want to resume the game. There should be a similar task to pause the game in general; may want to check that and see if it can be applied. Probably want to differentiate between server pause and game pause.

Implementation Details:

To do list:

  • check if same bot tunnel object is used. If so, can just create a signal upon reconnect very easily. If not, want to figure out where its created, maybe assign an id to the right bot, and check that way if its a reconnect or first-time connect.
    • ok so it turns out it creates a separate object. One idea is push something called DisconnectedRobots to a stack, when paused only unpause if that stack is empty. When a connection occurs, if it's in the stack, take it out the stack as that means the connection has resume. Probably want to actually do another data structure like a hashet, with key being robot's ip address.
  • See how pausing and Resuming can be done (obviously).
    • figured out where this is done, thanks Tommy for the code
  • Differentiate between different pauses; don't want server to pause, then player to resume.

Metadata

Metadata

Assignees

Labels

approvedThis issue has passed the draft stage, and is ready to be assigned

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions