Commit 0ad4cd4f authored by Grant's avatar Grant
Browse files

add reconnect debug lines

parent ed97f664
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ class Network extends EventEmitter<INetworkEvents> {
    {
      autoConnect: false,
      withCredentials: true,
      reconnection: true,
    }
  );
  private online_count = 0;
@@ -72,6 +73,22 @@ class Network extends EventEmitter<INetworkEvents> {
      this.emit("disconnected");
    });

    this.socket.io.on("reconnect", (attempt) => {
      console.log("Reconnected to server on attempt " + attempt);
    });

    this.socket.io.on("reconnect_attempt", (attempt) => {
      console.log("Reconnect attempt " + attempt);
    });

    this.socket.io.on("reconnect_error", (err) => {
      console.log("Reconnect error", err);
    });

    this.socket.io.on("reconnect_failed", () => {
      console.log("Reconnect failed");
    });

    this.socket.on("user", (user: AuthSession) => {
      this.emit("user", user);
    });