From ca7062c3e6527054d805dede838d951333f0cea7 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 14 Jan 2017 10:28:57 -0500 Subject: #5 - Users can be given CP over the MUD Currently not usable in the UI, but will be used to power shops. --- ShiftOS_TheReturn/ServerManager.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ShiftOS_TheReturn/ServerManager.cs') diff --git a/ShiftOS_TheReturn/ServerManager.cs b/ShiftOS_TheReturn/ServerManager.cs index 85052fb..13c4ffa 100644 --- a/ShiftOS_TheReturn/ServerManager.cs +++ b/ShiftOS_TheReturn/ServerManager.cs @@ -126,6 +126,16 @@ namespace ShiftOS.Engine thisGuid = new Guid(msg.Contents); GUIDReceived?.Invoke(msg.Contents); } + else if(msg.Name == "update_your_cp") + { + var args = JsonConvert.DeserializeObject>(msg.Contents); + if(args["username"] as string == SaveSystem.CurrentSave.Username) + { + SaveSystem.CurrentSave.Codepoints += (int)args["amount"]; + Infobox.Show($"MUD Control Centre", $"Someone bought an item in your shop, and they have paid {args["amount"]}, and as such, you have been granted these Codepoints."); + SaveSystem.SaveGame(); + } + } else if(msg.Name =="broadcast") { Console.WriteLine(msg.Contents); -- cgit v1.2.3