void Start() { //if there's a networkview and no multiplayer connection, if (Network.peerType == NetworkPeerType.Disconnected && GetComponent <NetworkView>() != null && !InGameComputer.waitForNetwork) { GetComponent <NetworkView>().enabled = false; //Destroy(networkView); } if (virtualSystem == null) { virtualSystem = gameObject.GetComponent <IGC_VirtualSystem>(); } cursor = transform.Find("monitor/display/cursor_holder/cursor"); output = transform.Find("monitor/display/output").GetComponent <TextMesh>(); prompt = transform.Find("monitor/display/prompt").GetComponent <TextMesh>(); caret = transform.Find("monitor/display/caret").GetComponent <TextMesh>(); infoLine = transform.Find("monitor/display/info_line").GetComponent <TextMesh>(); screen = transform.Find("monitor/screenPivot/screen"); shell = gameObject.GetComponent <IGC_Shell>(); localhost = this; }
public override string command_function() { if (issuer == null) { return(""); } IGC_Shell shell = issuer.terminal.shell; shell.rawDisplayText = ""; shell.rawPromptText = ""; shell.prompt.text = ""; shell.output.text = ""; shell.cursorOffset = 0; shell.cursorOffsetVertical = 0; if (issuer.terminal.networkReady) { shell.GetComponent <NetworkView>().RPC( "UpdateScreenRPC", RPCMode.Others, shell.prompt.text, shell.output.text, shell.cursorOffset, shell.cursorOffsetVertical, shell.lineOffset, shell.inputMode ); } return(""); }
public override string command_function() { IGC_Shell shell = issuer.terminal.shell; IGC_Language lang = virtualSystem.language; string[] content = new string[4]; int numberOfEmails = 0; //content = GetText(); numberOfEmails = GetNumberOfEmails(); string output = ""; output += "MootLuck Email Client \n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } //output += " \n"; if (numberOfEmails == 0) { for (int i = 0; i < shell.displayXY[0]; i++) { output += "~"; } output += " You have no emails to read \n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "_"; } return(output); } else { for (int j = 0; j < numberOfEmails; j++) { content = GetText(j); output += "To: " + content[0] + "\n"; output += "From: " + content[1] + "\n"; output += "Subject: " + content[2] + "\n"; //for (int i = 0; i < shell.displayXY[0]; i++) { output += "_"; } output += "Message: " + content[3] + "\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } issuer.terminal.shell.EnterViewMode(output); } return(""); } }
public override string command_function() { if (issuer == null) { return("use the login command to begin.\nonce logged in, use the help command again for detailed system usage info."); } IGC_Shell shell = issuer.terminal.shell; IGC_Language lang = virtualSystem.language; string output = ""; output += "Welcome to " + virtualSystem.modelName + " \n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } // horizontal bar output += "general use:\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } output += "type in commands and hit return to execute them. use the up and down arrows to cycle through previously typed commands. hit the tab key to complete a partially typed command or list all available commands if the prompt line is blank.\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } // horizontal bar output += "usage notation:\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } output += "[] optional item\n"; output += "<> variable required item\n"; output += "| or\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } // horizontal bar output += "key actions:\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } output += "___ Command Line Mode ___\n"; output += "return execute command\n"; output += "up cycle back in command history\n"; output += "down cycle forward in command history\n"; output += "right move cursor right one character\n"; output += "left move cursor left one character\n"; output += "tab auto complete command or list all\n"; output += "ctrl+C clear prompt\n"; output += "ctrl+L clear screen\n"; output += "ctrl+A jump to beginning of promt\n"; output += "ctrl+E jump to end of promt\n"; output += "___ Text Edit Mode ___\n"; output += "up move cursor up one line\n"; output += "down move cursor down one line\n"; output += "right move cursor right one character\n"; output += "left move cursor left one character\n"; output += "escape exit edit mode\n"; output += "___ Text View Mode ___\n"; output += "up move text up one line\n"; output += "down move text down one line\n"; output += "q|escape exit view mode\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } output += "available commands:\n"; for (int i = 0; i < shell.displayXY[0]; i++) { output += "="; } output += "\n"; foreach (IGC_Command cmd in lang.commands.Values) { string padding = " ", cmd_info = cmd.name + (padding.Remove(0, cmd.name.Length)) + cmd.description; int pointer = shell.displayXY[0]; while (pointer < cmd_info.Length) { cmd_info = cmd_info.Insert(pointer, "\n" + padding); pointer += shell.displayXY[0]; } output += cmd_info + "\n"; } issuer.terminal.shell.EnterViewMode(output); return(""); }
public override string command_function() { //terminal string termOutput = "___TERMINAL___\n"; InGameComputer igc = issuer.terminal; termOutput += "instance id: " + igc.instanceID + "\n"; termOutput += "current power state: " + igc.powerState + "\n"; termOutput += "login name/pass: "******"/" + issuer.terminal.loginPass + "\n"; termOutput += "start in on state: " + igc.startInOnState + "\n"; termOutput += "current user: "******"null") + "\n"; termOutput += "bounce back user: "******"null") + "\n"; termOutput += "remote login: "******"\n"; termOutput += "in use: " + igc.inUse + "\n"; termOutput += "terminal occupied: " + igc.terminalOccupied + "\n"; termOutput += "booting up: " + igc.bootingUp + "\n"; termOutput += "network ready: " + igc.networkReady + "\n"; //shell string shellOutput = "___SHELL___\n"; IGC_Shell sh = issuer.terminal.shell; shellOutput += "display width/height: " + sh.displayWidth + "/" + sh.displayHeight + "\n"; shellOutput += "prompt width: " + sh.promptWidth + "\n"; shellOutput += "language: " + sh.lang.LangName + "\n"; shellOutput += "terminal id: " + sh.computer.instanceID + "\n"; shellOutput += "input mode: " + sh.inputMode + "\n"; shellOutput += "capslock: " + sh.capslock + "\n"; shellOutput += "ctrl: " + sh.ctrl + "\n"; shellOutput += "history count: " + sh.history.Count + "\n"; shellOutput += "cursor offset x/y: " + sh.cursorOffset + "/" + sh.cursorOffsetVertical + "\n"; shellOutput += "display line offset: " + sh.lineOffset + "\n"; shellOutput += "last edited: " + (sh.lastEditedFile != null ? sh.lastEditedFile.path : "null") + "\n"; shellOutput += "raw edit string len: " + sh.rawEditString.Length + "\n"; shellOutput += "raw display text len: " + sh.rawDisplayText.Length + "\n"; shellOutput += "formatted display len: " + sh.output.text.Length + "\n"; shellOutput += "raw prompt text len: " + sh.rawPromptText.Length + "\n"; shellOutput += "formatted prompt len: " + sh.prompt.text.Length + "\n"; shellOutput += "infoline len: " + sh.infoLine.text.Length + "\n"; //virtual system string vsOutput = "___VIRTUAL SYSTEM___\n"; IGC_VirtualSystem vs = virtualSystem; vsOutput += "instance id: " + vs.instanceID + "\n"; vsOutput += "model name: " + vs.modelName + "\n"; vsOutput += "ip: " + vs.IP + "\n"; vsOutput += "permanent ip: " + vs.hasPermanentIP + "\n"; vsOutput += "language: " + vs.language.LangName + "\n"; vsOutput += "startup stasks complete: " + vs.startUpTasksComplete + "\n"; vsOutput += "network ready: " + vs.networkReady + "\n"; vsOutput += "erase save data on start: " + vs.eraseSaveDataOnStart + "\n"; vsOutput += "resore data len: " + vs.restoreData.Length + "\n"; //userregistry string urOutput = "___USER REGISTRY___\n"; IGC_UserRegistry ur = virtualSystem.userRegistry; urOutput += "virtual system id: " + ur.virtualSystem.instanceID + "\n"; urOutput += "ready for use: " + ur.ready + "\n"; urOutput += "users logged in: " + ur.loggedInUsers.Count + "\n"; urOutput += "users: " + ur.users.Count + "\n"; urOutput += "groups: " + ur.groups.Count + "\n"; urOutput += "users editor string: \n" + string.Join("\n", ur.usersList) + "\n"; urOutput += "groups editor string: \n" + string.Join("\n", ur.groupsList) + "\n"; //file system string fsOutput = "___FILE SYSTEM___\n"; IGC_FileSystem fs = virtualSystem.fileSystem; fsOutput += "virtual system id: " + fs.virtualSystem.instanceID + "\n"; fsOutput += "ready for use: " + fs.ready + "\n"; fsOutput += "files: " + fs.files.Count + "\n"; fsOutput += "root node: " + fs.rootNode.name + "\n"; //unique game instance id string gameID = "unique game instance id: " + IGC_VirtualSystem.uniqueID + "\n"; string output = ""; if (flags.Count > 0) { foreach (var k in flags.Keys) { if (k == "g") { output = gameID; } if (k == "t") { output = termOutput; } if (k == "s") { output = shellOutput; } if (k == "vs") { output = vsOutput; } if (k == "fs") { output = fsOutput; } if (k == "ur") { output = urOutput; } } if (output == "") { return("flag(s) not recognised"); } } else { output = gameID + termOutput + shellOutput + vsOutput + urOutput + fsOutput; } issuer.terminal.shell.EnterViewMode(output); return(""); }