// Token: 0x06000CB1 RID: 3249 RVA: 0x00030E84 File Offset: 0x0002F084
 public static string GetString(string strName, string strDefault)
 {
     global::ConsoleSystem.Arg arg = new global::ConsoleSystem.Arg(strName);
     if (arg.Invalid)
     {
         return(strDefault);
     }
     Type[] array = global::ConsoleSystem.FindTypes(arg.Class);
     if (array.Length == 0)
     {
         return(strDefault);
     }
     foreach (Type type in array)
     {
         FieldInfo field = type.GetField(arg.Function);
         if (field != null && field.IsStatic)
         {
             return(field.GetValue(null).ToString());
         }
         PropertyInfo property = type.GetProperty(arg.Function);
         if (property != null && property.GetGetMethod().IsStatic)
         {
             return(property.GetValue(null, null).ToString());
         }
     }
     return(strDefault);
 }
Esempio n. 2
0
    // Token: 0x06000426 RID: 1062 RVA: 0x00014C84 File Offset: 0x00012E84
    private static bool GetCharacterStuff(ref global::ConsoleSystem.Arg args, out global::Character character, out global::CameraMount camera, out global::ItemRepresentation itemRep, out global::ArmorModelRenderer armor)
    {
        character = null;
        itemRep   = null;
        armor     = null;
        camera    = global::CameraMount.current;
        if (!camera)
        {
            args.ReplyWith("Theres no active camera mount.");
            return(false);
        }
        character = (IDBase.GetMain(camera) as global::Character);
        if (!character)
        {
            args.ReplyWith("theres no character for the current mounted camera");
            return(false);
        }
        armor = character.GetLocal <global::ArmorModelRenderer>();
        global::InventoryHolder local = character.GetLocal <global::InventoryHolder>();

        if (local)
        {
            itemRep = local.itemRepresentation;
        }
        return(true);
    }
    public static void show(ref global::ConsoleSystem.Arg arg)
    {
        bool changing = false;

        bool.TryParse(arg.Args[0], out changing);
        global::LockEntry.Show(changing);
    }
Esempio n. 4
0
 public static void time(ref global::ConsoleSystem.Arg arg)
 {
     if (!global::EnvironmentControlCenter.Singleton)
     {
         return;
     }
     arg.ReplyWith("Current Time: " + global::EnvironmentControlCenter.Singleton.GetTime().ToString());
 }
    public static void popup(ref global::ConsoleSystem.Arg arg)
    {
        float  @float  = arg.GetFloat(0, 2f);
        string @string = arg.GetString(1, "!");
        string string2 = arg.GetString(2, "This is the text");

        global::PopupUI.singleton.CreateNotice(@float, @string, string2);
    }
Esempio n. 6
0
 public static void disconnect(ref global::ConsoleSystem.Arg arg)
 {
     if (!global::NetCull.isClientRunning)
     {
         Debug.Log("You're not connected to a server.");
         return;
     }
     global::NetCull.Disconnect();
 }
Esempio n. 7
0
    public static void show_branding(ref global::ConsoleSystem.Arg args)
    {
        GameObject gameObject = GameObject.Find("BrandingPanel");

        if (gameObject == null)
        {
            return;
        }
        gameObject.GetComponent <global::dfPanel>().Show();
    }
Esempio n. 8
0
 public static void reconnect(ref global::ConsoleSystem.Arg arg)
 {
     if (PlayerPrefs.HasKey("net.lasturl"))
     {
         global::ConsoleSystem.Run("net.connect " + PlayerPrefs.GetString("net.lasturl"), false);
     }
     else
     {
         Debug.Log("You havn't connected to a server yet");
     }
 }
Esempio n. 9
0
    public static void save(ref global::ConsoleSystem.Arg arg)
    {
        if (!Directory.Exists("cfg"))
        {
            Directory.CreateDirectory("cfg");
        }
        string path     = global::config.ConfigName();
        string contents = global::ConsoleSystem.SaveToConfigString();

        File.WriteAllText(path, contents);
        arg.ReplyWith("Saved config.cfg");
    }
Esempio n. 10
0
    public static void load(ref global::ConsoleSystem.Arg arg)
    {
        string text    = global::config.ConfigName();
        string strFile = "\r\necho default config\r\ninput.bind Left A None\r\ninput.bind Right D None\r\ninput.bind Up W None\r\ninput.bind Down S None\r\ninput.bind Jump Space None\r\ninput.bind Duck LeftControl None\r\ninput.bind Sprint LeftShift None\r\ninput.bind Fire Mouse0 None\r\ninput.bind AltFire Mouse1 None\r\ninput.bind Reload R None\r\ninput.bind Use E None\r\ninput.bind Inventory Tab None\r\ninput.bind Flashlight F None\r\ninput.bind Laser G None\r\ninput.bind Voice V None\r\ninput.bind Chat Return T\r\nrender.update\r\n";

        if (File.Exists(text))
        {
            strFile = File.ReadAllText(text);
        }
        global::ConsoleSystem.RunFile(strFile);
        arg.ReplyWith("Loaded " + text);
    }
