private void LoadSavedState(string stateString) { string[] termInfo = IGC_Utils.SplitString(":", stateString); int vsID = System.Int32.Parse(termInfo[3]); bool powerstate = (termInfo[2] == "True" ? true : false); string currentUsername = termInfo[0], prevUsername = termInfo[1], rawPrompt = (termInfo[4] != "null" ? IGC_Utils.UnescapeSaved(termInfo[4]) : ""), rawDisplay = (termInfo[5] != "null" ? IGC_Utils.UnescapeSaved(termInfo[5]) : ""); screenColor = IGC_Utils.ColorFromString(termInfo [6]); textColor = IGC_Utils.ColorFromString(termInfo [7]); //set vs if (vsID != this.virtualSystem.instanceID) { IGC_VirtualSystem tempRef = IGC_VirtualSystem.GetInstanceByID(vsID); SwapVirtualSystem(ref tempRef); } //since comp instances load one at a time, it's possible to swap a terminal's VS for one that's not setup yet. //therefore you have to wait for ready before setting current and prev users StartCoroutine(SetCurrenUserWhenURReady(virtualSystem.userRegistry, currentUsername, prevUsername)); //set power state PowerActions(powerstate); SetTextColor(textColor); //only text here, screen is already set in MonitorActions shell.rawPromptText = rawPrompt; shell.rawDisplayText = rawDisplay; }
[RPC] void SwapVSRPC(int vsID) { IGC_VirtualSystem vs = IGC_VirtualSystem.GetInstanceByID(vsID); this.virtualSystem = vs; this.shell.lang = vs.language; }
[RPC] private void AddUserRPC(string username, string password, bool isAdmin, int vsID, bool canLogin) { IGC_User user = new IGC_User(username, password, isAdmin, IGC_VirtualSystem.GetInstanceByID(vsID), canLogin); users.Add(user.name, user); CreateUserHomeDir(user); }