I'm drunk.

This commit is contained in:
Michael 2017-02-12 10:56:24 -05:00
parent 110438929c
commit 177c22a24b
4 changed files with 21 additions and 19 deletions

View file

@ -32,7 +32,7 @@ namespace ShiftOS.Server
if (legionExists == false)
{
legions.Add(l);
server.DispatchTo(new Guid(msg.GUID), new NetObject("test", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("test", new ServerMessage
{
Name = "legion_create_ok",
GUID = "server"
@ -41,7 +41,7 @@ namespace ShiftOS.Server
}
else
{
server.DispatchTo(new Guid(msg.GUID), new NetObject("test", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("test", new ServerMessage
{
Name = "legion_alreadyexists",
GUID = "server"
@ -60,7 +60,7 @@ namespace ShiftOS.Server
if (File.Exists("legions.json"))
allLegions = JsonConvert.DeserializeObject<List<Legion>>(File.ReadAllText("legions.json"));
server.DispatchTo(new Guid(msg.GUID), new NetObject("alllegions", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("alllegions", new ServerMessage
{
Name = "legion_all",
GUID = "server",
@ -89,7 +89,7 @@ namespace ShiftOS.Server
catch { }
}
server.DispatchTo(new Guid(msg.GUID), new NetObject("userlist", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("userlist", new ServerMessage
{
Name = "legion_users_found",
GUID = "server",
@ -110,7 +110,7 @@ namespace ShiftOS.Server
{
if (userSave.CurrentLegions.Contains(legion.ShortName))
{
server.DispatchTo(new Guid(msg.GUID), new NetObject("reply", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("reply", new ServerMessage
{
Name = "user_legion",
GUID = "server",
@ -121,7 +121,7 @@ namespace ShiftOS.Server
}
}
server.DispatchTo(new Guid(msg.GUID), new NetObject("fuck", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("fuck", new ServerMessage
{
Name = "user_not_found_in_legion",
GUID = "server"

View file

@ -7,6 +7,7 @@ using ShiftOS.Objects;
using Newtonsoft.Json;
using System.IO;
using static ShiftOS.Server.Program;
using NetSockets;
namespace ShiftOS.Server
{
@ -17,7 +18,7 @@ namespace ShiftOS.Server
{
if (File.Exists("pong_highscores.json"))
{
server.DispatchTo(new Guid(msg.GUID), new NetObject("pongstuff", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("pongstuff", new ServerMessage
{
Name = "pong_highscores",
GUID = "server",

View file

@ -50,7 +50,7 @@ namespace ShiftOS.Server
if (save.Username == args["username"].ToString() && save.Password == args["password"].ToString())
{
Program.server.DispatchTo(new Guid(msg.GUID), new NetObject("mud_savefile", new ServerMessage
Program.server.DispatchTo(new Guid(guid), new NetObject("mud_savefile", new ServerMessage
{
Name = "mud_savefile",
GUID = "server",
@ -61,7 +61,7 @@ namespace ShiftOS.Server
}
catch { }
}
Program.server.DispatchTo(new Guid(msg.GUID), new NetObject("auth_failed", new ServerMessage
Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
{
Name = "mud_login_denied",
GUID = "server"
@ -69,7 +69,7 @@ namespace ShiftOS.Server
}
else
{
Program.server.DispatchTo(new Guid(msg.GUID), new NetObject("auth_failed", new ServerMessage
Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
{
Name = "mud_login_denied",
GUID = "server"
@ -93,7 +93,7 @@ namespace ShiftOS.Server
if (save.Username == args["username"].ToString() && save.Password == args["password"].ToString())
{
server.DispatchTo(new Guid(msg.GUID), new NetObject("mud_savefile", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("mud_savefile", new ServerMessage
{
Name = "mud_found",
GUID = "server",
@ -103,7 +103,7 @@ namespace ShiftOS.Server
}
catch { }
}
server.DispatchTo(new Guid(msg.GUID), new NetObject("auth_failed", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
{
Name = "mud_notfound",
GUID = "server"
@ -111,7 +111,7 @@ namespace ShiftOS.Server
}
else
{
server.DispatchTo(new Guid(msg.GUID), new NetObject("auth_failed", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
{
Name = "mud_notfound",
GUID = "server"
@ -127,7 +127,7 @@ namespace ShiftOS.Server
WriteEncFile("saves/" + sav.Username + ".save", JsonConvert.SerializeObject(sav, Formatting.Indented));
Program.server.DispatchTo(new Guid(msg.GUID), new NetObject("auth_failed", new ServerMessage
Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
{
Name = "mud_saved",
GUID = "server"
@ -151,7 +151,7 @@ namespace ShiftOS.Server
var saveFileContents = JsonConvert.DeserializeObject<Save>(ReadEncFile(saveFile));
if (saveFileContents.Username == userName)
{
saveFileContents.Codepoints += amount;
saveFileContents.Codepoints += cpAmount;
WriteEncFile(saveFile, JsonConvert.SerializeObject(saveFileContents, Formatting.Indented));
Program.ClientDispatcher.Broadcast("update_your_cp", new
{

View file

@ -7,6 +7,7 @@ using Newtonsoft.Json;
using ShiftOS.Objects;
using System.IO;
using static ShiftOS.Server.Program;
using NetSockets;
namespace ShiftOS.Server
{
@ -21,7 +22,7 @@ namespace ShiftOS.Server
shopList = JsonConvert.DeserializeObject<List<Shop>>(File.ReadAllText("shops.json"));
var username = args["username"] as string;
var updateShop = JsonConvert.DeserializeObject<Shop>(msg.Contents);
var updateShop = JsonConvert.DeserializeObject<Shop>(contents as string);
for (int i = 0; i < shopList.Count; i++)
{
@ -44,7 +45,7 @@ namespace ShiftOS.Server
if (File.Exists("shops.json"))
shopFile = JsonConvert.DeserializeObject<List<Shop>>(File.ReadAllText("shops.json"));
var newShop = JsonConvert.DeserializeObject<Shop>(msg.Contents);
var newShop = JsonConvert.DeserializeObject<Shop>(contents as string);
foreach (var shop in shopFile)
{
@ -137,7 +138,7 @@ namespace ShiftOS.Server
{
if (shop.Owner == shopOwner)
{
server.DispatchTo(new Guid(msg.GUID), new NetObject("ruecuodaL", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("ruecuodaL", new ServerMessage
{
Name = "user_shop",
GUID = "server",
@ -147,7 +148,7 @@ namespace ShiftOS.Server
}
}
server.DispatchTo(new Guid(msg.GUID), new NetObject("ruecuodaL", new ServerMessage
server.DispatchTo(new Guid(guid), new NetObject("ruecuodaL", new ServerMessage
{
Name = "user_noshop",
GUID = "server",