Esempio n. 11
0
    public static void add(ref global::ConsoleSystem.Arg arg)
    {
        if (!global::chat.enabled)
        {
            return;
        }
        string @string = arg.GetString(0, string.Empty);
        string string2 = arg.GetString(1, string.Empty);

        if (@string == string.Empty || string2 == string.Empty)
        {
            return;
        }
        global::ChatUI.AddLine(@string, string2);
    }
Esempio n. 12
0
    public static void bind(ref global::ConsoleSystem.Arg args)
    {
        if (!args.HasArgs(3))
        {
            return;
        }
        string strName = args.Args[0];
        string a       = args.Args[1];
        string b       = args.Args[2];

        global::GameInput.GameButton button = global::GameInput.GetButton(strName);
        if (button != null)
        {
            button.Bind(a, b);
        }
    }
 // Token: 0x06000CCB RID: 3275 RVA: 0x000315C0 File Offset: 0x0002F7C0
 public static bool RunCommand_Clientside(string strCommand, out string StrOutput, bool bWantsFeedback = false)
 {
     StrOutput = string.Empty;
     global::ConsoleSystem.Arg arg = new global::ConsoleSystem.Arg(strCommand);
     if (arg.Invalid)
     {
         return(false);
     }
     if (!global::ConsoleSystem.RunCommand(ref arg, bWantsFeedback))
     {
         return(false);
     }
     if (arg.Reply != null && arg.Reply.Length > 0)
     {
         StrOutput = arg.Reply;
     }
     return(true);
 }
Esempio n. 14
0
    public static void connect(ref global::ConsoleSystem.Arg arg)
    {
        Object @object = Object.FindObjectOfType(typeof(global::ClientConnect));

        if (@object)
        {
            Debug.Log("Connect already in progress!");
            return;
        }
        if (global::NetCull.isClientRunning)
        {
            Debug.Log("Use net.disconnect before trying to connect to a new server.");
            return;
        }
        string[] array = arg.GetString(0, string.Empty).Split(new char[]
        {
            ':'
        });
        if (array.Length != 2)
        {
            Debug.Log("Not a valid ip - or port missing");
            return;
        }
        string text = array[0];
        int    num  = int.Parse(array[1]);

        Debug.Log(string.Concat(new object[]
        {
            "Connecting to ",
            text,
            ":",
            num
        }));
        PlayerPrefs.SetString("net.lasturl", arg.GetString(0, string.Empty));
        global::ClientConnect clientConnect = global::ClientConnect.Instance();

        if (!clientConnect.DoConnect(text, num))
        {
            return;
        }
        global::LoadingScreen.Show();
        global::LoadingScreen.Update("connecting..");
    }
Esempio n. 15
0
 public static void hide(ref global::ConsoleSystem.Arg args)
 {
     global::GUIHide.SetVisible(false);
 }
Esempio n. 16
0
 public static void show(ref global::ConsoleSystem.Arg args)
 {
     global::GUIHide.SetVisible(true);
 }
Esempio n. 17
0
 public static void update(ref global::ConsoleSystem.Arg args)
 {
     global::render.update();
 }
