From 4dbe7bd2c66394128fd9336cccf9438492fd461b Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Feb 2017 16:31:55 -0500 Subject: [PATCH] Chatlogging (client) MUD Chat now requests last 50 lines of the chat log when the user joins. --- ShiftOS.WinForms/Applications/Chat.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ShiftOS.WinForms/Applications/Chat.cs b/ShiftOS.WinForms/Applications/Chat.cs index 6c7528c..7f3fc04 100644 --- a/ShiftOS.WinForms/Applications/Chat.cs +++ b/ShiftOS.WinForms/Applications/Chat.cs @@ -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(); }