diff options
| author | Michael <[email protected]> | 2017-02-08 16:33:01 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-02-08 16:33:01 -0500 |
| commit | beb2bb27d7cd957a43c26ec73ad96a8241a34008 (patch) | |
| tree | 929be56b2facd56d2d2fff7fecafd37b214079a0 /ShiftOS.Server/Program.cs | |
| parent | d8eb2d79e07b63fa350ac01848f9ea51ea1ea705 (diff) | |
| download | shiftos_thereturn-beb2bb27d7cd957a43c26ec73ad96a8241a34008.tar.gz shiftos_thereturn-beb2bb27d7cd957a43c26ec73ad96a8241a34008.tar.bz2 shiftos_thereturn-beb2bb27d7cd957a43c26ec73ad96a8241a34008.zip | |
"My Shop" menu item works.
Diffstat (limited to 'ShiftOS.Server/Program.cs')
| -rw-r--r-- | ShiftOS.Server/Program.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/ShiftOS.Server/Program.cs b/ShiftOS.Server/Program.cs index a8f25d6..7a4b457 100644 --- a/ShiftOS.Server/Program.cs +++ b/ShiftOS.Server/Program.cs @@ -687,7 +687,30 @@ Contents: })); } break; - break; + case "user_get_shop": + string shopOwner = msg.Contents; + if (File.Exists("shops.json")) + foreach (var shop in JsonConvert.DeserializeObject<List<Shop>>(File.ReadAllText("shops.json"))) + { + if (shop.Owner == shopOwner) + { + server.DispatchTo(new Guid(msg.GUID), new NetObject("ruecuodaL", new ServerMessage + { + Name = "user_shop", + GUID = "server", + Contents = JsonConvert.SerializeObject(shop) + })); + return; + } + } + + server.DispatchTo(new Guid(msg.GUID), new NetObject("ruecuodaL", new ServerMessage + { + Name = "user_noshop", + GUID = "server", + })); + + break; case "pong_gethighscores": if (File.Exists("pong_highscores.json")) { |
