un obsoleting

This commit is contained in:
Rylan/wowmom98 2017-05-28 14:44:08 -04:00
parent 9914c18456
commit c7ba7d733c
10 changed files with 25 additions and 24 deletions

View file

@ -32,6 +32,7 @@ using NetSockets;
using Newtonsoft.Json;
using System.IO;
using static ShiftOS.Server.Program;
using ShiftOS.Engine
namespace ShiftOS.Server
@ -180,7 +181,7 @@ namespace ShiftOS.Server
if (sve.EndsWith(".save"))
{
var save = JsonConvert.DeserializeObject<Save>(File.ReadAllText(sve));
accs.Add($"{save.Username}@{save.SystemName}");
accs.Add($"{ShiftOS.Engine.SaveSytem.CurrentUser.Username}@{save.SystemName}");
}
}

View file

@ -100,7 +100,7 @@ namespace ShiftOS.WinForms.Applications
{
ServerManager.SendMessage("shop_removeowned", JsonConvert.SerializeObject(new
{
username = SaveSystem.CurrentSave.Username
username = SaveSystem.CurrentUser.Username
}));
ShowCreateShop();
}
@ -290,7 +290,7 @@ namespace ShiftOS.WinForms.Applications
creatingShop = true;
editingShop.Name = "My shop";
editingShop.Description = "My shop has lots of awesome items. You should buy from my shop.";
editingShop.Owner = SaveSystem.CurrentSave.Username;
editingShop.Owner = SaveSystem.CurrentUser.Username;
editingShop.Items = new List<ShopItem>();
shop_editor.BringToFront();
PopulateShopEditor();
@ -402,7 +402,7 @@ namespace ShiftOS.WinForms.Applications
lbprice.Text = $"Cost: {item.Cost} CP";
btnbuy.Show();
};
if(shop.Owner == SaveSystem.CurrentSave.Username)
if(shop.Owner == SaveSystem.CurrentUser.Username)
{
btneditshop.Show();
}
@ -560,7 +560,7 @@ namespace ShiftOS.WinForms.Applications
you_systemstatus.BringToFront();
lblsysstatus.Text = $@"Username: {SaveSystem.CurrentSave.Username}
lblsysstatus.Text = $@"Username: {SaveSystem.CurrentUser.Username}
System name: {SaveSystem.CurrentSave.SystemName}
Codepoints: {SaveSystem.CurrentSave.Codepoints}
@ -591,7 +591,7 @@ Current legions: {legionname}";
private void tsMemos_Click(object sender, EventArgs e)
{
ServerManager.SendMessage("get_memos_for_user", $@"{{
username: ""{SaveSystem.CurrentSave.Username}""
username: ""{SaveSystem.CurrentUser.Username}""
}}");
you_memos.BringToFront();
}
@ -812,7 +812,7 @@ Current legions: {legionname}";
{
ServerManager.SendMessage("user_shop_check", JsonConvert.SerializeObject(new
{
username = SaveSystem.CurrentSave.Username
username = SaveSystem.CurrentUser.Username
}));
}
@ -895,7 +895,7 @@ Current legions: {legionname}";
private void myShopToolStripMenuItem_Click(object sender, EventArgs e)
{
ServerManager.SendMessage("user_get_shop", SaveSystem.CurrentSave.Username);
ServerManager.SendMessage("user_get_shop", SaveSystem.CurrentUser.Username);
}
private void btneditshop_Click(object sender, EventArgs e)
@ -923,7 +923,7 @@ Current legions: {legionname}";
{
ServerManager.SendMessage("delete_save", JsonConvert.SerializeObject(new ClientSave
{
Username = SaveSystem.CurrentSave.Username,
Username = SaveSystem.CurrentUser.Username,
Password = SaveSystem.CurrentSave.Password
}));

View file

@ -306,7 +306,7 @@ namespace ShiftOS.WinForms.Applications
System.IO.Directory.CreateDirectory(Paths.SharedFolder + "\\skins");
}
string path = Paths.SharedFolder + "\\skins\\" + SaveSystem.CurrentSave.Username + "-" + fname;
string path = Paths.SharedFolder + "\\skins\\" + SaveSystem.CurrentUser.Username + "-" + fname;
System.IO.File.WriteAllText(path, JsonConvert.SerializeObject(LoadedSkin));
})));

View file

