From cbf0e7ef709698fd240cbaacaa29b1a0dd29b985 Mon Sep 17 00:00:00 2001 From: Chris-Is-Awesome <34765277+Chris-Is-Awesome@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:11:15 -0700 Subject: [PATCH] Fix issue with MultiClient not sending disconnect event --- Code/APHandler.cs | 1 + Code/APMenuStuff.cs | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Code/APHandler.cs b/Code/APHandler.cs index 19249d5..97fa0aa 100644 --- a/Code/APHandler.cs +++ b/Code/APHandler.cs @@ -76,6 +76,7 @@ public void Disconnect() return; Session.Socket.Disconnect(); + OnDisconnected("Manual disconnection"); } public void LocationChecked(int offset) diff --git a/Code/APMenuStuff.cs b/Code/APMenuStuff.cs index 2ac9d47..b5a283c 100644 --- a/Code/APMenuStuff.cs +++ b/Code/APMenuStuff.cs @@ -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);