aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-01-14 10:28:57 -0500
committerMichael <[email protected]>2017-01-14 10:29:03 -0500
commitca7062c3e6527054d805dede838d951333f0cea7 (patch)
tree6a4a5e72472109faaa8926d3f45f237fbb5b1eaa /ShiftOS_TheReturn
parent9aab77b2f1bd4231e0d4d97efc178a9ec702d96d (diff)
downloadshiftos_thereturn-ca7062c3e6527054d805dede838d951333f0cea7.tar.gz
shiftos_thereturn-ca7062c3e6527054d805dede838d951333f0cea7.tar.bz2
shiftos_thereturn-ca7062c3e6527054d805dede838d951333f0cea7.zip
#5 - Users can be given CP over the MUD
Currently not usable in the UI, but will be used to power shops.
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/ServerManager.cs10
1 files changed, 10 insertions, 0 deletions
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<Dictionary<string, object>>(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);