Skip to content

Commit

Permalink
Fix issue with MultiClient not sending disconnect event
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Is-Awesome committed Jul 20, 2024
1 parent 9b1adec commit cbf0e7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions Code/APHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void Disconnect()
return;

Session.Socket.Disconnect();
OnDisconnected("Manual disconnection");
}

public void LocationChecked(int offset)
Expand Down
10 changes: 3 additions & 7 deletions Code/APMenuStuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@ private void OnEnable()

APHandler.Instance.OnDisconnect += () =>
{
ToggleAPConnectedIcon(false);
if (apButtonActiveImageObj != null)
ToggleAPConnectedIcon(false);

Plugin.Instance.SetAPFileData(null);
MessageBoxHandler.MessageData messageData = new()
{
Message = "You lost connection with the Archipelago server!"
};
MessageBoxHandler.Instance.ShowMessageBox(messageData);
Plugin.Log.LogInfo("TEST: DISCONNECTED!");
};

ToggleAPConnectedIcon(false);
Expand Down

0 comments on commit cbf0e7e

Please sign in to comment.