aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-19 09:07:21 -0400
committerMichael <[email protected]>2017-04-19 09:07:21 -0400
commit56bddb4983de5d6852607c128ed0a83e3a6b99a5 (patch)
tree6db8f83b251e319c28d9d0bacb7e8d5739bc1345
parent7ec8c68784ab718ecf5dbfc34d7816f660c8ba8d (diff)
downloadshiftos_thereturn-56bddb4983de5d6852607c128ed0a83e3a6b99a5.tar.gz
shiftos_thereturn-56bddb4983de5d6852607c128ed0a83e3a6b99a5.tar.bz2
shiftos_thereturn-56bddb4983de5d6852607c128ed0a83e3a6b99a5.zip
Unwind MUD event before looping
-rw-r--r--ShiftOS.WinForms/OobeStory.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/ShiftOS.WinForms/OobeStory.cs b/ShiftOS.WinForms/OobeStory.cs
index 06f2c08..d4d066b 100644
--- a/ShiftOS.WinForms/OobeStory.cs
+++ b/ShiftOS.WinForms/OobeStory.cs
@@ -218,7 +218,7 @@ namespace ShiftOS.WinForms
bool goBack = false;
int incorrectChances = 2;
Console.WriteLine("Checking sentience records...");
- ServerManager.MessageReceived += (msg) =>
+ ServerMessageReceived smr = (msg) =>
{
if (position == 2)
{
@@ -262,6 +262,7 @@ namespace ShiftOS.WinForms
}
}
};
+ ServerManager.MessageReceived += smr;
ServerManager.SendMessage("mud_checkuserexists", JsonConvert.SerializeObject(new { username = SaveSystem.CurrentSave.Username }));
while (position == 2)
{
@@ -272,7 +273,10 @@ namespace ShiftOS.WinForms
Thread.Sleep(10);
}
if (goBack)
+ {
+ ServerManager.MessageReceived -= smr;
goto UsernameWait;
+ }
Console.WriteLine("Sentience linkup successful.");
Console.WriteLine("We will bring you to your system in 5 seconds.");
Thread.Sleep(5000);