@ -107,7 +107,7 @@ namespace ShiftOS.WinForms
Thread.Sleep(2000);
writeSlow($"Hello there, fellow multi-user domain user.");
writeSlow("My name, as you can tell, is hacker101.");
writeSlow("And yours must be... don't say it... it's " + SaveSystem.CurrentSave.Username + "@" + SaveSystem.CurrentSave.SystemName + ", right?");
writeSlow("And yours must be... don't say it... it's " + SaveSystem.CurrentUser.Username + "@" + SaveSystem.CurrentSave.SystemName + ", right?");
writeSlow("Of course it is.");
writeSlow("And I bet you 10,000 Codepoints that you have... " + SaveSystem.CurrentSave.Codepoints.ToString() + " Codepoints.");
writeSlow("Oh, and how much upgrades have you installed since you first started using ShiftOS?");
@ -135,7 +135,7 @@ namespace ShiftOS.WinForms
Console.Write(" ..done");
TerminalBackend.InStory = false;
TerminalBackend.PrefixEnabled = true;
Console.Write($"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
Console.Write($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
StartHackerTutorial();
TerminalBackend.PrefixEnabled = true;
TerminalBackend.PrintPrompt();
@ -454,7 +454,7 @@ namespace ShiftOS.WinForms
var sve = JsonConvert.DeserializeObject<Save>(msg.Contents);
if(sve.Password == pass)
{
Console.WriteLine("Username: " + sve.Username);
Console.WriteLine("Username: " + SaveSystem.CurrentUser.Username);
Console.WriteLine("Password: " + sve.Password);
Console.WriteLine("System name: " + sve.SystemName);
Console.WriteLine();
@ -531,7 +531,7 @@ namespace ShiftOS.WinForms
}
sve.Codepoints -= amount;
SaveSystem.TransferCodepointsFrom(sve.Username, amount);
SaveSystem.TransferCodepointsFrom(SaveSystem.CurrentUser.Username, amount);
ServerManager.SendMessage("mud_save_allow_dead", JsonConvert.SerializeObject(sve));
SaveSystem.SaveGame();
}

View file

@ -302,7 +302,7 @@ namespace ShiftOS.WinForms
var client = new UniteClient("http://getshiftos.ml", token);
var sve = new Save();
sve.Username = client.GetEmail();
SaveSystem.CurrentUser.Username = client.GetEmail();
sve.Password = Guid.NewGuid().ToString();
sve.SystemName = client.GetSysName();
sve.UniteAuthToken = token;

View file

@ -142,7 +142,7 @@ namespace ShiftOS.WinForms.Stories
{
WriteLine("DevX@mud - user connecting to your system.", false);
Thread.Sleep(2000);
WriteLine($"Hello, {SaveSystem.CurrentSave.Username}. It's been a while.");
WriteLine($"Hello, {SaveSystem.CurrentUser.Username}. It's been a while.");
WriteLine("My intelligence suggests you've installed all GUI-based Shiftorium upgrades.");
WriteLine("Bet you're liking ShiftOS now that the terminal isn't the only way you can control it.");
WriteLine("Well, now it's time to introduce your next task.");

View file

@ -95,7 +95,7 @@ namespace ShiftOS.Engine
{
TerminalBackend.IsForwardingConsoleWrites = forwarding;
TerminalBackend.ForwardGUID = (forwarding == true) ? fGuid : null;
Console.WriteLine($"{SaveSystem.CurrentSave.Username} says \"{result}\".");
Console.WriteLine($"{SaveSystem.CurrentUser.Username} says \"{result}\".");
TerminalBackend.IsForwardingConsoleWrites = false;
};
Desktop.InvokeOnWorkerThread(new Action(() =>

View file

@ -312,7 +312,7 @@ end");
{
Console.WriteLine("");
Lua(lua);
Console.WriteLine($"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
Console.WriteLine($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
}
catch (Exception e)
{

View file

@ -148,7 +148,7 @@ Ping: {ServerManager.DigitalSocietyPing} ms
switch(msg.Name)
{
case "getguid_fromserver":
if(SaveSystem.CurrentSave.Username == msg.Contents)
if(SaveSystem.CurrentUser.Username == msg.Contents)
{
client.Send(new NetObject("yes_i_am", new ServerMessage
{
@ -244,7 +244,7 @@ Ping: {ServerManager.DigitalSocietyPing} ms
else if(msg.Name == "update_your_cp")
{
var args = JsonConvert.DeserializeObject<Dictionary<string, object>>(msg.Contents);
if(args["username"] as string == SaveSystem.CurrentSave.Username)
if(args["username"] as string == SaveSystem.CurrentUser.Username)
{
SaveSystem.CurrentSave.Codepoints += (long)args["amount"];
Desktop.InvokeOnWorkerThread(new Action(() =>

View file

@ -581,7 +581,7 @@ namespace ShiftOS.Engine
if (TerminalBackend.PrefixEnabled)
{
text3 = text4.Remove(0, $"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ".Length);
text3 = text4.Remove(0, $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ".Length);
}
IsForwardingConsoleWrites = true;
if (TerminalBackend.InStory == false)
@ -590,7 +590,7 @@ namespace ShiftOS.Engine
}
if (TerminalBackend.PrefixEnabled)
{
Console.Write($"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
Console.Write($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
}
IsForwardingConsoleWrites = false;
}
@ -605,7 +605,7 @@ namespace ShiftOS.Engine
string pass = a["password"] as string;
string sys = a["sysname"] as string;
string guid = msg.GUID;
if (SaveSystem.CurrentSave.Username == uName && SaveSystem.CurrentSave.Password == pass && CurrentSave.SystemName == sys)
if (SaveSystem.CurrentUser.Username == uName && SaveSystem.CurrentSave.Password == pass && CurrentSave.SystemName == sys)
{
ForwardGUID = guid;
ServerManager.SendMessage("trm_handshake_accept", $@"{{
@ -615,7 +615,7 @@ namespace ShiftOS.Engine
IsForwardingConsoleWrites = true;
InvokeCommand("sos.status");
Console.Write($"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
Console.Write($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
IsForwardingConsoleWrites = false;
}
}