aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications/Chat.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-02-27 16:31:55 -0500
committerMichael <[email protected]>2017-02-27 16:31:55 -0500
commit4dbe7bd2c66394128fd9336cccf9438492fd461b (patch)
treed9183726de776b5ca2026c632c37448132d85375 /ShiftOS.WinForms/Applications/Chat.cs
parent69ef3ba644cf3e15dbee32994a6f640294bc54b0 (diff)
downloadshiftos_thereturn-4dbe7bd2c66394128fd9336cccf9438492fd461b.tar.gz
shiftos_thereturn-4dbe7bd2c66394128fd9336cccf9438492fd461b.tar.bz2
shiftos_thereturn-4dbe7bd2c66394128fd9336cccf9438492fd461b.zip
Chatlogging (client)
MUD Chat now requests last 50 lines of the chat log when the user joins.
Diffstat (limited to 'ShiftOS.WinForms/Applications/Chat.cs')
-rw-r--r--ShiftOS.WinForms/Applications/Chat.cs13
1 files changed, 13 insertions, 0 deletions
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();
}