mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-23 02:12:14 +00:00
Unbind save handshake after message receive.
This commit is contained in:
parent
249c479985
commit
097afe3dfe
1 changed files with 7 additions and 1 deletions
|
@ -159,17 +159,23 @@ namespace ShiftOS.Engine
|
|||
{
|
||||
KernelWatchdog.Log("mud_handshake", "handshake successful: kernel watchdog access code is \"" + ServerManager.thisGuid.ToString() + "\"");
|
||||
|
||||
ServerManager.MessageReceived += (msg) =>
|
||||
ServerMessageReceived savehandshake = null;
|
||||
|
||||
savehandshake = (msg) =>
|
||||
{
|
||||
if (msg.Name == "mud_savefile")
|
||||
{
|
||||
CurrentSave = JsonConvert.DeserializeObject<Save>(msg.Contents);
|
||||
ServerManager.MessageReceived -= savehandshake;
|
||||
}
|
||||
else if (msg.Name == "mud_login_denied")
|
||||
{
|
||||
oobe.PromptForLogin();
|
||||
ServerManager.MessageReceived -= savehandshake;
|
||||
}
|
||||
};
|
||||
ServerManager.MessageReceived += savehandshake;
|
||||
|
||||
|
||||
ReadSave();
|
||||
|
||||
|
|
Loading…
Reference in a new issue