Esempio n. 18
0
 public static void drop(ref global::ConsoleSystem.Arg arg)
 {
 }
    // Token: 0x06000CCC RID: 3276 RVA: 0x0003161C File Offset: 0x0002F81C
    public static bool RunCommand(ref global::ConsoleSystem.Arg arg, bool bWantReply = true)
    {
        Type[] array = global::ConsoleSystem.FindTypes(arg.Class);
        if (array.Length == 0)
        {
            if (bWantReply)
            {
                arg.ReplyWith("Console class not found: " + arg.Class);
            }
            return(false);
        }
        if (bWantReply)
        {
            arg.ReplyWith(string.Concat(new string[]
            {
                "command ",
                arg.Class,
                ".",
                arg.Function,
                " was executed"
            }));
        }
        Type[] array2 = array;
        int    i      = 0;

        while (i < array2.Length)
        {
            Type       type   = array2[i];
            MethodInfo method = type.GetMethod(arg.Function);
            if (method != null && method.IsStatic)
            {
                if (!arg.CheckPermissions(method.GetCustomAttributes(true)))
                {
                    if (bWantReply)
                    {
                        arg.ReplyWith("No permission: " + arg.Class + "." + arg.Function);
                    }
                    return(false);
                }
                object[] array3 = new global::ConsoleSystem.Arg[]
                {
                    arg
                };
                try
                {
                    method.Invoke(null, array3);
                }
                catch (Exception ex)
                {
                    Debug.LogWarning(string.Concat(new string[]
                    {
                        "Error: ",
                        arg.Class,
                        ".",
                        arg.Function,
                        " - ",
                        ex.Message
                    }));
                    arg.ReplyWith(string.Concat(new string[]
                    {
                        "Error: ",
                        arg.Class,
                        ".",
                        arg.Function,
                        " - ",
                        ex.Message
                    }));
                    return(false);
                }
                arg = (array3[0] as global::ConsoleSystem.Arg);
                return(true);
            }
            else
            {
                FieldInfo field = type.GetField(arg.Function);
                if (field != null && field.IsStatic)
                {
                    if (!arg.CheckPermissions(field.GetCustomAttributes(true)))
                    {
                        if (bWantReply)
                        {
                            arg.ReplyWith("No permission: " + arg.Class + "." + arg.Function);
                        }
                        return(false);
                    }
                    Type fieldType = field.FieldType;
                    if (arg.HasArgs(1))
                    {
                        try
                        {
                            string str = field.GetValue(null).ToString();
                            if (fieldType == typeof(float))
                            {
                                field.SetValue(null, float.Parse(arg.Args[0]));
                            }
                            if (fieldType == typeof(int))
                            {
                                field.SetValue(null, int.Parse(arg.Args[0]));
                            }
                            if (fieldType == typeof(string))
                            {
                                field.SetValue(null, arg.Args[0]);
                            }
                            if (fieldType == typeof(bool))
                            {
                                field.SetValue(null, bool.Parse(arg.Args[0]));
                            }
                            if (bWantReply)
                            {
                                arg.ReplyWith(string.Concat(new string[]
                                {
                                    arg.Class,
                                    ".",
                                    arg.Function,
                                    ": changed ",
                                    Facepunch.Utility.String.QuoteSafe(str),
                                    " to ",
                                    Facepunch.Utility.String.QuoteSafe(field.GetValue(null).ToString()),
                                    " (",
                                    fieldType.Name,
                                    ")"
                                }));
                            }
                        }
                        catch (Exception)
                        {
                            if (bWantReply)
                            {
                                arg.ReplyWith("error setting value: " + arg.Class + "." + arg.Function);
                            }
                        }
                    }
                    else if (bWantReply)
                    {
                        arg.ReplyWith(string.Concat(new string[]
                        {
                            arg.Class,
                            ".",
                            arg.Function,
                            ": ",
                            Facepunch.Utility.String.QuoteSafe(field.GetValue(null).ToString()),
                            " (",
                            fieldType.Name,
                            ")"
                        }));
                    }
                    return(true);
                }
                else
                {
                    PropertyInfo property = type.GetProperty(arg.Function);
                    if (property != null && property.GetGetMethod().IsStatic&& property.GetSetMethod().IsStatic)
                    {
                        if (!arg.CheckPermissions(property.GetCustomAttributes(true)))
                        {
                            if (bWantReply)
                            {
                                arg.ReplyWith("No permission: " + arg.Class + "." + arg.Function);
                            }
                            return(false);
                        }
                        Type propertyType = property.PropertyType;
                        if (arg.HasArgs(1))
                        {
                            try
                            {
                                string str2 = property.GetValue(null, null).ToString();
                                if (propertyType == typeof(float))
                                {
                                    property.SetValue(null, float.Parse(arg.Args[0]), null);
                                }
                                if (propertyType == typeof(int))
                                {
                                    property.SetValue(null, int.Parse(arg.Args[0]), null);
                                }
                                if (propertyType == typeof(string))
                                {
                                    property.SetValue(null, arg.Args[0], null);
                                }
                                if (propertyType == typeof(bool))
                                {
                                    property.SetValue(null, bool.Parse(arg.Args[0]), null);
                                }
                                if (bWantReply)
                                {
                                    arg.ReplyWith(string.Concat(new string[]
                                    {
                                        arg.Class,
                                        ".",
                                        arg.Function,
                                        ": changed ",
                                        Facepunch.Utility.String.QuoteSafe(str2),
                                        " to ",
                                        Facepunch.Utility.String.QuoteSafe(property.GetValue(null, null).ToString()),
                                        " (",
                                        propertyType.Name,
                                        ")"
                                    }));
                                }
                            }
                            catch (Exception)
                            {
                                if (bWantReply)
                                {
                                    arg.ReplyWith("error setting value: " + arg.Class + "." + arg.Function);
                                }
                            }
                        }
                        else if (bWantReply)
                        {
                            arg.ReplyWith(string.Concat(new string[]
                            {
                                arg.Class,
                                ".",
                                arg.Function,
                                ": ",
                                Facepunch.Utility.String.QuoteSafe(property.GetValue(null, null).ToString()),
                                " (",
                                propertyType.Name,
                                ")"
                            }));
                        }
                        return(true);
                    }
                    else
                    {
                        i++;
                    }
                }
            }
        }
        if (bWantReply)
        {
            arg.ReplyWith("Command not found: " + arg.Class + "." + arg.Function);
        }
        return(false);
    }
