Chatlogging (client)

MUD Chat now requests last 50 lines of the chat log when the user joins.
This commit is contained in:
Michael 2017-02-27 16:31:55 -05:00
parent 69ef3ba644
commit 4dbe7bd2c6

View file

@ -65,6 +65,17 @@ namespace ShiftOS.WinForms.Applications
}
catch { }
}
else if(msg.Name == "chatlog")
{
try
{
this.Invoke(new Action(() =>
{
rtbchat.AppendText(msg.Contents);
}));
}
catch { }
}
};
}
@ -87,6 +98,8 @@ namespace ShiftOS.WinForms.Applications
public void OnLoad()
{
ServerManager.SendMessage("chat_getlog", JsonConvert.SerializeObject(new ShiftOS.Objects.ChatLogRequest(id, 50)));
SendMessage("User has joined the chat.");
RefreshUserInput();
}