diff options
| author | AShifter <[email protected]> | 2017-05-04 19:01:03 -0600 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-05-04 19:01:03 -0600 |
| commit | 13b35b32c2c429e6bd2d7b41ca43cc62f305dbc5 (patch) | |
| tree | dbc42661444f813cf04f7af2fdfecb94d5b78044 /ShiftOS_TheReturn/SaveSystem.cs | |
| parent | 2fede89938014129cf50d66d5ff62af1bde4a477 (diff) | |
| parent | a57b5855f5a2b7e5f89e411a5cbe66dd0dcb50d6 (diff) | |
| download | shiftos_thereturn-13b35b32c2c429e6bd2d7b41ca43cc62f305dbc5.tar.gz shiftos_thereturn-13b35b32c2c429e6bd2d7b41ca43cc62f305dbc5.tar.bz2 shiftos_thereturn-13b35b32c2c429e6bd2d7b41ca43cc62f305dbc5.zip | |
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS_TheReturn/SaveSystem.cs')
| -rw-r--r-- | ShiftOS_TheReturn/SaveSystem.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index 945869b..c3289ea 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -198,6 +198,52 @@ namespace ShiftOS.Engine Thread.Sleep(50); Console.WriteLine("{SYSTEM_INITIATED}"); + Sysname: + bool waitingForNewSysName = false; + bool gobacktosysname = false; + + if (string.IsNullOrWhiteSpace(CurrentSave.SystemName)) + { + Infobox.PromptText("Enter a system name", "Your system does not have a name. All systems within the digital society must have a name. Please enter one.", (name)=> + { + if (string.IsNullOrWhiteSpace(name)) + Infobox.Show("Invalid name", "Please enter a valid name.", () => + { + gobacktosysname = true; + waitingForNewSysName = false; + }); + else if (name.Length < 5) + Infobox.Show("Value too small.", "Your system name must have at least 5 characters in it.", () => + { + gobacktosysname = true; + waitingForNewSysName = false; + }); + else + { + CurrentSave.SystemName = name; + if (!string.IsNullOrWhiteSpace(CurrentSave.UniteAuthToken)) + { + var unite = new Unite.UniteClient("http://getshiftos.ml", CurrentSave.UniteAuthToken); + unite.SetSysName(name); + } + SaveSystem.SaveGame(); + gobacktosysname = false; + waitingForNewSysName = false; + } + }); + + + } + + while (waitingForNewSysName) + { + Thread.Sleep(10); + } + + if (gobacktosysname) + { + goto Sysname; + } if (CurrentSave.Users == null) CurrentSave.Users = new List<ClientSave>(); |