Esempio n. 20
0
 public static void create_error(ref global::ConsoleSystem.Arg arg)
 {
     Debug.LogError("this is an error");
 }
Esempio n. 21
0
 public static void reassign(ref global::ConsoleSystem.Arg arg)
 {
     global::TerrainControl.ter_reassign();
 }
Esempio n. 22
0
 public static void echo(ref global::ConsoleSystem.Arg arg)
 {
     arg.ReplyWith(arg.ArgsStr);
 }
Esempio n. 23
0
    public static void inventory(ref global::ConsoleSystem.Arg arg)
    {
        string @string = arg.GetString(0, "This is the text");

        global::PopupUI.singleton.CreateInventory(@string);
    }
Esempio n. 24
0
 public static void show(ref global::ConsoleSystem.Arg arg)
 {
     global::MainMenu.singleton.Show();
 }
Esempio n. 25
0
    public static void find(ref global::ConsoleSystem.Arg arg)
    {
        if (!arg.HasArgs(1))
        {
            return;
        }
        string text  = arg.Args[0];
        string text2 = string.Empty;

        Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
        for (int i = 0; i < assemblies.Length; i++)
        {
            Type[] types = assemblies[i].GetTypes();
            for (int j = 0; j < types.Length; j++)
            {
                if (types[j].IsSubclassOf(typeof(global::ConsoleSystem)))
                {
                    MethodInfo[] methods = types[j].GetMethods();
                    for (int k = 0; k < methods.Length; k++)
                    {
                        if (methods[k].IsStatic)
                        {
                            if (!(text != "*") || types[j].Name.Contains(text) || methods[k].Name.Contains(text))
                            {
                                if (arg.CheckPermissions(methods[k].GetCustomAttributes(true)))
                                {
                                    string text3 = text2;
                                    text2 = string.Concat(new string[]
                                    {
                                        text3,
                                        types[j].Name,
                                        ".",
                                        global::global.BuildMethodString(ref methods[k]),
                                        "\n"
                                    });
                                }
                            }
                        }
                    }
                    FieldInfo[] fields = types[j].GetFields();
                    for (int l = 0; l < fields.Length; l++)
                    {
                        if (fields[l].IsStatic)
                        {
                            if (!(text != "*") || types[j].Name.Contains(text) || fields[l].Name.Contains(text))
                            {
                                if (arg.CheckPermissions(fields[l].GetCustomAttributes(true)))
                                {
                                    string text3 = text2;
                                    text2 = string.Concat(new string[]
                                    {
                                        text3,
                                        types[j].Name,
                                        ".",
                                        global::global.BuildFieldsString(ref fields[l]),
                                        "\n"
                                    });
                                }
                            }
                        }
                    }
                    PropertyInfo[] properties = types[j].GetProperties();
                    for (int m = 0; m < properties.Length; m++)
                    {
                        if (!(text != "*") || types[j].Name.Contains(text) || properties[m].Name.Contains(text))
                        {
                            if (arg.CheckPermissions(properties[m].GetCustomAttributes(true)))
                            {
                                string text3 = text2;
                                text2 = string.Concat(new string[]
                                {
                                    text3,
                                    types[j].Name,
                                    ".",
                                    global::global.BuildPropertyString(ref properties[m]),
                                    "\n"
                                });
                            }
                        }
                    }
                }
            }
        }
        arg.ReplyWith("Finding " + text + ":\n" + text2);
    }
Esempio n. 26
0
 public static void quit(ref global::ConsoleSystem.Arg arg)
 {
     Application.Quit();
 }
Esempio n. 27
0
 public static void test(ref global::ConsoleSystem.Arg arg)
 {
     global::PopupUI.singleton.StartCoroutine("DoTests");
 }
Esempio n. 28
0
 public static void mat(ref global::ConsoleSystem.Arg arg)
 {
     global::TerrainControl.ter_mat();
 }
Esempio n. 29
0
 public static void hide(ref global::ConsoleSystem.Arg arg)
 {
     global::MainMenu.singleton.Hide();
 }
Esempio n. 30
0
 public static void flushtrees(ref global::ConsoleSystem.Arg arg)
 {
     global::TerrainControl.ter_flushtrees();
 }