Skip to content

Sometimes when last user disconnects (maybe while turn is changing?), server crashes #29

Description

@LearningNerd

Undefined variable error from line 300 (in the getTurnData() method) when trying to access the name of a player who just disconnected.

This bug seems like it might be hard to replicate, but my best guess is that it's a timing issue with the turnChange and disconnect events.

Idea for a solution: Just add another check to the offending function so that it only runs if the variable it's accessing is not null.

Activity

  1. LearningNerd commented on Jul 10, 2017

    @LearningNerd
    MemberAuthor

    This was also resolved somewhere within pull request #32 when closing issue #16! (It's because turnIndex wasn't being updated when players disconnected, so sometimes it pointed to a nonexistent slot in the players array instead of pointing to the current player!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions