예제 #1
0
 public IGC_Command_extract(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "extract";
     this.help_text     = "usage: extract <Filename> <Destination server IP>";
     this.description   = "Move files between machines";
 }
예제 #2
0
 public IGC_Command_shutdown(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "shutdown";
     this.help_text     = "shutdown the computer. if other users are logged in and you are an administrator you may force a shutdown, otherwise you cannot turn of the computer.";
     this.description   = "shutdown the computer";
 }
예제 #3
0
 public IGC_Command_logout(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "logout";
     this.help_text     = "use this command to log out the current user. if you are connected to another machine remotely, you will log out as the remote user and resume your session as the last logged user on the local system.";
     this.description   = "logout the current user";
 }
예제 #4
0
    [RPC] void SwapVSRPC(int vsID)
    {
        IGC_VirtualSystem vs = IGC_VirtualSystem.GetInstanceByID(vsID);

        this.virtualSystem = vs;
        this.shell.lang    = vs.language;
    }
예제 #5
0
 public IGC_Command_help(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "help";
     this.help_text     = "type help to see basic system usage info.";
     this.description   = "basic system usage information";
 }
예제 #6
0
    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;
    }
예제 #7
0
 public ControlBridge(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "bridge";
     this.usage         = "usage: bridge <input_file>";
     this.help_text     = "this command uses data from an input file to set the height of a bridge. \nthe file must contain only numbers seporated by commas. the number of numbers must equal the number of segments in the bridge.";
 }
예제 #8
0
 public IGC_Command_man(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "man";
     this.help_text     = "type this command followed by any other command for more information on its use";
     this.description   = "get manual entry for provided command";
 }
예제 #9
0
 public IGC_Command_tutorial(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "tutorial";
     this.help_text     = "Begins the tutorial scenario";
     this.description   = "Begins the tutorial scenario";
 }
예제 #10
0
 public IGC_Command_email(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "email";
     this.help_text     = "Usage: <email> ";
     this.description   = "Loads specified users emails";
 }
예제 #11
0
 public IGC_Command_pwd(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "pwd";
     this.help_text     = "print the name of the folder you are currently in";
     this.description   = "print the current working directory";
 }
예제 #12
0
 public IGC_Command_netscan(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "netscan";
     this.help_text     = "the netscan command shows a list of IP addresses on the local network";
     this.description   = "show network IP addresses";
 }
예제 #13
0
 public IGC_Command_ip(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "ip";
     this.help_text     = "the ip command displays the IP address of the current machine.";
     this.description   = "print IP address";
 }
예제 #14
0
 public IGC_Command_whoami(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "whoami";
     this.help_text     = "prints the name of the current user";
     this.description   = this.help_text;
 }
예제 #15
0
 public IGC_Command_who(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "who";
     this.help_text     = "the who command lists all users currently logged in on this machine";
     this.description   = "list logged in users";
 }
예제 #16
0
    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;
    }
예제 #17
0
 public IGC_Command_clear(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "clear";
     this.help_text     = "use this command to erase all text on the screen.";
     this.description   = "clear the screen";
 }
예제 #18
0
    [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);
    }
예제 #19
0
 public IGC_Command_save(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "save";
     this.help_text     = "the save command saves the edits made to the previously edited file. you may wait to save changes to a file until you use the edit program again. once you open any file, all previous edits are forgotten.";
     this.description   = "save last edited file";
 }
예제 #20
0
    void Start()
    {
        virtualSystem = gameObject.GetComponent <IGC_VirtualSystem>();

        trashBin = transform.Find("TrashBin");
        rootNode = transform.Find("fileSystem");
    }
예제 #21
0
 public IGC_Command_history(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "history";
     this.help_text     = "this commands displays previous phrases typed entered into the command line.";
     this.description   = "display past commands";
 }
예제 #22
0
 public IGC_Command_cat(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "cat";
     this.usage         = "usage: cat <file_name>";
     this.help_text     = "print the specified file";
     this.description   = this.help_text;
 }
예제 #23
0
 public IGC_Command_color(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "color";
     this.usage         = "usage: color -s=<r>,<g>,<b> -t=<r>,<g>,<b>";
     this.help_text     = "use this command to set the screen and text colors. use the -s flag for the screen, and the -t flag for the text. \nexample (red screen, blue text):\ncolor -s=1,0,0 -t=0,0,1";
     this.description   = "set the screen and text colors";
 }
예제 #24
0
 public IGC_Command_edit(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "edit";
     this.usage         = "usage: edit <file_name>";
     this.help_text     = "the edit command opens a text file for editing.\nwhen you finish editing press escape to exit edit mode. you will then be prompted to run the save command. if you do not run save the file will remain unchanged. you may wait to save the file until you use the edit command again; when you do that, all changes are erased. see \"key actions\" section in the help command for more info.";
     this.description   = "edit text files";
 }
예제 #25
0
 public IGC_Command_ssh(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "ssh";
     this.usage         = "usage: ssh <remote_user_name>:<remote_user_password>@<remote_ip_address>";
     this.help_text     = "the ssh command allows you to log in as users on other computers from your current computer.";
     this.description   = "log in on other computers";
 }
예제 #26
0
 public IGC_Command_mkdir(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "mkdir";
     this.usage         = "usage: mkdir <directory_path>";
     this.help_text     = "use this command to create new folders";
     this.description   = "create new directory";
 }
예제 #27
0
 public IGC_Command_ls(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "ls";
     this.usage         = "usage: ls [-a|l] <directory>";
     this.help_text     = "use this command to display the contents a folder. you must add the -a flag to display hidden files and folders (files and folders whose names begin with a period). the -l flag will list aditional information on the files in the specified directory.";
     this.description   = "display the contents of a directory";
 }
예제 #28
0
 public IGC_Command_mv(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "mv";
     this.usage         = "usage: mv <old_file_location> <new_file_location>";
     this.help_text     = "use this command to move a file to another location and or change its name.";
     this.description   = "move or rename a file";
 }
예제 #29
0
 public IGC_Command_cp(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "cp";
     this.usage         = "usage: cp <file> <copy_location>";
     this.help_text     = "the cp command copies a file to a new location.";
     this.description   = "copy a file";
 }
예제 #30
0
 public IGC_Command_cd(ref IGC_VirtualSystem virtualSystem)
 {
     this.virtualSystem = virtualSystem;
     this.name          = "cd";
     this.usage         = "usage: cd [directory]";
     this.help_text     = "use this command to move into other folders. use an absolute path (example: /home/username ) or a relative path (./folder_name) (folder_name). use \"..\" to move upward to the parent directory of the one you are currently in. if you do not supply a path you will cd to your home directory.";
     this.description   = "move to another directory";
 }