| using System; |
| using System; |
| using System.Collections; |
| using System.Collections; |
| using System.Collections.Concurrent; |
| using System.Collections.Concurrent; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| using System.Globalization; |
| using System.Globalization; |
| using System.Linq; |
| using System.Linq; |
| using System.Runtime.CompilerServices; |
| using System.Runtime.CompilerServices; |
| using System.Text; |
| using System.Text; |
| using GUIFramework; |
| using GUIFramework; |
| using TMPro; |
| using TMPro; |
| using UnityEngine; |
| using UnityEngine; |
| |
| |
| public abstract class Terminal : MonoBehaviour |
| public abstract class Terminal : MonoBehaviour |
| { |
| { |
| private static void InitTerminal() |
| private static void InitTerminal() |
| { |
| { |
| if (Terminal.m_terminalInitialized) |
| if (Terminal.m_terminalInitialized) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| Terminal.m_terminalInitialized = true; |
| Terminal.m_terminalInitialized = true; |
| Terminal.AddConsoleCheatCommands(); |
| Terminal.AddConsoleCheatCommands(); |
| new Terminal.ConsoleCommand("help", "Shows a list of console commands (optional: help 2 4 shows the second quarter)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("help", "Shows a list of console commands (optional: help 2 4 shows the second quarter)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (ZNet.instance && ZNet.instance.IsServer()) |
| if (ZNet.instance && ZNet.instance.IsServer()) |
| { |
| { |
| Player.m_localPlayer; |
| Player.m_localPlayer; |
| } |
| } |
| args.Context.IsCheatsEnabled(); |
| args.Context.IsCheatsEnabled(); |
| List<string> list = new List<string>(); |
| List<string> list = new List<string>(); |
| foreach (KeyValuePair<string, Terminal.ConsoleCommand> keyValuePair in Terminal.commands) |
| foreach (KeyValuePair<string, Terminal.ConsoleCommand> keyValuePair in Terminal.commands) |
| { |
| { |
| if (keyValuePair.Value.ShowCommand(args.Context)) |
| if (keyValuePair.Value.ShowCommand(args.Context)) |
| { |
| { |
| list.Add(keyValuePair.Value.Command + " - " + keyValuePair.Value.Description); |
| list.Add(keyValuePair.Value.Command + " - " + keyValuePair.Value.Description); |
| } |
| } |
| } |
| } |
| list.Sort(); |
| list.Sort(); |
| if (args.Context != null) |
| if (args.Context != null) |
| { |
| { |
| int num = args.TryParameterInt(2, 5); |
| int num = args.TryParameterInt(2, 5); |
| int num2; |
| int num2; |
| if (args.TryParameterInt(1, out num2)) |
| if (args.TryParameterInt(1, out num2)) |
| { |
| { |
| int num3 = list.Count / num; |
| int num3 = list.Count / num; |
| for (int j = num3 * (num2 - 1); j < Mathf.Min(list.Count, num3 * (num2 - 1) + num3); j++) |
| for (int j = num3 * (num2 - 1); j < Mathf.Min(list.Count, num3 * (num2 - 1) + num3); j++) |
| { |
| { |
| args.Context.AddString(list[j]); |
| args.Context.AddString(list[j]); |
| } |
| } |
| return; |
| return; |
| } |
| } |
| foreach (string text in list) |
| foreach (string text in list) |
| { |
| { |
| args.Context.AddString(text); |
| args.Context.AddString(text); |
| } |
| } |
| } |
| } |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("devcommands", "enables cheats", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("devcommands", "enables cheats", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (ZNet.instance && !ZNet.instance.IsServer()) |
| if (ZNet.instance && !ZNet.instance.IsServer()) |
| { |
| { |
| ZNet.instance.RemoteCommand("devcommands"); |
| ZNet.instance.RemoteCommand("devcommands"); |
| } |
| } |
| Terminal.m_cheat = !Terminal.m_cheat; |
| Terminal.m_cheat = !Terminal.m_cheat; |
| Terminal context = args.Context; |
| Terminal context = args.Context; |
| if (context != null) |
| if (context != null) |
| { |
| { |
| context.AddString("Dev commands: " + Terminal.m_cheat.ToString()); |
| context.AddString("Dev commands: " + Terminal.m_cheat.ToString()); |
| } |
| } |
| Terminal context2 = args.Context; |
| Terminal context2 = args.Context; |
| if (context2 != null) |
| if (context2 != null) |
| { |
| { |
| context2.AddString("WARNING: using any dev commands is not recommended and is done at your own risk."); |
| context2.AddString("WARNING: using any dev commands is not recommended and is done at your own risk."); |
| } |
| } |
| Gogan.LogEvent("Cheat", "CheatsEnabled", Terminal.m_cheat.ToString(), 0L); |
| Gogan.LogEvent("Cheat", "CheatsEnabled", Terminal.m_cheat.ToString(), 0L); |
| args.Context.updateCommandList(); |
| args.Context.updateCommandList(); |
| }, false, false, false, true, false, null, false, false, false); |
| }, false, false, false, true, false, null, false, false, false); |
| new Terminal.ConsoleCommand("hidebetatext", "", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("hidebetatext", "", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Hud.instance) |
| if (Hud.instance) |
| { |
| { |
| Hud.instance.ToggleBetaTextVisible(); |
| Hud.instance.ToggleBetaTextVisible(); |
| } |
| } |
| }, false, false, false, true, false, null, false, false, false); |
| }, false, false, false, true, false, null, false, false, false); |
| new Terminal.ConsoleCommand("ping", "ping server", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("ping", "ping server", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Game.instance) |
| if (Game.instance) |
| { |
| { |
| Game.instance.Ping(); |
| Game.instance.Ping(); |
| } |
| } |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("dpsdebug", "toggle dps debug print", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("dpsdebug", "toggle dps debug print", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Character.SetDPSDebug(!Character.IsDPSDebugEnabled()); |
| Character.SetDPSDebug(!Character.IsDPSDebugEnabled()); |
| Terminal context3 = args.Context; |
| Terminal context3 = args.Context; |
| if (context3 == null) |
| if (context3 == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| context3.AddString("DPS debug " + Character.IsDPSDebugEnabled().ToString()); |
| context3.AddString("DPS debug " + Character.IsDPSDebugEnabled().ToString()); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("lodbias", "set distance lod bias", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("lodbias", "set distance lod bias", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length == 1) |
| if (args.Length == 1) |
| { |
| { |
| args.Context.AddString("Lod bias:" + QualitySettings.lodBias.ToString()); |
| args.Context.AddString("Lod bias:" + QualitySettings.lodBias.ToString()); |
| return; |
| return; |
| } |
| } |
| float num4; |
| float num4; |
| if (args.TryParameterFloat(1, out num4)) |
| if (args.TryParameterFloat(1, out num4)) |
| { |
| { |
| args.Context.AddString("Setting lod bias:" + num4.ToString()); |
| args.Context.AddString("Setting lod bias:" + num4.ToString()); |
| QualitySettings.lodBias = num4; |
| QualitySettings.lodBias = num4; |
| } |
| } |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("info", "print system info", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("info", "print system info", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| args.Context.AddString("Render threading mode:" + SystemInfo.renderingThreadingMode.ToString()); |
| args.Context.AddString("Render threading mode:" + SystemInfo.renderingThreadingMode.ToString()); |
| long totalMemory = GC.GetTotalMemory(false); |
| long totalMemory = GC.GetTotalMemory(false); |
| args.Context.AddString("Total allocated mem: " + (totalMemory / 1048576L).ToString("0") + "mb"); |
| args.Context.AddString("Total allocated mem: " + (totalMemory / 1048576L).ToString("0") + "mb"); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("gc", "shows garbage collector information", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("gc", "shows garbage collector information", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| long totalMemory2 = GC.GetTotalMemory(false); |
| long totalMemory2 = GC.GetTotalMemory(false); |
| GC.Collect(); |
| GC.Collect(); |
| long totalMemory3 = GC.GetTotalMemory(true); |
| long totalMemory3 = GC.GetTotalMemory(true); |
| long num5 = totalMemory3 - totalMemory2; |
| long num5 = totalMemory3 - totalMemory2; |
| args.Context.AddString(string.Concat(new string[] |
| args.Context.AddString(string.Concat(new string[] |
| { |
| { |
| "GC collect, Delta: ", |
| "GC collect, Delta: ", |
| (num5 / 1048576L).ToString("0"), |
| (num5 / 1048576L).ToString("0"), |
| "mb Total left:", |
| "mb Total left:", |
| (totalMemory3 / 1048576L).ToString("0"), |
| (totalMemory3 / 1048576L).ToString("0"), |
| "mb" |
| "mb" |
| })); |
| })); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("cr", "unloads unused assets", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("cr", "unloads unused assets", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| args.Context.AddString("Unloading unused assets"); |
| args.Context.AddString("Unloading unused assets"); |
| Game.instance.CollectResources(true); |
| Game.instance.CollectResources(true); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("fov", "changes camera field of view", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("fov", "changes camera field of view", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Camera mainCamera = Utils.GetMainCamera(); |
| Camera mainCamera = Utils.GetMainCamera(); |
| if (mainCamera) |
| if (mainCamera) |
| { |
| { |
| if (args.Length == 1) |
| if (args.Length == 1) |
| { |
| { |
| args.Context.AddString("Fov:" + mainCamera.fieldOfView.ToString()); |
| args.Context.AddString("Fov:" + mainCamera.fieldOfView.ToString()); |
| return; |
| return; |
| } |
| } |
| float num6; |
| float num6; |
| if (args.TryParameterFloat(1, out num6) && num6 > 5f) |
| if (args.TryParameterFloat(1, out num6) && num6 > 5f) |
| { |
| { |
| args.Context.AddString("Setting fov to " + num6.ToString()); |
| args.Context.AddString("Setting fov to " + num6.ToString()); |
| Camera[] componentsInChildren = mainCamera.GetComponentsInChildren<Camera>(); |
| Camera[] componentsInChildren = mainCamera.GetComponentsInChildren<Camera>(); |
| for (int k = 0; k < componentsInChildren.Length; k++) |
| for (int k = 0; k < componentsInChildren.Length; k++) |
| { |
| { |
| componentsInChildren[k].fieldOfView = num6; |
| componentsInChildren[k].fieldOfView = num6; |
| } |
| } |
| } |
| } |
| } |
| } |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("kick", "[name/ip/userID] - kick user", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("kick", "[name/ip/userID] - kick user", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| string text2 = args[1]; |
| string text2 = args[1]; |
| ZNet.instance.Kick(text2); |
| ZNet.instance.Kick(text2); |
| return true; |
| return true; |
| }, false, true, false, false, false, null, false, false, false); |
| }, false, true, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("ban", "[name/ip/userID] - ban user", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("ban", "[name/ip/userID] - ban user", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| string text3 = args[1]; |
| string text3 = args[1]; |
| ZNet.instance.Ban(text3); |
| ZNet.instance.Ban(text3); |
| return true; |
| return true; |
| }, false, true, false, false, false, null, false, false, false); |
| }, false, true, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("unban", "[ip/userID] - unban user", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("unban", "[ip/userID] - unban user", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| string text4 = args[1]; |
| string text4 = args[1]; |
| ZNet.instance.Unban(text4); |
| ZNet.instance.Unban(text4); |
| return true; |
| return true; |
| }, false, true, false, false, false, null, false, false, false); |
| }, false, true, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("banned", "list banned users", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("banned", "list banned users", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| ZNet.instance.PrintBanned(); |
| ZNet.instance.PrintBanned(); |
| }, false, true, false, false, false, null, false, false, false); |
| }, false, true, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("save", "force saving of world and resets world save interval", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("save", "force saving of world and resets world save interval", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| ZNet.instance.SaveWorldAndPlayerProfiles(); |
| ZNet.instance.SaveWorldAndPlayerProfiles(); |
| }, false, true, false, false, false, null, false, false, false); |
| }, false, true, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("optterrain", "optimize old terrain modifications", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("optterrain", "optimize old terrain modifications", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| TerrainComp.UpgradeTerrain(); |
| TerrainComp.UpgradeTerrain(); |
| Heightmap.UpdateTerrainAlpha(); |
| Heightmap.UpdateTerrainAlpha(); |
| }, false, true, false, false, false, null, false, false, false); |
| }, false, true, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("genloc", "regenerate all locations.", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("genloc", "regenerate all locations.", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| ZoneSystem.instance.GenerateLocations(); |
| ZoneSystem.instance.GenerateLocations(); |
| }, false, false, true, false, false, null, false, true, false); |
| }, false, false, true, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("players", "[nr] - force diffuculty scale ( 0 = reset)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("players", "[nr] - force diffuculty scale ( 0 = reset)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| int num7; |
| int num7; |
| if (args.TryParameterInt(1, out num7)) |
| if (args.TryParameterInt(1, out num7)) |
| { |
| { |
| Game.instance.SetForcePlayerDifficulty(num7); |
| Game.instance.SetForcePlayerDifficulty(num7); |
| args.Context.AddString("Setting players to " + num7.ToString()); |
| args.Context.AddString("Setting players to " + num7.ToString()); |
| } |
| } |
| return true; |
| return true; |
| }, true, false, true, false, false, null, false, true, false); |
| }, true, false, true, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("exclusivefullscreen", "changes window mode to exclusive fullscreen, or back to borderless", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("exclusivefullscreen", "changes window mode to exclusive fullscreen, or back to borderless", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Screen.fullScreenMode != FullScreenMode.ExclusiveFullScreen) |
| if (Screen.fullScreenMode != FullScreenMode.ExclusiveFullScreen) |
| { |
| { |
| Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen; |
| Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen; |
| return; |
| return; |
| } |
| } |
| Screen.fullScreenMode = FullScreenMode.FullScreenWindow; |
| Screen.fullScreenMode = FullScreenMode.FullScreenWindow; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("setkey", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("setkey", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length >= 2) |
| if (args.Length >= 2) |
| { |
| { |
| ZoneSystem.instance.SetGlobalKey(args.FullLine.Substring(args[0].Length + 1)); |
| ZoneSystem.instance.SetGlobalKey(args.FullLine.Substring(args[0].Length + 1)); |
| args.Context.AddString("Setting global key " + args[1]); |
| args.Context.AddString("Setting global key " + args[1]); |
| return; |
| return; |
| } |
| } |
| args.Context.AddString("Syntax: setkey [key]"); |
| args.Context.AddString("Syntax: setkey [key]"); |
| }, true, false, true, false, false, delegate |
| }, true, false, true, false, false, delegate |
| { |
| { |
| List<string> list2 = Enum.GetNames(typeof(GlobalKeys)).ToList<string>(); |
| List<string> list2 = Enum.GetNames(typeof(GlobalKeys)).ToList<string>(); |
| list2.Remove(GlobalKeys.NonServerOption.ToString()); |
| list2.Remove(GlobalKeys.NonServerOption.ToString()); |
| return list2; |
| return list2; |
| }, false, true, false); |
| }, false, true, false); |
| new Terminal.ConsoleCommand("removekey", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("removekey", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length >= 2) |
| if (args.Length >= 2) |
| { |
| { |
| ZoneSystem.instance.RemoveGlobalKey(args.FullLine.Substring(args[0].Length + 1)); |
| ZoneSystem.instance.RemoveGlobalKey(args.FullLine.Substring(args[0].Length + 1)); |
| args.Context.AddString("Removing global key " + args[1]); |
| args.Context.AddString("Removing global key " + args[1]); |
| return; |
| return; |
| } |
| } |
| args.Context.AddString("Syntax: setkey [key]"); |
| args.Context.AddString("Syntax: setkey [key]"); |
| }, true, false, true, false, false, delegate |
| }, true, false, true, false, false, delegate |
| { |
| { |
| if (!ZoneSystem.instance) |
| if (!ZoneSystem.instance) |
| { |
| { |
| return null; |
| return null; |
| } |
| } |
| return ZoneSystem.instance.GetGlobalKeys(); |
| return ZoneSystem.instance.GetGlobalKeys(); |
| }, true, true, false); |
| }, true, true, false); |
| new Terminal.ConsoleCommand("resetkeys", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetkeys", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| ZoneSystem.instance.ResetGlobalKeys(); |
| ZoneSystem.instance.ResetGlobalKeys(); |
| Player localPlayer = Player.m_localPlayer; |
| Player localPlayer = Player.m_localPlayer; |
| if (localPlayer != null) |
| if (localPlayer != null) |
| { |
| { |
| localPlayer.ResetUniqueKeys(); |
| localPlayer.ResetUniqueKeys(); |
| } |
| } |
| args.Context.AddString("Global and player keys cleared"); |
| args.Context.AddString("Global and player keys cleared"); |
| }, true, false, true, false, false, null, false, true, false); |
| }, true, false, true, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("resetworldkeys", "[name] Resets all world modifiers to default", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetworldkeys", "[name] Resets all world modifiers to default", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| ZoneSystem.instance.ResetWorldKeys(); |
| ZoneSystem.instance.ResetWorldKeys(); |
| args.Context.AddString("Server keys cleared"); |
| args.Context.AddString("Server keys cleared"); |
| }, false, false, true, false, false, null, false, true, false); |
| }, false, false, true, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("setworldpreset", "[name] Resets all world modifiers to a named preset", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("setworldpreset", "[name] Resets all world modifiers to a named preset", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| WorldPresets worldPresets; |
| WorldPresets worldPresets; |
| if (Enum.TryParse<WorldPresets>(args[1], true, out worldPresets)) |
| if (Enum.TryParse<WorldPresets>(args[1], true, out worldPresets)) |
| { |
| { |
| ZoneSystem.instance.ResetWorldKeys(); |
| ZoneSystem.instance.ResetWorldKeys(); |
| ServerOptionsGUI.m_instance.ReadKeys(ZNet.World); |
| ServerOptionsGUI.m_instance.ReadKeys(ZNet.World); |
| ServerOptionsGUI.m_instance.SetPreset(ZNet.World, worldPresets); |
| ServerOptionsGUI.m_instance.SetPreset(ZNet.World, worldPresets); |
| ServerOptionsGUI.m_instance.SetKeys(ZNet.World); |
| ServerOptionsGUI.m_instance.SetKeys(ZNet.World); |
| return true; |
| return true; |
| } |
| } |
| return "Invalid preset"; |
| return "Invalid preset"; |
| }, false, false, true, false, false, () => Enum.GetNames(typeof(WorldPresets)).ToList<string>(), false, true, false); |
| }, false, false, true, false, false, () => Enum.GetNames(typeof(WorldPresets)).ToList<string>(), false, true, false); |
| new Terminal.ConsoleCommand("setworldmodifier", "[name] [value] Sets a world modifier value", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("setworldmodifier", "[name] [value] Sets a world modifier value", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| WorldModifiers worldModifiers; |
| WorldModifiers worldModifiers; |
| WorldModifierOption worldModifierOption; |
| WorldModifierOption worldModifierOption; |
| if (Enum.TryParse<WorldModifiers>(args[1], true, out worldModifiers) && Enum.TryParse<WorldModifierOption>(args[2], true, out worldModifierOption)) |
| if (Enum.TryParse<WorldModifiers>(args[1], true, out worldModifiers) && Enum.TryParse<WorldModifierOption>(args[2], true, out worldModifierOption)) |
| { |
| { |
| ServerOptionsGUI.m_instance.ReadKeys(ZNet.World); |
| ServerOptionsGUI.m_instance.ReadKeys(ZNet.World); |
| ServerOptionsGUI.m_instance.SetPreset(ZNet.World, worldModifiers, worldModifierOption); |
| ServerOptionsGUI.m_instance.SetPreset(ZNet.World, worldModifiers, worldModifierOption); |
| ServerOptionsGUI.m_instance.SetKeys(ZNet.World); |
| ServerOptionsGUI.m_instance.SetKeys(ZNet.World); |
| return true; |
| return true; |
| } |
| } |
| return "Invalid input, possible valid values are: " + string.Join(", ", Enum.GetNames(typeof(WorldModifierOption))); |
| return "Invalid input, possible valid values are: " + string.Join(", ", Enum.GetNames(typeof(WorldModifierOption))); |
| }, false, false, true, false, false, () => Enum.GetNames(typeof(WorldModifiers)).ToList<string>(), false, true, false); |
| }, false, false, true, false, false, () => Enum.GetNames(typeof(WorldModifiers)).ToList<string>(), false, true, false); |
| new Terminal.ConsoleCommand("setkeyplayer", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("setkeyplayer", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length >= 2) |
| if (args.Length >= 2) |
| { |
| { |
| Player.m_localPlayer.AddUniqueKey(args.FullLine.Substring(args[0].Length + 1)); |
| Player.m_localPlayer.AddUniqueKey(args.FullLine.Substring(args[0].Length + 1)); |
| args.Context.AddString("Setting player key " + args[1]); |
| args.Context.AddString("Setting player key " + args[1]); |
| return; |
| return; |
| } |
| } |
| args.Context.AddString("Syntax: setkey [key]"); |
| args.Context.AddString("Syntax: setkey [key]"); |
| }, true, false, true, false, false, () => Enum.GetNames(typeof(PlayerKeys)).ToList<string>(), false, false, false); |
| }, true, false, true, false, false, () => Enum.GetNames(typeof(PlayerKeys)).ToList<string>(), false, false, false); |
| new Terminal.ConsoleCommand("removekeyplayer", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("removekeyplayer", "[name]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length >= 2) |
| if (args.Length >= 2) |
| { |
| { |
| Player.m_localPlayer.RemoveUniqueKey(args.FullLine.Substring(args[0].Length + 1)); |
| Player.m_localPlayer.RemoveUniqueKey(args.FullLine.Substring(args[0].Length + 1)); |
| args.Context.AddString("Removing player key " + args[1]); |
| args.Context.AddString("Removing player key " + args[1]); |
| return; |
| return; |
| } |
| } |
| args.Context.AddString("Syntax: setkey [key]"); |
| args.Context.AddString("Syntax: setkey [key]"); |
| }, true, false, true, false, false, delegate |
| }, true, false, true, false, false, delegate |
| { |
| { |
| if (!Player.m_localPlayer) |
| if (!Player.m_localPlayer) |
| { |
| { |
| return null; |
| return null; |
| } |
| } |
| return Player.m_localPlayer.GetUniqueKeys(); |
| return Player.m_localPlayer.GetUniqueKeys(); |
| }, true, false, false); |
| }, true, false, false); |
| new Terminal.ConsoleCommand("listkeys", "", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("listkeys", "", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| List<string> list3 = ZoneSystem.instance.GetGlobalKeys(); |
| List<string> list3 = ZoneSystem.instance.GetGlobalKeys(); |
| args.Context.AddString(string.Format("Current Keys: {0}", list3.Count)); |
| args.Context.AddString(string.Format("Current Keys: {0}", list3.Count)); |
| foreach (string text5 in list3) |
| foreach (string text5 in list3) |
| { |
| { |
| args.Context.AddString(" " + text5); |
| args.Context.AddString(" " + text5); |
| } |
| } |
| args.Context.AddString(string.Format("Server Option Keys: {0}", ZNet.World.m_startingGlobalKeys.Count)); |
| args.Context.AddString(string.Format("Server Option Keys: {0}", ZNet.World.m_startingGlobalKeys.Count)); |
| foreach (string text6 in ZNet.World.m_startingGlobalKeys) |
| foreach (string text6 in ZNet.World.m_startingGlobalKeys) |
| { |
| { |
| args.Context.AddString(" " + text6); |
| args.Context.AddString(" " + text6); |
| } |
| } |
| if (args.Length > 2) |
| if (args.Length > 2) |
| { |
| { |
| args.Context.AddString(string.Format("Current Keys Values: {0}", list3.Count)); |
| args.Context.AddString(string.Format("Current Keys Values: {0}", list3.Count)); |
| foreach (KeyValuePair<string, string> keyValuePair2 in ZoneSystem.instance.m_globalKeysValues) |
| foreach (KeyValuePair<string, string> keyValuePair2 in ZoneSystem.instance.m_globalKeysValues) |
| { |
| { |
| args.Context.AddString(" " + keyValuePair2.Key + ": " + keyValuePair2.Value); |
| args.Context.AddString(" " + keyValuePair2.Key + ": " + keyValuePair2.Value); |
| } |
| } |
| args.Context.AddString(string.Format("Current Keys Enums: {0}", list3.Count)); |
| args.Context.AddString(string.Format("Current Keys Enums: {0}", list3.Count)); |
| foreach (GlobalKeys globalKeys in ZoneSystem.instance.m_globalKeysEnums) |
| foreach (GlobalKeys globalKeys in ZoneSystem.instance.m_globalKeysEnums) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}", globalKeys)); |
| args.Context.AddString(string.Format(" {0}", globalKeys)); |
| } |
| } |
| } |
| } |
| if (Player.m_localPlayer) |
| if (Player.m_localPlayer) |
| { |
| { |
| list3 = Player.m_localPlayer.GetUniqueKeys(); |
| list3 = Player.m_localPlayer.GetUniqueKeys(); |
| args.Context.AddString(string.Format("Player Keys: {0}", list3.Count)); |
| args.Context.AddString(string.Format("Player Keys: {0}", list3.Count)); |
| foreach (string text7 in list3) |
| foreach (string text7 in list3) |
| { |
| { |
| args.Context.AddString(" " + text7); |
| args.Context.AddString(" " + text7); |
| } |
| } |
| } |
| } |
| }, true, false, true, false, false, null, false, true, false); |
| }, true, false, true, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("debugmode", "fly mode", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("debugmode", "fly mode", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Player.m_debugMode = !Player.m_debugMode; |
| Player.m_debugMode = !Player.m_debugMode; |
| args.Context.AddString("Debugmode " + Player.m_debugMode.ToString()); |
| args.Context.AddString("Debugmode " + Player.m_debugMode.ToString()); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("fly", "fly mode", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("fly", "fly mode", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Player.m_localPlayer.ToggleDebugFly(); |
| Player.m_localPlayer.ToggleDebugFly(); |
| int num8; |
| int num8; |
| if (args.TryParameterInt(1, out num8)) |
| if (args.TryParameterInt(1, out num8)) |
| { |
| { |
| Character.m_debugFlySpeed = num8; |
| Character.m_debugFlySpeed = num8; |
| } |
| } |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("nocost", "no build cost", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("nocost", "no build cost", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.HasArgumentAnywhere("on", 0, true)) |
| if (args.HasArgumentAnywhere("on", 0, true)) |
| { |
| { |
| Player.m_localPlayer.SetNoPlacementCost(true); |
| Player.m_localPlayer.SetNoPlacementCost(true); |
| return; |
| return; |
| } |
| } |
| if (args.HasArgumentAnywhere("off", 0, true)) |
| if (args.HasArgumentAnywhere("off", 0, true)) |
| { |
| { |
| Player.m_localPlayer.SetNoPlacementCost(false); |
| Player.m_localPlayer.SetNoPlacementCost(false); |
| return; |
| return; |
| } |
| } |
| Player.m_localPlayer.ToggleNoPlacementCost(); |
| Player.m_localPlayer.ToggleNoPlacementCost(); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("raiseskill", "[skill] [amount]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("raiseskill", "[skill] [amount]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| int num9; |
| int num9; |
| if (args.TryParameterInt(2, out num9)) |
| if (args.TryParameterInt(2, out num9)) |
| { |
| { |
| Player.m_localPlayer.GetSkills().CheatRaiseSkill(args[1], (float)num9, true); |
| Player.m_localPlayer.GetSkills().CheatRaiseSkill(args[1], (float)num9, true); |
| return; |
| return; |
| } |
| } |
| args.Context.AddString("Syntax: raiseskill [skill] [amount]"); |
| args.Context.AddString("Syntax: raiseskill [skill] [amount]"); |
| }, true, false, true, false, false, delegate |
| }, true, false, true, false, false, delegate |
| { |
| { |
| List<string> list4 = Enum.GetNames(typeof(Skills.SkillType)).ToList<string>(); |
| List<string> list4 = Enum.GetNames(typeof(Skills.SkillType)).ToList<string>(); |
| list4.Remove(Skills.SkillType.All.ToString()); |
| list4.Remove(Skills.SkillType.All.ToString()); |
| list4.Remove(Skills.SkillType.None.ToString()); |
| list4.Remove(Skills.SkillType.None.ToString()); |
| return list4; |
| return list4; |
| }, false, false, false); |
| }, false, false, false); |
| new Terminal.ConsoleCommand("resetskill", "[skill]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetskill", "[skill]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length > 1) |
| if (args.Length > 1) |
| { |
| { |
| string text8 = args[1]; |
| string text8 = args[1]; |
| Player.m_localPlayer.GetSkills().CheatResetSkill(text8); |
| Player.m_localPlayer.GetSkills().CheatResetSkill(text8); |
| return; |
| return; |
| } |
| } |
| args.Context.AddString("Syntax: resetskill [skill]"); |
| args.Context.AddString("Syntax: resetskill [skill]"); |
| }, true, false, true, false, false, delegate |
| }, true, false, true, false, false, delegate |
| { |
| { |
| List<string> list5 = Enum.GetNames(typeof(Skills.SkillType)).ToList<string>(); |
| List<string> list5 = Enum.GetNames(typeof(Skills.SkillType)).ToList<string>(); |
| list5.Remove(Skills.SkillType.All.ToString()); |
| list5.Remove(Skills.SkillType.All.ToString()); |
| list5.Remove(Skills.SkillType.None.ToString()); |
| list5.Remove(Skills.SkillType.None.ToString()); |
| return list5; |
| return list5; |
| }, false, false, false); |
| }, false, false, false); |
| new Terminal.ConsoleCommand("sleep", "skips to next morning", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("sleep", "skips to next morning", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| EnvMan.instance.SkipToMorning(); |
| EnvMan.instance.SkipToMorning(); |
| }, true, false, true, false, false, null, false, true, false); |
| }, true, false, true, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("stats", "shows player stats", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("stats", "shows player stats", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (!Game.instance) |
| if (!Game.instance) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| PlayerProfile playerProfile = Game.instance.GetPlayerProfile(); |
| PlayerProfile playerProfile = Game.instance.GetPlayerProfile(); |
| args.Context.AddString("Player stats"); |
| args.Context.AddString("Player stats"); |
| if (playerProfile.m_usedCheats) |
| if (playerProfile.m_usedCheats) |
| { |
| { |
| args.Context.AddString("Cheater!"); |
| args.Context.AddString("Cheater!"); |
| } |
| } |
| foreach (KeyValuePair<PlayerStatType, float> keyValuePair3 in playerProfile.m_playerStats.m_stats) |
| foreach (KeyValuePair<PlayerStatType, float> keyValuePair3 in playerProfile.m_playerStats.m_stats) |
| { |
| { |
| string text9; |
| string text9; |
| if (PlayerProfile.m_statTypeDates.TryGetValue(keyValuePair3.Key, out text9)) |
| if (PlayerProfile.m_statTypeDates.TryGetValue(keyValuePair3.Key, out text9)) |
| { |
| { |
| args.Context.AddString(" " + text9); |
| args.Context.AddString(" " + text9); |
| } |
| } |
| args.Context.AddString(string.Format(" {0}: {1}", keyValuePair3.Key, keyValuePair3.Value)); |
| args.Context.AddString(string.Format(" {0}: {1}", keyValuePair3.Key, keyValuePair3.Value)); |
| } |
| } |
| args.Context.AddString("Known worlds:"); |
| args.Context.AddString("Known worlds:"); |
| foreach (KeyValuePair<string, float> keyValuePair4 in playerProfile.m_knownWorlds) |
| foreach (KeyValuePair<string, float> keyValuePair4 in playerProfile.m_knownWorlds) |
| { |
| { |
| args.Context.AddString(" " + keyValuePair4.Key + ": " + TimeSpan.FromSeconds((double)keyValuePair4.Value).ToString("c")); |
| args.Context.AddString(" " + keyValuePair4.Key + ": " + TimeSpan.FromSeconds((double)keyValuePair4.Value).ToString("c")); |
| } |
| } |
| args.Context.AddString("Enemies:"); |
| args.Context.AddString("Enemies:"); |
| foreach (KeyValuePair<string, float> keyValuePair5 in playerProfile.m_enemyStats) |
| foreach (KeyValuePair<string, float> keyValuePair5 in playerProfile.m_enemyStats) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}: {1}", Localization.instance.Localize(keyValuePair5.Key), keyValuePair5.Value)); |
| args.Context.AddString(string.Format(" {0}: {1}", Localization.instance.Localize(keyValuePair5.Key), keyValuePair5.Value)); |
| } |
| } |
| args.Context.AddString("Items found:"); |
| args.Context.AddString("Items found:"); |
| foreach (KeyValuePair<string, float> keyValuePair6 in playerProfile.m_itemPickupStats) |
| foreach (KeyValuePair<string, float> keyValuePair6 in playerProfile.m_itemPickupStats) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}: {1}", Localization.instance.Localize(keyValuePair6.Key), keyValuePair6.Value)); |
| args.Context.AddString(string.Format(" {0}: {1}", Localization.instance.Localize(keyValuePair6.Key), keyValuePair6.Value)); |
| } |
| } |
| args.Context.AddString("Crafts:"); |
| args.Context.AddString("Crafts:"); |
| foreach (KeyValuePair<string, float> keyValuePair7 in playerProfile.m_itemCraftStats) |
| foreach (KeyValuePair<string, float> keyValuePair7 in playerProfile.m_itemCraftStats) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}: {1}", Localization.instance.Localize(keyValuePair7.Key), keyValuePair7.Value)); |
| args.Context.AddString(string.Format(" {0}: {1}", Localization.instance.Localize(keyValuePair7.Key), keyValuePair7.Value)); |
| } |
| } |
| if (args.Length > 1) |
| if (args.Length > 1) |
| { |
| { |
| args.Context.AddString("Known world keys:"); |
| args.Context.AddString("Known world keys:"); |
| foreach (KeyValuePair<string, float> keyValuePair8 in playerProfile.m_knownWorldKeys) |
| foreach (KeyValuePair<string, float> keyValuePair8 in playerProfile.m_knownWorldKeys) |
| { |
| { |
| args.Context.AddString(" " + keyValuePair8.Key + ": " + TimeSpan.FromSeconds((double)keyValuePair8.Value).ToString("c")); |
| args.Context.AddString(" " + keyValuePair8.Key + ": " + TimeSpan.FromSeconds((double)keyValuePair8.Value).ToString("c")); |
| } |
| } |
| args.Context.AddString("Used commands:"); |
| args.Context.AddString("Used commands:"); |
| foreach (KeyValuePair<string, float> keyValuePair9 in playerProfile.m_knownCommands) |
| foreach (KeyValuePair<string, float> keyValuePair9 in playerProfile.m_knownCommands) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}: {1}", keyValuePair9.Key, keyValuePair9.Value)); |
| args.Context.AddString(string.Format(" {0}: {1}", keyValuePair9.Key, keyValuePair9.Value)); |
| } |
| } |
| } |
| } |
| }, false, false, true, false, false, null, false, false, false); |
| }, false, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("skiptime", "[gameseconds] skips head in seconds", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("skiptime", "[gameseconds] skips head in seconds", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| double num10 = ZNet.instance.GetTimeSeconds(); |
| double num10 = ZNet.instance.GetTimeSeconds(); |
| float num11 = args.TryParameterFloat(1, 240f); |
| float num11 = args.TryParameterFloat(1, 240f); |
| num10 += (double)num11; |
| num10 += (double)num11; |
| ZNet.instance.SetNetTime(num10); |
| ZNet.instance.SetNetTime(num10); |
| args.Context.AddString("Skipping " + num11.ToString("0") + "s , Day:" + EnvMan.instance.GetDay(num10).ToString()); |
| args.Context.AddString("Skipping " + num11.ToString("0") + "s , Day:" + EnvMan.instance.GetDay(num10).ToString()); |
| }, true, false, true, false, false, null, false, true, false); |
| }, true, false, true, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("time", "shows current time", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("time", "shows current time", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| double timeSeconds = ZNet.instance.GetTimeSeconds(); |
| double timeSeconds = ZNet.instance.GetTimeSeconds(); |
| . | bool flag = EnvMan.instance.CanSleep(); |
| bool flag = EnvMan.CanSleep(); |
| args.Context.AddString(string.Format("{0} sec, Day: {1} ({2}), {3}, Session start: {4}", new object[] |
| args.Context.AddString(string.Format("{0} sec, Day: {1} ({2}), {3}, Session start: {4}", new object[] |
| { |
| { |
| timeSeconds.ToString("0.00"), |
| timeSeconds.ToString("0.00"), |
| EnvMan.instance.GetDay(timeSeconds), |
| EnvMan.instance.GetDay(timeSeconds), |
| EnvMan.instance.GetDayFraction().ToString("0.00"), |
| EnvMan.instance.GetDayFraction().ToString("0.00"), |
| flag ? "Can sleep" : "Can NOT sleep", |
| flag ? "Can sleep" : "Can NOT sleep", |
| ZoneSystem.instance.TimeSinceStart() |
| ZoneSystem.instance.TimeSinceStart() |
| })); |
| })); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("maxfps", "[FPS] sets fps limit", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("maxfps", "[FPS] sets fps limit", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| int num12; |
| int num12; |
| if (args.TryParameterInt(1, out num12)) |
| if (args.TryParameterInt(1, out num12)) |
| { |
| { |
| Settings.FPSLimit = num12; |
| Settings.FPSLimit = num12; |
| PlatformPrefs.SetInt("FPSLimit", num12); |
| PlatformPrefs.SetInt("FPSLimit", num12); |
| return true; |
| return true; |
| } |
| } |
| return false; |
| return false; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("resetcharacter", "reset character data", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetcharacter", "reset character data", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Terminal context4 = args.Context; |
| Terminal context4 = args.Context; |
| if (context4 != null) |
| if (context4 != null) |
| { |
| { |
| context4.AddString("Reseting character"); |
| context4.AddString("Reseting character"); |
| } |
| } |
| Player.m_localPlayer.ResetCharacter(); |
| Player.m_localPlayer.ResetCharacter(); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("resetknownitems", "reset character known items & recipes", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetknownitems", "reset character known items & recipes", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Terminal context5 = args.Context; |
| Terminal context5 = args.Context; |
| if (context5 != null) |
| if (context5 != null) |
| { |
| { |
| context5.AddString("Reseting known items for character"); |
| context5.AddString("Reseting known items for character"); |
| } |
| } |
| Player.m_localPlayer.ResetCharacterKnownItems(); |
| Player.m_localPlayer.ResetCharacterKnownItems(); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("tutorialreset", "reset tutorial data", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("tutorialreset", "reset tutorial data", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Terminal context6 = args.Context; |
| Terminal context6 = args.Context; |
| if (context6 != null) |
| if (context6 != null) |
| { |
| { |
| context6.AddString("Reseting tutorials"); |
| context6.AddString("Reseting tutorials"); |
| } |
| } |
| Player.ResetSeenTutorials(); |
| Player.ResetSeenTutorials(); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("timescale", "[target] [fadetime, default: 1, max: 3] sets timescale", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("timescale", "[target] [fadetime, default: 1, max: 3] sets timescale", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| float num13; |
| float num13; |
| if (args.TryParameterFloat(1, out num13)) |
| if (args.TryParameterFloat(1, out num13)) |
| { |
| { |
| . | Game.FadeTimeScale(Mathf.Min(3f, num13), args.TryParameterFloat(2, 0f)); |
| Game.FadeTimeScale(Mathf.Min(5f, num13), args.TryParameterFloat(2, 0f)); |
| return true; |
| return true; |
| } |
| } |
| return false; |
| return false; |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("randomevent", "start a random event", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("randomevent", "start a random event", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| RandEventSystem.instance.StartRandomEvent(); |
| RandEventSystem.instance.StartRandomEvent(); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("event", "[name] - start event", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("event", "[name] - start event", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| string text10 = args[1]; |
| string text10 = args[1]; |
| if (!RandEventSystem.instance.HaveEvent(text10)) |
| if (!RandEventSystem.instance.HaveEvent(text10)) |
| { |
| { |
| args.Context.AddString("Random event not found:" + text10); |
| args.Context.AddString("Random event not found:" + text10); |
| return true; |
| return true; |
| } |
| } |
| RandEventSystem.instance.SetRandomEventByName(text10, Player.m_localPlayer.transform.position); |
| RandEventSystem.instance.SetRandomEventByName(text10, Player.m_localPlayer.transform.position); |
| return true; |
| return true; |
| }, true, false, true, false, false, delegate |
| }, true, false, true, false, false, delegate |
| { |
| { |
| List<string> list6 = new List<string>(); |
| List<string> list6 = new List<string>(); |
| foreach (RandomEvent randomEvent in RandEventSystem.instance.m_events) |
| foreach (RandomEvent randomEvent in RandEventSystem.instance.m_events) |
| { |
| { |
| list6.Add(randomEvent.m_name); |
| list6.Add(randomEvent.m_name); |
| } |
| } |
| return list6; |
| return list6; |
| }, false, false, false); |
| }, false, false, false); |
| new Terminal.ConsoleCommand("stopevent", "stop current event", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("stopevent", "stop current event", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| RandEventSystem.instance.ResetRandomEvent(); |
| RandEventSystem.instance.ResetRandomEvent(); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("removedrops", "remove all item-drops in area", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("removedrops", "remove all item-drops in area", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| int num14 = 0; |
| int num14 = 0; |
| foreach (ItemDrop itemDrop in UnityEngine.Object.FindObjectsOfType<ItemDrop>()) |
| foreach (ItemDrop itemDrop in UnityEngine.Object.FindObjectsOfType<ItemDrop>()) |
| { |
| { |
| Fish component = itemDrop.gameObject.GetComponent<Fish>(); |
| Fish component = itemDrop.gameObject.GetComponent<Fish>(); |
| if (!component || component.IsOutOfWater()) |
| if (!component || component.IsOutOfWater()) |
| { |
| { |
| ZNetView component2 = itemDrop.GetComponent<ZNetView>(); |
| ZNetView component2 = itemDrop.GetComponent<ZNetView>(); |
| if (component2 && component2.IsValid() && component2.IsOwner()) |
| if (component2 && component2.IsValid() && component2.IsOwner()) |
| { |
| { |
| component2.Destroy(); |
| component2.Destroy(); |
| num14++; |
| num14++; |
| } |
| } |
| } |
| } |
| } |
| } |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Removed item drops: " + num14.ToString(), 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Removed item drops: " + num14.ToString(), 0, null); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("removefish", "remove all fish", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("removefish", "remove all fish", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| int num15 = 0; |
| int num15 = 0; |
| Fish[] array2 = UnityEngine.Object.FindObjectsOfType<Fish>(); |
| Fish[] array2 = UnityEngine.Object.FindObjectsOfType<Fish>(); |
| for (int m = 0; m < array2.Length; m++) |
| for (int m = 0; m < array2.Length; m++) |
| { |
| { |
| ZNetView component3 = array2[m].GetComponent<ZNetView>(); |
| ZNetView component3 = array2[m].GetComponent<ZNetView>(); |
| if (component3 && component3.IsValid() && component3.IsOwner()) |
| if (component3 && component3.IsValid() && component3.IsOwner()) |
| { |
| { |
| component3.Destroy(); |
| component3.Destroy(); |
| num15++; |
| num15++; |
| } |
| } |
| } |
| } |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Removed fish: " + num15.ToString(), 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Removed fish: " + num15.ToString(), 0, null); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("printcreatures", "shows counts and levels of active creatures", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("printcreatures", "shows counts and levels of active creatures", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Terminal.<>c__DisplayClass7_0 CS$<>8__locals2; |
| Terminal.<>c__DisplayClass7_0 CS$<>8__locals2; |
| CS$<>8__locals2.args = args; |
| CS$<>8__locals2.args = args; |
| CS$<>8__locals2.counts = new Dictionary<string, Dictionary<int, int>>(); |
| CS$<>8__locals2.counts = new Dictionary<string, Dictionary<int, int>>(); |
| . | Terminal.<InitTerminal>g__GetInfo|7_125(Character.GetAllCharacters(), ref CS$<>8__locals2); |
| Terminal.<InitTerminal>g__GetInfo|7_133(Character.GetAllCharacters(), ref CS$<>8__locals2); |
| Terminal.<InitTerminal>g__GetInfo|7_125(UnityEngine.Object.FindObjectsOfType<RandomFlyingBird>(), ref CS$<>8__locals2); |
| Terminal.<InitTerminal>g__GetInfo|7_133(UnityEngine.Object.FindObjectsOfType<RandomFlyingBird>(), ref CS$<>8__locals2); |
| Terminal.<InitTerminal>g__GetInfo|7_125(UnityEngine.Object.FindObjectsOfType<Fish>(), ref CS$<>8__locals2); |
| Terminal.<InitTerminal>g__GetInfo|7_133(UnityEngine.Object.FindObjectsOfType<Fish>(), ref CS$<>8__locals2); |
| foreach (KeyValuePair<string, Dictionary<int, int>> keyValuePair10 in CS$<>8__locals2.counts) |
| foreach (KeyValuePair<string, Dictionary<int, int>> keyValuePair10 in CS$<>8__locals2.counts) |
| { |
| { |
| string text11 = Localization.instance.Localize(keyValuePair10.Key) + ": "; |
| string text11 = Localization.instance.Localize(keyValuePair10.Key) + ": "; |
| foreach (KeyValuePair<int, int> keyValuePair11 in keyValuePair10.Value) |
| foreach (KeyValuePair<int, int> keyValuePair11 in keyValuePair10.Value) |
| { |
| { |
| text11 += string.Format("Level {0}: {1}, ", keyValuePair11.Key, keyValuePair11.Value); |
| text11 += string.Format("Level {0}: {1}, ", keyValuePair11.Key, keyValuePair11.Value); |
| } |
| } |
| CS$<>8__locals2.args.Context.AddString(text11); |
| CS$<>8__locals2.args.Context.AddString(text11); |
| } |
| } |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("printnetobj", "[radius = 5] lists number of network objects by name surrounding the player", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("printnetobj", "[radius = 5] lists number of network objects by name surrounding the player", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| float num16 = args.TryParameterFloat(1, 5f); |
| float num16 = args.TryParameterFloat(1, 5f); |
| ZNetView[] array3 = UnityEngine.Object.FindObjectsOfType<ZNetView>(); |
| ZNetView[] array3 = UnityEngine.Object.FindObjectsOfType<ZNetView>(); |
| Terminal.<>c__DisplayClass7_1 CS$<>8__locals3; |
| Terminal.<>c__DisplayClass7_1 CS$<>8__locals3; |
| CS$<>8__locals3.counts = new Dictionary<string, int>(); |
| CS$<>8__locals3.counts = new Dictionary<string, int>(); |
| CS$<>8__locals3.total = 0; |
| CS$<>8__locals3.total = 0; |
| foreach (ZNetView znetView in array3) |
| foreach (ZNetView znetView in array3) |
| { |
| { |
| Transform transform = ((znetView.transform.parent != null) ? znetView.transform.parent : znetView.transform); |
| Transform transform = ((znetView.transform.parent != null) ? znetView.transform.parent : znetView.transform); |
| if (num16 <= 0f || Vector3.Distance(transform.position, Player.m_localPlayer.transform.position) <= num16) |
| if (num16 <= 0f || Vector3.Distance(transform.position, Player.m_localPlayer.transform.position) <= num16) |
| { |
| { |
| string name = transform.name; |
| string name = transform.name; |
| int num17 = name.IndexOf('('); |
| int num17 = name.IndexOf('('); |
| if (num17 > 0) |
| if (num17 > 0) |
| { |
| { |
| . | Terminal.<InitTerminal>g__add|7_127(name.Substring(0, num17), ref CS$<>8__locals3); |
| Terminal.<InitTerminal>g__add|7_135(name.Substring(0, num17), ref CS$<>8__locals3); |
| } |
| } |
| else |
| else |
| { |
| { |
| . | Terminal.<InitTerminal>g__add|7_127("Other", ref CS$<>8__locals3); |
| Terminal.<InitTerminal>g__add|7_135("Other", ref CS$<>8__locals3); |
| } |
| } |
| } |
| } |
| } |
| } |
| args.Context.AddString(string.Format("Total network objects found: {0}", CS$<>8__locals3.total)); |
| args.Context.AddString(string.Format("Total network objects found: {0}", CS$<>8__locals3.total)); |
| foreach (KeyValuePair<string, int> keyValuePair12 in CS$<>8__locals3.counts) |
| foreach (KeyValuePair<string, int> keyValuePair12 in CS$<>8__locals3.counts) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}: {1}", keyValuePair12.Key, keyValuePair12.Value)); |
| args.Context.AddString(string.Format(" {0}: {1}", keyValuePair12.Key, keyValuePair12.Value)); |
| } |
| } |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("removebirds", "remove all birds", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("removebirds", "remove all birds", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| int num18 = 0; |
| int num18 = 0; |
| RandomFlyingBird[] array5 = UnityEngine.Object.FindObjectsOfType<RandomFlyingBird>(); |
| RandomFlyingBird[] array5 = UnityEngine.Object.FindObjectsOfType<RandomFlyingBird>(); |
| for (int num19 = 0; num19 < array5.Length; num19++) |
| for (int num19 = 0; num19 < array5.Length; num19++) |
| { |
| { |
| ZNetView component4 = array5[num19].GetComponent<ZNetView>(); |
| ZNetView component4 = array5[num19].GetComponent<ZNetView>(); |
| if (component4 && component4.IsValid() && component4.IsOwner()) |
| if (component4 && component4.IsValid() && component4.IsOwner()) |
| { |
| { |
| component4.Destroy(); |
| component4.Destroy(); |
| num18++; |
| num18++; |
| } |
| } |
| } |
| } |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Removed birds: " + num18.ToString(), 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Removed birds: " + num18.ToString(), 0, null); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("printlocations", "shows counts of loaded locations", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("printlocations", "shows counts of loaded locations", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| new Dictionary<string, Dictionary<int, int>>(); |
| new Dictionary<string, Dictionary<int, int>>(); |
| foreach (Location location in UnityEngine.Object.FindObjectsOfType<Location>()) |
| foreach (Location location in UnityEngine.Object.FindObjectsOfType<Location>()) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}, Dist: {1}, Offset: {2}", location.name, Vector3.Distance(Player.m_localPlayer.transform.position, location.transform.position).ToString("0.0"), location.transform.position - Player.m_localPlayer.transform.position)); |
| args.Context.AddString(string.Format(" {0}, Dist: {1}, Offset: {2}", location.name, Vector3.Distance(Player.m_localPlayer.transform.position, location.transform.position).ToString("0.0"), location.transform.position - Player.m_localPlayer.transform.position)); |
| } |
| } |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("find", "[text] [pingmax] searches loaded objects and location list matching name and pings them on the map. pingmax defaults to 1, if more will place pins on map instead", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("find", "[text] [pingmax] searches loaded objects and location list matching name and pings them on the map. pingmax defaults to 1, if more will place pins on map instead", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | new Dictionary<string, Dictionary<int, int>>(); |
| |
| GameObject[] array7 = UnityEngine.Object.FindObjectsOfType<GameObject>(); |
| |
| string text12 = args[1].ToLower(); |
| string text12 = args[1].ToLower(); |
| . | List<Tuple<object, Vector3>> list7 = new List<Tuple<object, Vector3>>(); |
| List<Tuple<object, Vector3>> list7 = Terminal.<InitTerminal>g__find|7_63(text12); |
| foreach (GameObject gameObject in array7) |
| |
| { |
| |
| if (gameObject.name.ToLower().Contains(text12)) |
| |
| { |
| |
| list7.Add(new Tuple<object, Vector3>(gameObject, gameObject.transform.position)); |
| |
| } |
| |
| } |
| |
| foreach (ZoneSystem.LocationInstance locationInstance in ZoneSystem.instance.GetLocationList()) |
| |
| { |
| |
| if (locationInstance.m_location.m_prefab.Name.ToLower().Contains(text12)) |
| |
| { |
| |
| list7.Add(new Tuple<object, Vector3>(locationInstance, locationInstance.m_position)); |
| |
| } |
| |
| } |
| |
| List<ZDO> list8 = new List<ZDO>(); |
| |
| int num22 = 0; |
| |
| while (!ZDOMan.instance.GetAllZDOsWithPrefabIterative(text12, list8, ref num22)) |
| |
| { |
| |
| } |
| |
| foreach (ZDO zdo in list8) |
| |
| { |
| |
| list7.Add(new Tuple<object, Vector3>(zdo, zdo.GetPosition())); |
| |
| } |
| |
| list7.Sort((Tuple<object, Vector3> a, Tuple<object, Vector3> b) => Vector3.Distance(a.Item2, Player.m_localPlayer.transform.position).CompareTo(Vector3.Distance(b.Item2, Player.m_localPlayer.transform.position))); |
| list7.Sort((Tuple<object, Vector3> a, Tuple<object, Vector3> b) => Vector3.Distance(a.Item2, Player.m_localPlayer.transform.position).CompareTo(Vector3.Distance(b.Item2, Player.m_localPlayer.transform.position))); |
| foreach (Tuple<object, Vector3> tuple in list7) |
| foreach (Tuple<object, Vector3> tuple in list7) |
| { |
| { |
| Terminal context7 = args.Context; |
| Terminal context7 = args.Context; |
| string text13 = " {0}, Dist: {1}, Pos: {2}"; |
| string text13 = " {0}, Dist: {1}, Pos: {2}"; |
| . | GameObject gameObject2 = tuple.Item1 as GameObject; |
| GameObject gameObject = tuple.Item1 as GameObject; |
| object obj; |
| object obj; |
| . | if (gameObject2 == null) |
| if (gameObject == null) |
| { |
| { |
| object item = tuple.Item1; |
| object item = tuple.Item1; |
| if (item is ZoneSystem.LocationInstance) |
| if (item is ZoneSystem.LocationInstance) |
| { |
| { |
| . | ZoneSystem.LocationInstance locationInstance2 = (ZoneSystem.LocationInstance)item; |
| ZoneSystem.LocationInstance locationInstance = (ZoneSystem.LocationInstance)item; |
| obj = locationInstance2.m_location.m_prefab.Name; |
| obj = locationInstance.m_location.m_prefab.Name; |
| } |
| } |
| else |
| else |
| { |
| { |
| obj = "unknown"; |
| obj = "unknown"; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| . | obj = gameObject2.name.ToString(); |
| obj = gameObject.name.ToString(); |
| } |
| } |
| context7.AddString(string.Format(text13, obj, Vector3.Distance(Player.m_localPlayer.transform.position, tuple.Item2).ToString("0.0"), tuple.Item2)); |
| context7.AddString(string.Format(text13, obj, Vector3.Distance(Player.m_localPlayer.transform.position, tuple.Item2).ToString("0.0"), tuple.Item2)); |
| } |
| } |
| foreach (Minimap.PinData pinData in args.Context.m_findPins) |
| foreach (Minimap.PinData pinData in args.Context.m_findPins) |
| { |
| { |
| Minimap.instance.RemovePin(pinData); |
| Minimap.instance.RemovePin(pinData); |
| } |
| } |
| args.Context.m_findPins.Clear(); |
| args.Context.m_findPins.Clear(); |
| . | int num23 = Math.Min(list7.Count, args.TryParameterInt(2, 1)); |
| int num21 = Math.Min(list7.Count, args.TryParameterInt(2, 1)); |
| if (num23 == 1) |
| if (num21 == 1) |
| { |
| { |
| Chat.instance.SendPing(list7[0].Item2); |
| Chat.instance.SendPing(list7[0].Item2); |
| } |
| } |
| else |
| else |
| { |
| { |
| . | for (int num24 = 0; num24 < num23; num24++) |
| for (int num22 = 0; num22 < num21; num22++) |
| { |
| { |
| List<Minimap.PinData> findPins = args.Context.m_findPins; |
| List<Minimap.PinData> findPins = args.Context.m_findPins; |
| Minimap instance = Minimap.instance; |
| Minimap instance = Minimap.instance; |
| . | Vector3 item2 = list7[num24].Item2; |
| Vector3 item2 = list7[num22].Item2; |
| Minimap.PinType pinType = ((list7[num24].Item1 is ZDO) ? Minimap.PinType.Icon2 : ((list7[num24].Item1 is ZoneSystem.LocationInstance) ? Minimap.PinType.Icon1 : Minimap.PinType.Icon3)); |
| Minimap.PinType pinType = ((list7[num22].Item1 is ZDO) ? Minimap.PinType.Icon2 : ((list7[num22].Item1 is ZoneSystem.LocationInstance) ? Minimap.PinType.Icon1 : Minimap.PinType.Icon3)); |
| ZDO zdo2 = list7[num24].Item1 as ZDO; |
| ZDO zdo = list7[num22].Item1 as ZDO; |
| findPins.Add(instance.AddPin(item2, pinType, (zdo2 != null) ? zdo2.GetString("tag", "") : "", false, true, Player.m_localPlayer.GetPlayerID(), "")); |
| findPins.Add(instance.AddPin(item2, pinType, (zdo != null) ? zdo.GetString("tag", "") : "", false, true, Player.m_localPlayer.GetPlayerID(), "")); |
| } |
| } |
| } |
| } |
| args.Context.AddString(string.Format("Found {0} objects containing '{1}'", list7.Count, text12)); |
| args.Context.AddString(string.Format("Found {0} objects containing '{1}'", list7.Count, text12)); |
| return true; |
| return true; |
| . | }, true, false, false, false, false, delegate |
| }, true, false, false, false, false, new Terminal.ConsoleOptionsFetcher(Terminal.<InitTerminal>g__findOpt|7_62), false, false, false); |
| |
| new Terminal.ConsoleCommand("findtp", "[text] [index=-1] [closerange=30] searches loaded objects and location list matching name and teleports you to the closest one outside of closerange. Specify an index to tp to any other in the found list, a minus value means index by closest.", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | if (!ZNetScene.instance) |
| if (args.Length < 2 || Player.m_localPlayer == null) |
| { |
| { |
| . | return null; |
| return false; |
| } |
| } |
| . | List<string> list9 = new List<string>(ZNetScene.instance.GetPrefabNames()); |
| string text14 = args[1].ToLower(); |
| foreach (ZoneSystem.ZoneLocation zoneLocation in ZoneSystem.instance.m_locations) |
| if (text14.Length < 1) |
| { |
| { |
| . | if (zoneLocation.m_enable || zoneLocation.m_prefab.IsValid) |
| args.Context.AddString("You must specify a search query"); |
| |
| return false; |
| |
| } |
| |
| List<Tuple<object, Vector3>> list8 = Terminal.<InitTerminal>g__find|7_63(text14); |
| |
| int num23 = args.TryParameterInt(2, -1); |
| |
| if (num23 < 0) |
| |
| { |
| |
| list8.Sort((Tuple<object, Vector3> a, Tuple<object, Vector3> b) => Vector3.Distance(a.Item2, Player.m_localPlayer.transform.position).CompareTo(Vector3.Distance(b.Item2, Player.m_localPlayer.transform.position))); |
| |
| num23 *= -1; |
| |
| num23--; |
| |
| } |
| |
| num23 = Math.Min(list8.Count - 1, num23); |
| |
| if (list8.Count > 0) |
| |
| { |
| |
| int num24 = args.TryParameterInt(3, 30); |
| |
| for (int num25 = num23; num25 < list8.Count; num25++) |
| { |
| { |
| . | list9.Add(zoneLocation.m_prefab.Name); |
| if (Vector3.Distance(Player.m_localPlayer.transform.position, list8[num25].Item2) >= (float)num24) |
| |
| { |
| |
| Player.m_localPlayer.TeleportTo(list8[num25].Item2, Player.m_localPlayer.transform.rotation, true); |
| |
| } |
| } |
| } |
| } |
| } |
| . | return list9; |
| args.Context.AddString(string.Format("Found {0} objects containing '{1}'", list8.Count, text14)); |
| }, false, false, false); |
| return true; |
| |
| }, true, false, false, false, false, new Terminal.ConsoleOptionsFetcher(Terminal.<InitTerminal>g__findOpt|7_62), false, false, false); |
| |
| new Terminal.ConsoleCommand("setfuel", "[amount=10] Sets all light fuel to specified amount", delegate(Terminal.ConsoleEventArgs args) |
| |
| { |
| |
| if (Player.m_localPlayer == null) |
| |
| { |
| |
| return false; |
| |
| } |
| |
| UnityEngine.Object[] array7 = UnityEngine.Object.FindObjectsOfType(typeof(Fireplace)); |
| |
| int num26 = args.TryParameterInt(1, 10); |
| |
| UnityEngine.Object[] array8 = array7; |
| |
| for (int num27 = 0; num27 < array8.Length; num27++) |
| |
| { |
| |
| ((Fireplace)array8[num27]).SetFuel((float)num26); |
| |
| } |
| |
| return true; |
| |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("freefly", "freefly photo mode", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("freefly", "freefly photo mode", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| args.Context.AddString("Toggling free fly camera"); |
| args.Context.AddString("Toggling free fly camera"); |
| GameCamera.instance.ToggleFreeFly(); |
| GameCamera.instance.ToggleFreeFly(); |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("ffsmooth", "freefly smoothness", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("ffsmooth", "freefly smoothness", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length <= 1) |
| if (args.Length <= 1) |
| { |
| { |
| args.Context.AddString(GameCamera.instance.GetFreeFlySmoothness().ToString()); |
| args.Context.AddString(GameCamera.instance.GetFreeFlySmoothness().ToString()); |
| return true; |
| return true; |
| } |
| } |
| . | float num25; |
| float num28; |
| if (args.TryParameterFloat(1, out num25)) |
| if (args.TryParameterFloat(1, out num28)) |
| { |
| { |
| . | args.Context.AddString("Setting free fly camera smoothing:" + num25.ToString()); |
| args.Context.AddString("Setting free fly camera smoothing:" + num28.ToString()); |
| GameCamera.instance.SetFreeFlySmoothness(num25); |
| GameCamera.instance.SetFreeFlySmoothness(num28); |
| return true; |
| return true; |
| } |
| } |
| return false; |
| return false; |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("location", "[SAVE*] spawn location (CAUTION: saving permanently disabled, *unless you specify SAVE)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("location", "[SAVE*] spawn location (CAUTION: saving permanently disabled, *unless you specify SAVE)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | string text14 = args[1]; |
| string text15 = args[1]; |
| Vector3 vector = Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward * 10f; |
| Vector3 vector = Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward * 10f; |
| . | ZoneSystem.instance.TestSpawnLocation(text14, vector, args.Length < 3 || args[2] != "SAVE"); |
| ZoneSystem.instance.TestSpawnLocation(text15, vector, args.Length < 3 || args[2] != "SAVE"); |
| return true; |
| return true; |
| }, true, false, false, false, false, delegate |
| }, true, false, false, false, false, delegate |
| { |
| { |
| . | List<string> list10 = new List<string>(); |
| List<string> list9 = new List<string>(); |
| foreach (ZoneSystem.ZoneLocation zoneLocation2 in ZoneSystem.instance.m_locations) |
| foreach (ZoneSystem.ZoneLocation zoneLocation in ZoneSystem.instance.m_locations) |
| { |
| { |
| . | if (zoneLocation2.m_prefab.IsValid) |
| if (zoneLocation.m_prefab.IsValid) |
| { |
| { |
| . | list10.Add(zoneLocation2.m_prefab.Name); |
| list9.Add(zoneLocation.m_prefab.Name); |
| } |
| } |
| } |
| } |
| . | return list10; |
| return list9; |
| }, false, false, true); |
| }, false, false, true); |
| new Terminal.ConsoleCommand("vegetation", "spawn vegetation", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("vegetation", "spawn vegetation", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Vector3 vector2 = Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward * 2f; |
| Vector3 vector2 = Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward * 2f; |
| . | string text15 = args[1].ToLower(); |
| string text16 = args[1].ToLower(); |
| foreach (ZoneSystem.ZoneVegetation zoneVegetation in ZoneSystem.instance.m_vegetation) |
| foreach (ZoneSystem.ZoneVegetation zoneVegetation in ZoneSystem.instance.m_vegetation) |
| { |
| { |
| . | if (zoneVegetation.m_prefab.name.ToLower() == text15) |
| if (zoneVegetation.m_prefab.name.ToLower() == text16) |
| { |
| { |
| . | float num26 = (float)UnityEngine.Random.Range(0, 360); |
| float num29 = (float)UnityEngine.Random.Range(0, 360); |
| float num27 = UnityEngine.Random.Range(zoneVegetation.m_scaleMin, zoneVegetation.m_scaleMax); |
| float num30 = UnityEngine.Random.Range(zoneVegetation.m_scaleMin, zoneVegetation.m_scaleMax); |
| float num28 = UnityEngine.Random.Range(-zoneVegetation.m_randTilt, zoneVegetation.m_randTilt); |
| float num31 = UnityEngine.Random.Range(-zoneVegetation.m_randTilt, zoneVegetation.m_randTilt); |
| float num29 = UnityEngine.Random.Range(-zoneVegetation.m_randTilt, zoneVegetation.m_randTilt); |
| float num32 = UnityEngine.Random.Range(-zoneVegetation.m_randTilt, zoneVegetation.m_randTilt); |
| Vector3 vector3; |
| Vector3 vector3; |
| Heightmap.Biome biome; |
| Heightmap.Biome biome; |
| Heightmap.BiomeArea biomeArea; |
| Heightmap.BiomeArea biomeArea; |
| Heightmap heightmap; |
| Heightmap heightmap; |
| ZoneSystem.instance.GetGroundData(ref vector2, out vector3, out biome, out biomeArea, out heightmap); |
| ZoneSystem.instance.GetGroundData(ref vector2, out vector3, out biome, out biomeArea, out heightmap); |
| . | float num30; |
| float num33; |
| Vector3 vector4; |
| Vector3 vector4; |
| . | if (zoneVegetation.m_snapToStaticSolid && ZoneSystem.instance.GetStaticSolidHeight(vector2, out num30, out vector4)) |
| if (zoneVegetation.m_snapToStaticSolid && ZoneSystem.instance.GetStaticSolidHeight(vector2, out num33, out vector4)) |
| { |
| { |
| . | vector2.y = num30; |
| vector2.y = num33; |
| vector3 = vector4; |
| vector3 = vector4; |
| } |
| } |
| if (zoneVegetation.m_snapToWater) |
| if (zoneVegetation.m_snapToWater) |
| { |
| { |
| . | vector2.y = ZoneSystem.instance.m_waterLevel; |
| vector2.y = 30f; |
| } |
| } |
| vector2.y += zoneVegetation.m_groundOffset; |
| vector2.y += zoneVegetation.m_groundOffset; |
| Quaternion quaternion = Quaternion.identity; |
| Quaternion quaternion = Quaternion.identity; |
| if (zoneVegetation.m_chanceToUseGroundTilt > 0f && UnityEngine.Random.value <= zoneVegetation.m_chanceToUseGroundTilt) |
| if (zoneVegetation.m_chanceToUseGroundTilt > 0f && UnityEngine.Random.value <= zoneVegetation.m_chanceToUseGroundTilt) |
| { |
| { |
| . | Quaternion quaternion2 = Quaternion.Euler(0f, num26, 0f); |
| Quaternion quaternion2 = Quaternion.Euler(0f, num29, 0f); |
| quaternion = Quaternion.LookRotation(Vector3.Cross(vector3, quaternion2 * Vector3.forward), vector3); |
| quaternion = Quaternion.LookRotation(Vector3.Cross(vector3, quaternion2 * Vector3.forward), vector3); |
| } |
| } |
| else |
| else |
| { |
| { |
| . | quaternion = Quaternion.Euler(num28, num26, num29); |
| quaternion = Quaternion.Euler(num31, num29, num32); |
| } |
| } |
| . | GameObject gameObject3 = UnityEngine.Object.Instantiate<GameObject>(zoneVegetation.m_prefab, vector2, quaternion); |
| GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(zoneVegetation.m_prefab, vector2, quaternion); |
| gameObject3.GetComponent<ZNetView>().SetLocalScale(new Vector3(num27, num27, num27)); |
| gameObject2.GetComponent<ZNetView>().SetLocalScale(new Vector3(num30, num30, num30)); |
| foreach (Collider collider in gameObject3.GetComponentsInChildren<Collider>()) |
| foreach (Collider collider in gameObject2.GetComponentsInChildren<Collider>()) |
| { |
| { |
| collider.enabled = false; |
| collider.enabled = false; |
| collider.enabled = true; |
| collider.enabled = true; |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| return "No vegeration prefab named '" + args[1] + "' found"; |
| return "No vegeration prefab named '" + args[1] + "' found"; |
| }, true, false, false, false, false, delegate |
| }, true, false, false, false, false, delegate |
| { |
| { |
| . | List<string> list11 = new List<string>(); |
| List<string> list10 = new List<string>(); |
| foreach (ZoneSystem.ZoneVegetation zoneVegetation2 in ZoneSystem.instance.m_vegetation) |
| foreach (ZoneSystem.ZoneVegetation zoneVegetation2 in ZoneSystem.instance.m_vegetation) |
| { |
| { |
| if (zoneVegetation2.m_prefab != null) |
| if (zoneVegetation2.m_prefab != null) |
| { |
| { |
| . | list11.Add(zoneVegetation2.m_prefab.name); |
| list10.Add(zoneVegetation2.m_prefab.name); |
| } |
| } |
| } |
| } |
| . | return list11; |
| return list10; |
| }, false, false, true); |
| }, false, false, true); |
| new Terminal.ConsoleCommand("nextseed", "forces the next dungeon to a seed (CAUTION: saving permanently disabled)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("nextseed", "forces the next dungeon to a seed (CAUTION: saving permanently disabled)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return true; |
| return true; |
| } |
| } |
| . | int num32; |
| int num35; |
| if (args.TryParameterInt(1, out num32)) |
| if (args.TryParameterInt(1, out num35)) |
| { |
| { |
| . | DungeonGenerator.m_forceSeed = num32; |
| DungeonGenerator.m_forceSeed = num35; |
| ZoneSystem.instance.m_didZoneTest = true; |
| ZoneSystem.instance.m_didZoneTest = true; |
| MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, "Location seed set, world saving DISABLED until restart", 0, null); |
| MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, "Location seed set, world saving DISABLED until restart", 0, null); |
| } |
| } |
| return true; |
| return true; |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| . | new Terminal.ConsoleCommand("spawn", "[amount] [level] [p/e/i] - spawn something. (End word with a star (*) to create each object containing that word.) Add a 'p' after to try to pick up the spawned items, adding 'e' will try to use/equip, 'i' will only spawn and pickup if you don't have one in your inventory.", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("spawn", "[amount] [level] [radius] [p/e/i] - spawn something. (End word with a star (*) to create each object containing that word.) Add a 'p' after to try to pick up the spawned items, adding 'e' will try to use/equip, 'i' will only spawn and pickup if you don't have one in your inventory.", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length <= 1 || !ZNetScene.instance) |
| if (args.Length <= 1 || !ZNetScene.instance) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | string text16 = args[1]; |
| string text17 = args[1]; |
| Terminal.<>c__DisplayClass7_2 CS$<>8__locals4; |
| Terminal.<>c__DisplayClass7_2 CS$<>8__locals4; |
| CS$<>8__locals4.count = args.TryParameterInt(2, 1); |
| CS$<>8__locals4.count = args.TryParameterInt(2, 1); |
| CS$<>8__locals4.level = args.TryParameterInt(3, 1); |
| CS$<>8__locals4.level = args.TryParameterInt(3, 1); |
| . | args.TryParameterInt(4, -1); |
| CS$<>8__locals4.radius = args.TryParameterFloat(4, 0.5f); |
| |
| args.TryParameterInt(5, -1); |
| CS$<>8__locals4.pickup = args.HasArgumentAnywhere("p", 2, true); |
| CS$<>8__locals4.pickup = args.HasArgumentAnywhere("p", 2, true); |
| CS$<>8__locals4.use = args.HasArgumentAnywhere("e", 2, true); |
| CS$<>8__locals4.use = args.HasArgumentAnywhere("e", 2, true); |
| CS$<>8__locals4.onlyIfMissing = args.HasArgumentAnywhere("i", 2, true); |
| CS$<>8__locals4.onlyIfMissing = args.HasArgumentAnywhere("i", 2, true); |
| CS$<>8__locals4.vals = null; |
| CS$<>8__locals4.vals = null; |
| . | foreach (string text17 in args.Args) |
| foreach (string text18 in args.Args) |
| { |
| { |
| . | if (text17.Contains("::")) |
| if (text18.Contains("::")) |
| { |
| { |
| . | string[] array9 = text17.Split(new string[] { "::" }, StringSplitOptions.None); |
| string[] array9 = text18.Split(new string[] { "::" }, StringSplitOptions.None); |
| string[] array10 = array9[0].Split('.', StringSplitOptions.None); |
| string[] array10 = array9[0].Split('.', StringSplitOptions.None); |
| if (array9.Length >= 2 && array10.Length >= 2) |
| if (array9.Length >= 2 && array10.Length >= 2) |
| { |
| { |
| if (CS$<>8__locals4.vals == null) |
| if (CS$<>8__locals4.vals == null) |
| { |
| { |
| CS$<>8__locals4.vals = new Dictionary<string, object>(); |
| CS$<>8__locals4.vals = new Dictionary<string, object>(); |
| } |
| } |
| . | int num34; |
| int num37; |
| bool flag2; |
| bool flag2; |
| . | float num35; |
| |
| float num36; |
| |
| float num37; |
| |
| float num38; |
| float num38; |
| . | if (int.TryParse(array9[1], out num34)) |
| float num39; |
| |
| float num40; |
| |
| float num41; |
| |
| if (int.TryParse(array9[1], out num37)) |
| { |
| { |
| . | CS$<>8__locals4.vals[array9[0]] = num34; |
| CS$<>8__locals4.vals[array9[0]] = num37; |
| } |
| } |
| else if (bool.TryParse(array9[1], out flag2)) |
| else if (bool.TryParse(array9[1], out flag2)) |
| { |
| { |
| CS$<>8__locals4.vals[array9[0]] = flag2; |
| CS$<>8__locals4.vals[array9[0]] = flag2; |
| } |
| } |
| . | else if (float.TryParse(array9[1], NumberStyles.Float, CultureInfo.InvariantCulture, out num35)) |
| else if (float.TryParse(array9[1], NumberStyles.Float, CultureInfo.InvariantCulture, out num38)) |
| { |
| { |
| . | CS$<>8__locals4.vals[array9[0]] = num35; |
| CS$<>8__locals4.vals[array9[0]] = num38; |
| } |
| } |
| . | else if (array9.Length >= 4 && float.TryParse(array9[1], out num36) && float.TryParse(array9[2], out num37) && float.TryParse(array9[3], out num38)) |
| else if (array9.Length >= 4 && float.TryParse(array9[1], out num39) && float.TryParse(array9[2], out num40) && float.TryParse(array9[3], out num41)) |
| { |
| { |
| . | CS$<>8__locals4.vals[array9[0]] = new Vector3(num36, num37, num38); |
| CS$<>8__locals4.vals[array9[0]] = new Vector3(num39, num40, num41); |
| } |
| } |
| else |
| else |
| { |
| { |
| CS$<>8__locals4.vals[array9[0]] = array9[1]; |
| CS$<>8__locals4.vals[array9[0]] = array9[1]; |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| DateTime now = DateTime.Now; |
| DateTime now = DateTime.Now; |
| . | if (text16.Length >= 2 && text16[text16.Length - 1] == '*') |
| if (text17.Length >= 2 && text17[text17.Length - 1] == '*') |
| { |
| { |
| . | text16 = text16.Substring(0, text16.Length - 1).ToLower(); |
| text17 = text17.Substring(0, text17.Length - 1).ToLower(); |
| using (List<string>.Enumerator enumerator20 = ZNetScene.instance.GetPrefabNames().GetEnumerator()) |
| using (List<string>.Enumerator enumerator17 = ZNetScene.instance.GetPrefabNames().GetEnumerator()) |
| { |
| { |
| . | while (enumerator20.MoveNext()) |
| while (enumerator17.MoveNext()) |
| { |
| { |
| . | string text18 = enumerator20.Current; |
| string text19 = enumerator17.Current; |
| string text19 = text18.ToLower(); |
| string text20 = text19.ToLower(); |
| if (text19.Contains(text16) && (text16.Contains("fx") || !text19.Contains("fx"))) |
| if (text20.Contains(text17) && (text17.Contains("fx") || !text20.Contains("fx"))) |
| { |
| { |
| . | Terminal.<InitTerminal>g__spawn|7_129(text18, ref CS$<>8__locals4); |
| Terminal.<InitTerminal>g__spawn|7_138(text19, ref CS$<>8__locals4); |
| } |
| } |
| } |
| } |
| . | goto IL_2A7; |
| goto IL_2BA; |
| } |
| } |
| } |
| } |
| . | Terminal.<InitTerminal>g__spawn|7_129(text16, ref CS$<>8__locals4); |
| Terminal.<InitTerminal>g__spawn|7_138(text17, ref CS$<>8__locals4); |
| IL_2A7: |
| IL_2BA: |
| ZLog.Log("Spawn time :" + (DateTime.Now - now).TotalMilliseconds.ToString() + " ms"); |
| ZLog.Log("Spawn time :" + (DateTime.Now - now).TotalMilliseconds.ToString() + " ms"); |
| . | Gogan.LogEvent("Cheat", "Spawn", text16, (long)CS$<>8__locals4.count); |
| Gogan.LogEvent("Cheat", "Spawn", text17, (long)CS$<>8__locals4.count); |
| return true; |
| return true; |
| }, true, false, false, false, false, delegate |
| }, true, false, false, false, false, delegate |
| { |
| { |
| if (!ZNetScene.instance) |
| if (!ZNetScene.instance) |
| { |
| { |
| return new List<string>(); |
| return new List<string>(); |
| } |
| } |
| return ZNetScene.instance.GetPrefabNames(); |
| return ZNetScene.instance.GetPrefabNames(); |
| }, false, false, true); |
| }, false, false, true); |
| new Terminal.ConsoleCommand("catch", "[fishname] [level] simulates catching a fish", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("catch", "[fishname] [level] simulates catching a fish", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | string text20 = args[1]; |
| string text21 = args[1]; |
| int num39 = args.TryParameterInt(2, 1); |
| int num42 = args.TryParameterInt(2, 1); |
| num39 = Mathf.Min(num39, 4); |
| num42 = Mathf.Min(num42, 4); |
| GameObject prefab = ZNetScene.instance.GetPrefab(text20); |
| GameObject prefab = ZNetScene.instance.GetPrefab(text21); |
| if (!prefab) |
| if (!prefab) |
| { |
| { |
| . | return "No prefab named: " + text20; |
| return "No prefab named: " + text21; |
| } |
| } |
| Fish fish = prefab.GetComponentInChildren<Fish>(); |
| Fish fish = prefab.GetComponentInChildren<Fish>(); |
| if (!fish) |
| if (!fish) |
| { |
| { |
| . | return "No fish prefab named: " + text20; |
| return "No fish prefab named: " + text21; |
| } |
| } |
| . | GameObject gameObject4 = UnityEngine.Object.Instantiate<GameObject>(prefab, Player.m_localPlayer.transform.position, Quaternion.identity); |
| GameObject gameObject3 = UnityEngine.Object.Instantiate<GameObject>(prefab, Player.m_localPlayer.transform.position, Quaternion.identity); |
| fish = gameObject4.GetComponentInChildren<Fish>(); |
| fish = gameObject3.GetComponentInChildren<Fish>(); |
| ItemDrop component5 = gameObject4.GetComponent<ItemDrop>(); |
| ItemDrop component5 = gameObject3.GetComponent<ItemDrop>(); |
| if (component5) |
| if (component5) |
| { |
| { |
| . | component5.SetQuality(num39); |
| component5.SetQuality(num42); |
| } |
| } |
| . | string text21 = FishingFloat.Catch(fish, Player.m_localPlayer); |
| string text22 = FishingFloat.Catch(fish, Player.m_localPlayer); |
| Player.m_localPlayer.Message(MessageHud.MessageType.Center, text21, 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.Center, text22, 0, null); |
| return true; |
| return true; |
| }, true, false, false, false, false, () => new List<string> |
| }, true, false, false, false, false, () => new List<string> |
| { |
| { |
| "Fish1", "Fish2", "Fish3", "Fish4_cave", "Fish5", "Fish6", "Fish7", "Fish8", "Fish9", "Fish10", |
| "Fish1", "Fish2", "Fish3", "Fish4_cave", "Fish5", "Fish6", "Fish7", "Fish8", "Fish9", "Fish10", |
| "Fish11", "Fish12" |
| "Fish11", "Fish12" |
| }, false, false, false); |
| }, false, false, false); |
| new Terminal.ConsoleCommand("itemset", "[name] [item level override] [keep] - spawn a premade named set, add 'keep' to not drop current items.", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("itemset", "[name] [item level override] [keep] - spawn a premade named set, add 'keep' to not drop current items.", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length >= 2) |
| if (args.Length >= 2) |
| { |
| { |
| ItemSets.instance.TryGetSet(args.Args[1], !args.HasArgumentAnywhere("keep", 0, true), args.TryParameterInt(2, -1), args.TryParameterInt(3, -1)); |
| ItemSets.instance.TryGetSet(args.Args[1], !args.HasArgumentAnywhere("keep", 0, true), args.TryParameterInt(2, -1), args.TryParameterInt(3, -1)); |
| return true; |
| return true; |
| } |
| } |
| return "Specify name of itemset."; |
| return "Specify name of itemset."; |
| }, true, false, false, false, false, () => ItemSets.instance.GetSetNames(), false, false, true); |
| }, true, false, false, false, false, () => ItemSets.instance.GetSetNames(), false, false, true); |
| new Terminal.ConsoleCommand("pos", "print current player position", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("pos", "print current player position", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Player localPlayer2 = Player.m_localPlayer; |
| Player localPlayer2 = Player.m_localPlayer; |
| . | if (localPlayer2) |
| if (localPlayer2 && ZoneSystem.instance) |
| { |
| { |
| Terminal context8 = args.Context; |
| Terminal context8 = args.Context; |
| if (context8 == null) |
| if (context8 == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| . | context8.AddString("Player position (X,Y,Z):" + localPlayer2.transform.position.ToString("F0")); |
| context8.AddString(string.Format("Player position (X,Y,Z): {0} (Zone: {1})", localPlayer2.transform.position.ToString("F0"), ZoneSystem.instance.GetZone(localPlayer2.transform.position))); |
| } |
| } |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("recall", "[*name] recalls players to you, optionally that match given name", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("recall", "[*name] recalls players to you, optionally that match given name", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| foreach (ZNetPeer znetPeer in ZNet.instance.GetPeers()) |
| foreach (ZNetPeer znetPeer in ZNet.instance.GetPeers()) |
| { |
| { |
| if (znetPeer.m_playerName != Player.m_localPlayer.GetPlayerName() && (args.Length < 2 || znetPeer.m_playerName.ToLower().Contains(args[1].ToLower()))) |
| if (znetPeer.m_playerName != Player.m_localPlayer.GetPlayerName() && (args.Length < 2 || znetPeer.m_playerName.ToLower().Contains(args[1].ToLower()))) |
| { |
| { |
| Chat.instance.TeleportPlayer(znetPeer.m_uid, Player.m_localPlayer.transform.position, Player.m_localPlayer.transform.rotation, true); |
| Chat.instance.TeleportPlayer(znetPeer.m_uid, Player.m_localPlayer.transform.position, Player.m_localPlayer.transform.rotation, true); |
| } |
| } |
| } |
| } |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("goto", "[x,z] - teleport", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("goto", "[x,z] - teleport", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | int num40; |
| int num43; |
| int num41; |
| int num44; |
| if (args.Length < 3 || !args.TryParameterInt(1, out num40) || !args.TryParameterInt(2, out num41)) |
| if (args.Length < 3 || !args.TryParameterInt(1, out num43) || !args.TryParameterInt(2, out num44)) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Player localPlayer3 = Player.m_localPlayer; |
| Player localPlayer3 = Player.m_localPlayer; |
| if (localPlayer3) |
| if (localPlayer3) |
| { |
| { |
| . | Vector3 vector5 = new Vector3((float)num40, localPlayer3.transform.position.y, (float)num41); |
| Vector3 vector5 = new Vector3((float)num43, localPlayer3.transform.position.y, (float)num44); |
| float num42 = (localPlayer3.IsDebugFlying() ? 400f : ZoneSystem.instance.m_waterLevel); |
| float num45 = (localPlayer3.IsDebugFlying() ? 400f : 30f); |
| vector5.y = Mathf.Clamp(vector5.y, ZoneSystem.instance.m_waterLevel, num42); |
| vector5.y = Mathf.Clamp(vector5.y, 30f, num45); |
| localPlayer3.TeleportTo(vector5, localPlayer3.transform.rotation, true); |
| localPlayer3.TeleportTo(vector5, localPlayer3.transform.rotation, true); |
| } |
| } |
| Gogan.LogEvent("Cheat", "Goto", "", 0L); |
| Gogan.LogEvent("Cheat", "Goto", "", 0L); |
| return true; |
| return true; |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("exploremap", "explore entire map", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("exploremap", "explore entire map", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Minimap.instance.ExploreAll(); |
| Minimap.instance.ExploreAll(); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("resetmap", "reset map exploration", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetmap", "reset map exploration", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Minimap.instance.Reset(); |
| Minimap.instance.Reset(); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("resetsharedmap", "removes any shared map data from cartography table", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetsharedmap", "removes any shared map data from cartography table", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Minimap.instance.ResetSharedMapData(); |
| Minimap.instance.ResetSharedMapData(); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("restartparty", "restart playfab party network", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("restartparty", "restart playfab party network", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (ZNet.m_onlineBackend == OnlineBackendType.PlayFab) |
| if (ZNet.m_onlineBackend == OnlineBackendType.PlayFab) |
| { |
| { |
| if (ZNet.instance.IsServer()) |
| if (ZNet.instance.IsServer()) |
| { |
| { |
| ZPlayFabMatchmaking.ResetParty(); |
| ZPlayFabMatchmaking.ResetParty(); |
| return; |
| return; |
| } |
| } |
| ZPlayFabSocket.ScheduleResetParty(); |
| ZPlayFabSocket.ScheduleResetParty(); |
| } |
| } |
| }, false, false, false, false, false, null, false, true, false); |
| }, false, false, false, false, false, null, false, true, false); |
| new Terminal.ConsoleCommand("puke", "empties your stomach of food", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("puke", "empties your stomach of food", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Player.m_localPlayer) |
| if (Player.m_localPlayer) |
| { |
| { |
| Player.m_localPlayer.ClearFood(); |
| Player.m_localPlayer.ClearFood(); |
| } |
| } |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("tame", "tame all nearby tameable creatures", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("tame", "tame all nearby tameable creatures", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Tameable.TameAllInArea(Player.m_localPlayer.transform.position, 20f); |
| Tameable.TameAllInArea(Player.m_localPlayer.transform.position, 20f); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("aggravate", "aggravated all nearby neutrals", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("aggravate", "aggravated all nearby neutrals", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| BaseAI.AggravateAllInArea(Player.m_localPlayer.transform.position, 20f, BaseAI.AggravatedReason.Damage); |
| BaseAI.AggravateAllInArea(Player.m_localPlayer.transform.position, 20f, BaseAI.AggravatedReason.Damage); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("killall", "kill nearby creatures", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("killall", "kill nearby creatures", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| List<Character> allCharacters = Character.GetAllCharacters(); |
| List<Character> allCharacters = Character.GetAllCharacters(); |
| . | int num43 = 0; |
| int num46 = 0; |
| |
| int num47 = 0; |
| foreach (Character character in allCharacters) |
| foreach (Character character in allCharacters) |
| { |
| { |
| if (!character.IsPlayer()) |
| if (!character.IsPlayer()) |
| { |
| { |
| . | HitData hitData = new HitData(); |
| character.Damage(new HitData(1E+10f)); |
| hitData.m_damage.m_damage = 1E+10f; |
| num46++; |
| character.Damage(hitData); |
| } |
| num43++; |
| } |
| |
| SpawnArea[] array11 = UnityEngine.Object.FindObjectsByType<SpawnArea>(FindObjectsSortMode.None); |
| |
| for (int num48 = 0; num48 < array11.Length; num48++) |
| |
| { |
| |
| Destructible component6 = array11[num48].gameObject.GetComponent<Destructible>(); |
| |
| if (component6 != null) |
| |
| { |
| |
| component6.Damage(new HitData(1E+10f)); |
| |
| num47++; |
| } |
| } |
| } |
| } |
| . | Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Killing all the monsters:" + num43.ToString(), 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, string.Format("Killed {0} monsters{1}", num46, (num47 > 0) ? string.Format(" & {0} spawners.", num47) : "."), 0, null); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| . | new Terminal.ConsoleCommand("killenemies", "kill nearby enemies", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("killenemycreatures", "kill nearby enemies", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| List<Character> allCharacters2 = Character.GetAllCharacters(); |
| List<Character> allCharacters2 = Character.GetAllCharacters(); |
| . | int num44 = 0; |
| int num49 = 0; |
| foreach (Character character2 in allCharacters2) |
| foreach (Character character2 in allCharacters2) |
| { |
| { |
| if (!character2.IsPlayer() && !character2.IsTamed()) |
| if (!character2.IsPlayer() && !character2.IsTamed()) |
| { |
| { |
| . | HitData hitData2 = new HitData(); |
| character2.Damage(new HitData(1E+10f)); |
| hitData2.m_damage.m_damage = 1E+10f; |
| num49++; |
| character2.Damage(hitData2); |
| |
| num44++; |
| |
| } |
| } |
| } |
| } |
| . | Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Killing all the monsters:" + num44.ToString(), 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, string.Format("Killed {0} monsters.", num49), 0, null); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| . | new Terminal.ConsoleCommand("killtame", "kill nearby tame creatures.", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("killenemies", "kill nearby enemies", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| List<Character> allCharacters3 = Character.GetAllCharacters(); |
| List<Character> allCharacters3 = Character.GetAllCharacters(); |
| . | int num45 = 0; |
| int num50 = 0; |
| |
| int num51 = 0; |
| foreach (Character character3 in allCharacters3) |
| foreach (Character character3 in allCharacters3) |
| { |
| { |
| . | if (!character3.IsPlayer() && character3.IsTamed()) |
| if (!character3.IsPlayer() && !character3.IsTamed()) |
| { |
| { |
| . | HitData hitData3 = new HitData(); |
| character3.Damage(new HitData(1E+10f)); |
| hitData3.m_damage.m_damage = 1E+10f; |
| num50++; |
| character3.Damage(hitData3); |
| |
| num45++; |
| |
| } |
| } |
| } |
| } |
| . | Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Killing all tame creatures:" + num45.ToString(), 0, null); |
| SpawnArea[] array12 = UnityEngine.Object.FindObjectsByType<SpawnArea>(FindObjectsSortMode.None); |
| |
| for (int num52 = 0; num52 < array12.Length; num52++) |
| |
| { |
| |
| Destructible component7 = array12[num52].gameObject.GetComponent<Destructible>(); |
| |
| if (component7 != null) |
| |
| { |
| |
| component7.Damage(new HitData(1E+10f)); |
| |
| num51++; |
| |
| } |
| |
| } |
| |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, string.Format("Killed {0} monsters{1}", num50, (num51 > 0) ? string.Format(" & {0} spawners.", num51) : "."), 0, null); |
| |
| }, true, false, false, false, false, null, false, false, true); |
| |
| new Terminal.ConsoleCommand("killtame", "kill nearby tame creatures.", delegate(Terminal.ConsoleEventArgs args) |
| |
| { |
| |
| List<Character> allCharacters4 = Character.GetAllCharacters(); |
| |
| int num53 = 0; |
| |
| foreach (Character character4 in allCharacters4) |
| |
| { |
| |
| if (!character4.IsPlayer() && character4.IsTamed()) |
| |
| { |
| |
| HitData hitData = new HitData(); |
| |
| hitData.m_damage.m_damage = 1E+10f; |
| |
| character4.Damage(hitData); |
| |
| num53++; |
| |
| } |
| |
| } |
| |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Killing all tame creatures:" + num53.ToString(), 0, null); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("heal", "heal to full health & stamina", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("heal", "heal to full health & stamina", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Player.m_localPlayer == null) |
| if (Player.m_localPlayer == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| Player.m_localPlayer.Heal(Player.m_localPlayer.GetMaxHealth(), true); |
| Player.m_localPlayer.Heal(Player.m_localPlayer.GetMaxHealth(), true); |
| Player.m_localPlayer.AddStamina(Player.m_localPlayer.GetMaxStamina()); |
| Player.m_localPlayer.AddStamina(Player.m_localPlayer.GetMaxStamina()); |
| Player.m_localPlayer.AddEitr(Player.m_localPlayer.GetMaxEitr()); |
| Player.m_localPlayer.AddEitr(Player.m_localPlayer.GetMaxEitr()); |
| . | }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, true, null, false, false, true); |
| new Terminal.ConsoleCommand("god", "invincible mode", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("god", "invincible mode", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Player.m_localPlayer.SetGodMode(args.HasArgumentAnywhere("on", 0, true) || (!args.HasArgumentAnywhere("off", 0, true) && !Player.m_localPlayer.InGodMode())); |
| Player.m_localPlayer.SetGodMode(args.HasArgumentAnywhere("on", 0, true) || (!args.HasArgumentAnywhere("off", 0, true) && !Player.m_localPlayer.InGodMode())); |
| args.Context.AddString("God mode:" + Player.m_localPlayer.InGodMode().ToString()); |
| args.Context.AddString("God mode:" + Player.m_localPlayer.InGodMode().ToString()); |
| Gogan.LogEvent("Cheat", "God", Player.m_localPlayer.InGodMode().ToString(), 0L); |
| Gogan.LogEvent("Cheat", "God", Player.m_localPlayer.InGodMode().ToString(), 0L); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("ghost", "", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("ghost", "", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Player.m_localPlayer.SetGhostMode(args.HasArgumentAnywhere("on", 0, true) || (!args.HasArgumentAnywhere("off", 0, true) && !Player.m_localPlayer.InGhostMode())); |
| Player.m_localPlayer.SetGhostMode(args.HasArgumentAnywhere("on", 0, true) || (!args.HasArgumentAnywhere("off", 0, true) && !Player.m_localPlayer.InGhostMode())); |
| args.Context.AddString("Ghost mode:" + Player.m_localPlayer.InGhostMode().ToString()); |
| args.Context.AddString("Ghost mode:" + Player.m_localPlayer.InGhostMode().ToString()); |
| Gogan.LogEvent("Cheat", "Ghost", Player.m_localPlayer.InGhostMode().ToString(), 0L); |
| Gogan.LogEvent("Cheat", "Ghost", Player.m_localPlayer.InGhostMode().ToString(), 0L); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("beard", "change beard", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("beard", "change beard", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| if (Player.m_localPlayer) |
| if (Player.m_localPlayer) |
| { |
| { |
| Player.m_localPlayer.SetBeard(args[1]); |
| Player.m_localPlayer.SetBeard(args[1]); |
| } |
| } |
| return true; |
| return true; |
| }, true, false, false, false, false, delegate |
| }, true, false, false, false, false, delegate |
| { |
| { |
| . | List<string> list12 = new List<string>(); |
| List<string> list11 = new List<string>(); |
| foreach (ItemDrop itemDrop2 in ObjectDB.instance.GetAllItems(ItemDrop.ItemData.ItemType.Customization, "Beard")) |
| foreach (ItemDrop itemDrop2 in ObjectDB.instance.GetAllItems(ItemDrop.ItemData.ItemType.Customization, "Beard")) |
| { |
| { |
| . | list12.Add(itemDrop2.name); |
| list11.Add(itemDrop2.name); |
| } |
| } |
| . | return list12; |
| return list11; |
| }, false, false, false); |
| }, false, false, false); |
| new Terminal.ConsoleCommand("hair", "change hair", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("hair", "change hair", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| if (Player.m_localPlayer) |
| if (Player.m_localPlayer) |
| { |
| { |
| Player.m_localPlayer.SetHair(args[1]); |
| Player.m_localPlayer.SetHair(args[1]); |
| } |
| } |
| return true; |
| return true; |
| }, true, false, false, false, false, delegate |
| }, true, false, false, false, false, delegate |
| { |
| { |
| . | List<string> list13 = new List<string>(); |
| List<string> list12 = new List<string>(); |
| foreach (ItemDrop itemDrop3 in ObjectDB.instance.GetAllItems(ItemDrop.ItemData.ItemType.Customization, "Hair")) |
| foreach (ItemDrop itemDrop3 in ObjectDB.instance.GetAllItems(ItemDrop.ItemData.ItemType.Customization, "Hair")) |
| { |
| { |
| . | list13.Add(itemDrop3.name); |
| list12.Add(itemDrop3.name); |
| } |
| } |
| . | return list13; |
| return list12; |
| }, false, false, false); |
| }, false, false, false); |
| new Terminal.ConsoleCommand("model", "change player model", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("model", "change player model", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | int num46; |
| int num54; |
| if (Player.m_localPlayer && args.TryParameterInt(1, out num46)) |
| if (Player.m_localPlayer && args.TryParameterInt(1, out num54)) |
| { |
| { |
| . | Player.m_localPlayer.SetPlayerModel(num46); |
| Player.m_localPlayer.SetPlayerModel(num54); |
| } |
| } |
| return true; |
| return true; |
| }, true, false, false, false, false, null, false, false, false); |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("tod", "-1 OR [0-1]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("tod", "-1 OR [0-1]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | float num47; |
| float num55; |
| if (EnvMan.instance == null || args.Length < 2 || !args.TryParameterFloat(1, out num47)) |
| if (EnvMan.instance == null || args.Length < 2 || !args.TryParameterFloat(1, out num55)) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | args.Context.AddString("Setting time of day:" + num47.ToString()); |
| args.Context.AddString("Setting time of day:" + num55.ToString()); |
| if (num47 < 0f) |
| if (num55 < 0f) |
| { |
| { |
| EnvMan.instance.m_debugTimeOfDay = false; |
| EnvMan.instance.m_debugTimeOfDay = false; |
| } |
| } |
| else |
| else |
| { |
| { |
| EnvMan.instance.m_debugTimeOfDay = true; |
| EnvMan.instance.m_debugTimeOfDay = true; |
| . | EnvMan.instance.m_debugTime = Mathf.Clamp01(num47); |
| EnvMan.instance.m_debugTime = Mathf.Clamp01(num55); |
| } |
| } |
| return true; |
| return true; |
| }, true, false, true, false, true, null, false, false, false); |
| }, true, false, true, false, true, null, false, false, false); |
| new Terminal.ConsoleCommand("env", "[env] override environment", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("env", "[env] override environment", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (EnvMan.instance == null || args.Length < 2) |
| if (EnvMan.instance == null || args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | string text22 = string.Join(" ", args.Args, 1, args.Args.Length - 1); |
| string text23 = string.Join(" ", args.Args, 1, args.Args.Length - 1); |
| args.Context.AddString("Setting debug enviornment:" + text22); |
| args.Context.AddString("Setting debug enviornment:" + text23); |
| EnvMan.instance.m_debugEnv = text22; |
| EnvMan.instance.m_debugEnv = text23; |
| return true; |
| return true; |
| }, true, false, true, false, true, delegate |
| }, true, false, true, false, true, delegate |
| { |
| { |
| . | List<string> list14 = new List<string>(); |
| List<string> list13 = new List<string>(); |
| foreach (EnvSetup envSetup in EnvMan.instance.m_environments) |
| foreach (EnvSetup envSetup in EnvMan.instance.m_environments) |
| { |
| { |
| . | list14.Add(envSetup.m_name); |
| list13.Add(envSetup.m_name); |
| } |
| } |
| . | return list14; |
| return list13; |
| }, false, false, false); |
| }, false, false, false); |
| new Terminal.ConsoleCommand("resetenv", "disables environment override", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetenv", "disables environment override", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (EnvMan.instance == null) |
| if (EnvMan.instance == null) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| args.Context.AddString("Resetting debug environment"); |
| args.Context.AddString("Resetting debug environment"); |
| EnvMan.instance.m_debugEnv = ""; |
| EnvMan.instance.m_debugEnv = ""; |
| return true; |
| return true; |
| }, true, false, true, false, true, null, false, false, false); |
| }, true, false, true, false, true, null, false, false, false); |
| new Terminal.ConsoleCommand("wind", "[angle] [intensity]", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("wind", "[angle] [intensity]", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | float num48; |
| float num56; |
| float num49; |
| float num57; |
| if (args.TryParameterFloat(1, out num48) && args.TryParameterFloat(2, out num49)) |
| if (args.TryParameterFloat(1, out num56) && args.TryParameterFloat(2, out num57)) |
| { |
| { |
| . | EnvMan.instance.SetDebugWind(num48, num49); |
| EnvMan.instance.SetDebugWind(num56, num57); |
| return true; |
| return true; |
| } |
| } |
| return false; |
| return false; |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("resetwind", "", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetwind", "", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| EnvMan.instance.ResetDebugWind(); |
| EnvMan.instance.ResetDebugWind(); |
| }, true, false, true, false, false, null, false, false, false); |
| }, true, false, true, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("clear", "clear the console window", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("clear", "clear the console window", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| args.Context.m_chatBuffer.Clear(); |
| args.Context.m_chatBuffer.Clear(); |
| args.Context.UpdateChat(); |
| args.Context.UpdateChat(); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| . | |
| new Terminal.ConsoleCommand("filtercraft", "[name] filters crafting list to contain part of text", delegate(Terminal.ConsoleEventArgs args) |
| |
| { |
| |
| if (args.Length <= 1) |
| |
| { |
| |
| Player.s_FilterCraft.Clear(); |
| |
| return; |
| |
| } |
| |
| Player.s_FilterCraft = args.ArgsAll.Split(' ', StringSplitOptions.None).ToList<string>(); |
| |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("clearstatus", "clear any status modifiers", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("clearstatus", "clear any status modifiers", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Player.m_localPlayer.ClearHardDeath(); |
| Player.m_localPlayer.ClearHardDeath(); |
| Player.m_localPlayer.GetSEMan().RemoveAllStatusEffects(false); |
| Player.m_localPlayer.GetSEMan().RemoveAllStatusEffects(false); |
| . | }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, true, null, false, false, true); |
| new Terminal.ConsoleCommand("addstatus", "[name] adds a status effect (ex: Rested, Burning, SoftDeath, Wet, etc)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("addstatus", "[name] adds a status effect (ex: Rested, Burning, SoftDeath, Wet, etc)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Player.m_localPlayer.GetSEMan().AddStatusEffect(args[1].GetStableHashCode(), true, 0, 0f); |
| Player.m_localPlayer.GetSEMan().AddStatusEffect(args[1].GetStableHashCode(), true, 0, 0f); |
| return true; |
| return true; |
| . | }, true, false, false, false, false, delegate |
| }, true, false, false, false, true, delegate |
| { |
| { |
| List<StatusEffect> statusEffects = ObjectDB.instance.m_StatusEffects; |
| List<StatusEffect> statusEffects = ObjectDB.instance.m_StatusEffects; |
| . | List<string> list15 = new List<string>(); |
| List<string> list14 = new List<string>(); |
| foreach (StatusEffect statusEffect in statusEffects) |
| foreach (StatusEffect statusEffect in statusEffects) |
| { |
| { |
| . | list15.Add(statusEffect.name); |
| list14.Add(statusEffect.name); |
| } |
| } |
| . | return list15; |
| return list14; |
| }, false, false, true); |
| }, false, false, true); |
| new Terminal.ConsoleCommand("setpower", "[name] sets your current guardian power and resets cooldown (ex: GP_Eikthyr, GP_TheElder, etc)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("setpower", "[name] sets your current guardian power and resets cooldown (ex: GP_Eikthyr, GP_TheElder, etc)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Player.m_localPlayer.SetGuardianPower(args[1]); |
| Player.m_localPlayer.SetGuardianPower(args[1]); |
| Player.m_localPlayer.m_guardianPowerCooldown = 0f; |
| Player.m_localPlayer.m_guardianPowerCooldown = 0f; |
| return true; |
| return true; |
| . | }, true, false, false, false, false, delegate |
| }, true, false, false, false, true, delegate |
| { |
| { |
| List<StatusEffect> statusEffects2 = ObjectDB.instance.m_StatusEffects; |
| List<StatusEffect> statusEffects2 = ObjectDB.instance.m_StatusEffects; |
| . | List<string> list16 = new List<string>(); |
| List<string> list15 = new List<string>(); |
| foreach (StatusEffect statusEffect2 in statusEffects2) |
| foreach (StatusEffect statusEffect2 in statusEffects2) |
| { |
| { |
| . | list16.Add(statusEffect2.name); |
| list15.Add(statusEffect2.name); |
| } |
| } |
| . | return list16; |
| return list15; |
| }, false, false, true); |
| }, false, false, true); |
| new Terminal.ConsoleCommand("bind", "[keycode] [command and parameters] bind a key to a console command. note: may cause conflicts with game controls", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("bind", "[keycode] [command and parameters] bind a key to a console command. note: may cause conflicts with game controls", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| KeyCode keyCode; |
| KeyCode keyCode; |
| if (!Enum.TryParse<KeyCode>(args[1], true, out keyCode)) |
| if (!Enum.TryParse<KeyCode>(args[1], true, out keyCode)) |
| { |
| { |
| args.Context.AddString("'" + args[1] + "' is not a valid UnityEngine.KeyCode."); |
| args.Context.AddString("'" + args[1] + "' is not a valid UnityEngine.KeyCode."); |
| } |
| } |
| else |
| else |
| { |
| { |
| . | string text23 = string.Join(" ", args.Args, 1, args.Length - 1); |
| string text24 = string.Join(" ", args.Args, 1, args.Length - 1); |
| Terminal.m_bindList.Add(text23); |
| Terminal.m_bindList.Add(text24); |
| Terminal.updateBinds(); |
| Terminal.updateBinds(); |
| } |
| } |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("unbind", "[keycode] clears all binds connected to keycode", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("unbind", "[keycode] clears all binds connected to keycode", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | for (int num50 = Terminal.m_bindList.Count - 1; num50 >= 0; num50--) |
| for (int num58 = Terminal.m_bindList.Count - 1; num58 >= 0; num58--) |
| { |
| { |
| . | if (Terminal.m_bindList[num50].Split(' ', StringSplitOptions.None)[0].ToLower() == args[1].ToLower()) |
| if (Terminal.m_bindList[num58].Split(' ', StringSplitOptions.None)[0].ToLower() == args[1].ToLower()) |
| { |
| { |
| . | Terminal.m_bindList.RemoveAt(num50); |
| Terminal.m_bindList.RemoveAt(num58); |
| } |
| } |
| } |
| } |
| Terminal.updateBinds(); |
| Terminal.updateBinds(); |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("printbinds", "prints current binds", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("printbinds", "prints current binds", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | foreach (string text24 in Terminal.m_bindList) |
| foreach (string text25 in Terminal.m_bindList) |
| { |
| { |
| . | args.Context.AddString(text24); |
| args.Context.AddString(text25); |
| } |
| } |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("resetbinds", "resets all custom binds to default dev commands", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetbinds", "resets all custom binds to default dev commands", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | for (int num51 = Terminal.m_bindList.Count - 1; num51 >= 0; num51--) |
| for (int num59 = Terminal.m_bindList.Count - 1; num59 >= 0; num59--) |
| { |
| { |
| . | Terminal.m_bindList.Remove(Terminal.m_bindList[num51]); |
| Terminal.m_bindList.Remove(Terminal.m_bindList[num59]); |
| } |
| } |
| Terminal.updateBinds(); |
| Terminal.updateBinds(); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("tombstone", "[name] creates a tombstone with given name", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("tombstone", "[name] creates a tombstone with given name", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| . | GameObject gameObject5 = UnityEngine.Object.Instantiate<GameObject>(Player.m_localPlayer.m_tombstone, Player.m_localPlayer.GetCenterPoint(), Player.m_localPlayer.transform.rotation); |
| GameObject gameObject4 = UnityEngine.Object.Instantiate<GameObject>(Player.m_localPlayer.m_tombstone, Player.m_localPlayer.GetCenterPoint(), Player.m_localPlayer.transform.rotation); |
| Container component6 = gameObject5.GetComponent<Container>(); |
| Container component8 = gameObject4.GetComponent<Container>(); |
| ItemDrop coinPrefab = StoreGui.instance.m_coinPrefab; |
| ItemDrop coinPrefab = StoreGui.instance.m_coinPrefab; |
| . | component6.GetInventory().AddItem(coinPrefab.gameObject.name, 1, coinPrefab.m_itemData.m_quality, coinPrefab.m_itemData.m_variant, 0L, "", true); |
| component8.GetInventory().AddItem(coinPrefab.gameObject.name, 1, coinPrefab.m_itemData.m_quality, coinPrefab.m_itemData.m_variant, 0L, "", true); |
| TombStone component7 = gameObject5.GetComponent<TombStone>(); |
| TombStone component9 = gameObject4.GetComponent<TombStone>(); |
| PlayerProfile playerProfile2 = Game.instance.GetPlayerProfile(); |
| PlayerProfile playerProfile2 = Game.instance.GetPlayerProfile(); |
| . | string text25 = ((args.Args.Length >= 2) ? args.Args[1] : playerProfile2.GetName()); |
| string text26 = ((args.Args.Length >= 2) ? args.Args[1] : playerProfile2.GetName()); |
| component7.Setup(text25, playerProfile2.GetPlayerID()); |
| component9.Setup(text26, playerProfile2.GetPlayerID()); |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("test", "[key] [value] set test string, with optional value. set empty existing key to remove", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("test", "[key] [value] set test string, with optional value. set empty existing key to remove", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length < 2) |
| if (args.Length < 2) |
| { |
| { |
| Terminal.m_showTests = !Terminal.m_showTests; |
| Terminal.m_showTests = !Terminal.m_showTests; |
| return true; |
| return true; |
| } |
| } |
| . | string text26 = ((args.Length >= 3) ? args[2] : ""); |
| string text27 = ((args.Length >= 3) ? args[2] : ""); |
| if (Terminal.m_testList.ContainsKey(args[1]) && text26.Length == 0) |
| if (Terminal.m_testList.ContainsKey(args[1]) && text27.Length == 0) |
| { |
| { |
| Terminal.m_testList.Remove(args[1]); |
| Terminal.m_testList.Remove(args[1]); |
| Terminal context9 = args.Context; |
| Terminal context9 = args.Context; |
| if (context9 != null) |
| if (context9 != null) |
| { |
| { |
| context9.AddString("'" + args[1] + "' removed"); |
| context9.AddString("'" + args[1] + "' removed"); |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| . | Terminal.m_testList[args[1]] = text26; |
| Terminal.m_testList[args[1]] = text27; |
| Terminal context10 = args.Context; |
| Terminal context10 = args.Context; |
| if (context10 != null) |
| if (context10 != null) |
| { |
| { |
| context10.AddString(string.Concat(new string[] |
| context10.AddString(string.Concat(new string[] |
| { |
| { |
| "'", |
| "'", |
| args[1], |
| args[1], |
| "' added with value '", |
| "' added with value '", |
| . | text26, |
| text27, |
| "'" |
| "'" |
| })); |
| })); |
| } |
| } |
| } |
| } |
| . | string text27 = args[1].ToLower(); |
| string text28 = args[1].ToLower(); |
| if (!(text27 == "ngenemyac")) |
| if (!(text28 == "ngenemyac")) |
| { |
| { |
| . | if (!(text27 == "ngenemyhp")) |
| if (!(text28 == "ngenemyhp")) |
| { |
| { |
| . | if (!(text27 == "ngenemydamage")) |
| if (!(text28 == "ngenemydamage")) |
| { |
| { |
| . | if (!(text27 == "ngplayerac")) |
| if (!(text28 == "ngplayerac")) |
| { |
| { |
| . | if (text27 == "ngplayerdamage") |
| if (text28 == "ngplayerdamage") |
| { |
| { |
| Game.instance.m_worldLevelGearBaseDamage = int.Parse(args[2]); |
| Game.instance.m_worldLevelGearBaseDamage = int.Parse(args[2]); |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| Game.instance.m_worldLevelGearBaseAC = int.Parse(args[2]); |
| Game.instance.m_worldLevelGearBaseAC = int.Parse(args[2]); |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| Game.instance.m_worldLevelEnemyBaseDamage = int.Parse(args[2]); |
| Game.instance.m_worldLevelEnemyBaseDamage = int.Parse(args[2]); |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| Game.instance.m_worldLevelEnemyHPMultiplier = float.Parse(args[2]); |
| Game.instance.m_worldLevelEnemyHPMultiplier = float.Parse(args[2]); |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| Game.instance.m_worldLevelEnemyBaseAC = int.Parse(args[2]); |
| Game.instance.m_worldLevelEnemyBaseAC = int.Parse(args[2]); |
| } |
| } |
| return true; |
| return true; |
| }, true, false, false, true, false, null, false, false, false); |
| }, true, false, false, true, false, null, false, false, false); |
| new Terminal.ConsoleCommand("forcedelete", "[radius] [*name] force remove all objects within given radius. If name is entered, only deletes items with matching names. Caution! Use at your own risk. Make backups! Radius default: 5, max: 50.", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("forcedelete", "[radius] [*name] force remove all objects within given radius. If name is entered, only deletes items with matching names. Caution! Use at your own risk. Make backups! Radius default: 5, max: 50.", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Player.m_localPlayer == null) |
| if (Player.m_localPlayer == null) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | float num52 = Math.Min(50f, args.TryParameterFloat(1, 5f)); |
| float num60 = Math.Min(50f, args.TryParameterFloat(1, 5f)); |
| foreach (GameObject gameObject6 in UnityEngine.Object.FindObjectsOfType(typeof(GameObject))) |
| foreach (GameObject gameObject5 in UnityEngine.Object.FindObjectsOfType(typeof(GameObject))) |
| { |
| { |
| . | if (Vector3.Distance(gameObject6.transform.position, Player.m_localPlayer.transform.position) < num52) |
| if (Vector3.Distance(gameObject5.transform.position, Player.m_localPlayer.transform.position) < num60) |
| { |
| { |
| . | string path = gameObject6.gameObject.transform.GetPath(); |
| string path = gameObject5.gameObject.transform.GetPath(); |
| if (!(gameObject6.GetComponentInParent<Game>() != null) && !(gameObject6.GetComponentInParent<Player>() != null) && !(gameObject6.GetComponentInParent<Valkyrie>() != null) && !(gameObject6.GetComponentInParent<LocationProxy>() != null) && !(gameObject6.GetComponentInParent<Room>() != null) && !(gameObject6.GetComponentInParent<Vegvisir>() != null) && !(gameObject6.GetComponentInParent<DungeonGenerator>() != null) && !path.Contains("StartTemple") && !path.Contains("BossStone") && (args.Length <= 2 || gameObject6.name.ToLower().Contains(args[2].ToLower()))) |
| if (!(gameObject5.GetComponentInParent<Game>() != null) && !(gameObject5.GetComponentInParent<Player>() != null) && !(gameObject5.GetComponentInParent<Valkyrie>() != null) && !(gameObject5.GetComponentInParent<LocationProxy>() != null) && !(gameObject5.GetComponentInParent<Room>() != null) && !(gameObject5.GetComponentInParent<Vegvisir>() != null) && !(gameObject5.GetComponentInParent<DungeonGenerator>() != null) && !path.Contains("StartTemple") && !path.Contains("BossStone") && (args.Length <= 2 || gameObject5.name.ToLower().Contains(args[2].ToLower()))) |
| { |
| { |
| . | Destructible component8 = gameObject6.GetComponent<Destructible>(); |
| Destructible component10 = gameObject5.GetComponent<Destructible>(); |
| ZNetView component9 = gameObject6.GetComponent<ZNetView>(); |
| ZNetView component11 = gameObject5.GetComponent<ZNetView>(); |
| if (component8 != null) |
| if (component10 != null) |
| { |
| { |
| . | component8.DestroyNow(); |
| component10.DestroyNow(); |
| } |
| } |
| . | else if (component9 != null && ZNetScene.instance) |
| else if (component11 != null && ZNetScene.instance) |
| { |
| { |
| . | ZNetScene.instance.Destroy(gameObject6); |
| ZNetScene.instance.Destroy(gameObject5); |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| return true; |
| return true; |
| }, true, false, false, false, false, null, false, false, true); |
| }, true, false, false, false, false, null, false, false, true); |
| . | |
| new Terminal.ConsoleCommand("stopfire", "Puts out all spreading fires and smoke", delegate(Terminal.ConsoleEventArgs args) |
| |
| { |
| |
| if (Player.m_localPlayer == null) |
| |
| { |
| |
| return false; |
| |
| } |
| |
| Terminal.RemoveObj(UnityEngine.Object.FindObjectsOfType(typeof(Fire))); |
| |
| Terminal.RemoveObj(UnityEngine.Object.FindObjectsOfType(typeof(Smoke))); |
| |
| return true; |
| |
| }, true, false, false, false, false, null, false, false, true); |
| |
| new Terminal.ConsoleCommand("stopsmoke", "Puts out all spreading fires", delegate(Terminal.ConsoleEventArgs args) |
| |
| { |
| |
| if (Player.m_localPlayer == null) |
| |
| { |
| |
| return false; |
| |
| } |
| |
| foreach (Fire fire in UnityEngine.Object.FindObjectsOfType(typeof(Fire))) |
| |
| { |
| |
| Destructible component12 = fire.GetComponent<Destructible>(); |
| |
| ZNetView component13 = fire.GetComponent<ZNetView>(); |
| |
| if (component12 != null) |
| |
| { |
| |
| component12.DestroyNow(); |
| |
| } |
| |
| else if (component13 != null && ZNetScene.instance) |
| |
| { |
| |
| ZNetScene.instance.Destroy(fire.gameObject); |
| |
| } |
| |
| } |
| |
| return true; |
| |
| }, true, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("printseeds", "print seeds of loaded dungeons", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("printseeds", "print seeds of loaded dungeons", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Player.m_localPlayer == null) |
| if (Player.m_localPlayer == null) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Math.Min(20f, args.TryParameterFloat(1, 5f)); |
| Math.Min(20f, args.TryParameterFloat(1, 5f)); |
| . | UnityEngine.Object[] array12 = UnityEngine.Object.FindObjectsOfType(typeof(DungeonGenerator)); |
| UnityEngine.Object[] array15 = UnityEngine.Object.FindObjectsOfType(typeof(DungeonGenerator)); |
| args.Context.AddString(string.Format("{0} version {1}, world seed: {2}/{3}", new object[] |
| args.Context.AddString(string.Format("{0} version {1}, world seed: {2}/{3}", new object[] |
| { |
| { |
| (ZNet.instance && ZNet.instance.IsServer()) ? "Server" : "Client", |
| (ZNet.instance && ZNet.instance.IsServer()) ? "Server" : "Client", |
| global::Version.GetVersionString(false), |
| global::Version.GetVersionString(false), |
| ZNet.World.m_seed, |
| ZNet.World.m_seed, |
| ZNet.World.m_seedName |
| ZNet.World.m_seedName |
| })); |
| })); |
| . | foreach (DungeonGenerator dungeonGenerator in array12) |
| foreach (DungeonGenerator dungeonGenerator in array15) |
| { |
| { |
| args.Context.AddString(string.Format(" {0}: Seed: {1}/{2}, Distance: {3}", new object[] |
| args.Context.AddString(string.Format(" {0}: Seed: {1}/{2}, Distance: {3}", new object[] |
| { |
| { |
| dungeonGenerator.name, |
| dungeonGenerator.name, |
| dungeonGenerator.m_generatedSeed, |
| dungeonGenerator.m_generatedSeed, |
| dungeonGenerator.GetSeed(), |
| dungeonGenerator.GetSeed(), |
| Utils.DistanceXZ(Player.m_localPlayer.transform.position, dungeonGenerator.transform.position).ToString("0.0") |
| Utils.DistanceXZ(Player.m_localPlayer.transform.position, dungeonGenerator.transform.position).ToString("0.0") |
| })); |
| })); |
| } |
| } |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("nomap", "disables map for this character. If used as host, will disable for all joining players from now on.", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("nomap", "disables map for this character. If used as host, will disable for all joining players from now on.", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Player.m_localPlayer != null) |
| if (Player.m_localPlayer != null) |
| { |
| { |
| . | string text28 = "mapenabled_" + Player.m_localPlayer.GetPlayerName(); |
| string text29 = "mapenabled_" + Player.m_localPlayer.GetPlayerName(); |
| bool flag3 = PlayerPrefs.GetFloat(text28, 1f) == 1f; |
| bool flag3 = PlayerPrefs.GetFloat(text29, 1f) == 1f; |
| PlayerPrefs.SetFloat(text28, (float)(flag3 ? 0 : 1)); |
| PlayerPrefs.SetFloat(text29, (float)(flag3 ? 0 : 1)); |
| Minimap.instance.SetMapMode(Minimap.MapMode.None); |
| Minimap.instance.SetMapMode(Minimap.MapMode.None); |
| Terminal context11 = args.Context; |
| Terminal context11 = args.Context; |
| if (context11 != null) |
| if (context11 != null) |
| { |
| { |
| context11.AddString("Map " + (flag3 ? "disabled" : "enabled")); |
| context11.AddString("Map " + (flag3 ? "disabled" : "enabled")); |
| } |
| } |
| if (ZNet.instance && ZNet.instance.IsServer()) |
| if (ZNet.instance && ZNet.instance.IsServer()) |
| { |
| { |
| if (flag3) |
| if (flag3) |
| { |
| { |
| ZoneSystem.instance.SetGlobalKey(GlobalKeys.NoMap); |
| ZoneSystem.instance.SetGlobalKey(GlobalKeys.NoMap); |
| return; |
| return; |
| } |
| } |
| ZoneSystem.instance.RemoveGlobalKey(GlobalKeys.NoMap); |
| ZoneSystem.instance.RemoveGlobalKey(GlobalKeys.NoMap); |
| } |
| } |
| } |
| } |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("noportals", "disables portals for server.", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("noportals", "disables portals for server.", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (Player.m_localPlayer != null) |
| if (Player.m_localPlayer != null) |
| { |
| { |
| bool globalKey = ZoneSystem.instance.GetGlobalKey(GlobalKeys.NoPortals); |
| bool globalKey = ZoneSystem.instance.GetGlobalKey(GlobalKeys.NoPortals); |
| if (globalKey) |
| if (globalKey) |
| { |
| { |
| ZoneSystem.instance.RemoveGlobalKey(GlobalKeys.NoPortals); |
| ZoneSystem.instance.RemoveGlobalKey(GlobalKeys.NoPortals); |
| } |
| } |
| else |
| else |
| { |
| { |
| ZoneSystem.instance.SetGlobalKey(GlobalKeys.NoPortals); |
| ZoneSystem.instance.SetGlobalKey(GlobalKeys.NoPortals); |
| } |
| } |
| Terminal context12 = args.Context; |
| Terminal context12 = args.Context; |
| if (context12 == null) |
| if (context12 == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| context12.AddString("Portals " + (globalKey ? "enabled" : "disabled")); |
| context12.AddString("Portals " + (globalKey ? "enabled" : "disabled")); |
| } |
| } |
| }, false, false, false, false, false, null, false, false, true); |
| }, false, false, false, false, false, null, false, false, true); |
| new Terminal.ConsoleCommand("resetspawn", "resets spawn location", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetspawn", "resets spawn location", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (!Game.instance) |
| if (!Game.instance) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| PlayerProfile playerProfile3 = Game.instance.GetPlayerProfile(); |
| PlayerProfile playerProfile3 = Game.instance.GetPlayerProfile(); |
| if (playerProfile3 != null) |
| if (playerProfile3 != null) |
| { |
| { |
| playerProfile3.ClearCustomSpawnPoint(); |
| playerProfile3.ClearCustomSpawnPoint(); |
| } |
| } |
| Terminal context13 = args.Context; |
| Terminal context13 = args.Context; |
| if (context13 != null) |
| if (context13 != null) |
| { |
| { |
| context13.AddString("Reseting spawn point"); |
| context13.AddString("Reseting spawn point"); |
| } |
| } |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| . | |
| new Terminal.ConsoleCommand("respawntime", "sets respawntime", delegate(Terminal.ConsoleEventArgs args) |
| |
| { |
| |
| if (!Game.instance) |
| |
| { |
| |
| return false; |
| |
| } |
| |
| float num64; |
| |
| if (args.TryParameterFloat(1, out num64)) |
| |
| { |
| |
| Game.instance.m_respawnLoadDuration = (Game.instance.m_fadeTimeDeath = num64); |
| |
| } |
| |
| return true; |
| |
| }, true, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("die", "kill yourself", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("die", "kill yourself", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (!Player.m_localPlayer) |
| if (!Player.m_localPlayer) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| . | HitData hitData4 = new HitData(); |
| HitData hitData2 = new HitData(); |
| hitData4.m_damage.m_damage = 99999f; |
| hitData2.m_damage.m_damage = 99999f; |
| hitData4.m_hitType = HitData.HitType.Self; |
| hitData2.m_hitType = HitData.HitType.Self; |
| Player.m_localPlayer.Damage(hitData4); |
| Player.m_localPlayer.Damage(hitData2); |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("say", "chat message", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("say", "chat message", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.FullLine.Length < 5 || Chat.instance == null) |
| if (args.FullLine.Length < 5 || Chat.instance == null) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Chat.instance.SendText(Talker.Type.Normal, args.FullLine.Substring(4)); |
| Chat.instance.SendText(Talker.Type.Normal, args.FullLine.Substring(4)); |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("s", "shout message", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("s", "shout message", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.FullLine.Length < 3 || Chat.instance == null) |
| if (args.FullLine.Length < 3 || Chat.instance == null) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Chat.instance.SendText(Talker.Type.Shout, args.FullLine.Substring(2)); |
| Chat.instance.SendText(Talker.Type.Shout, args.FullLine.Substring(2)); |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("w", "[playername] whispers a private message to a player", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("w", "[playername] whispers a private message to a player", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.FullLine.Length < 3 || Chat.instance == null) |
| if (args.FullLine.Length < 3 || Chat.instance == null) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| Chat.instance.SendText(Talker.Type.Whisper, args.FullLine.Substring(2)); |
| Chat.instance.SendText(Talker.Type.Whisper, args.FullLine.Substring(2)); |
| return true; |
| return true; |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| new Terminal.ConsoleCommand("resetplayerprefs", "Resets any saved settings and variables (not the save game)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetplayerprefs", "Resets any saved settings and variables (not the save game)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| PlayerPrefs.DeleteAll(); |
| PlayerPrefs.DeleteAll(); |
| Terminal context14 = args.Context; |
| Terminal context14 = args.Context; |
| if (context14 == null) |
| if (context14 == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| context14.AddString("Reset saved player preferences"); |
| context14.AddString("Reset saved player preferences"); |
| }, false, false, false, true, true, null, false, false, false); |
| }, false, false, false, true, true, null, false, false, false); |
| for (int i = 0; i < 20; i++) |
| for (int i = 0; i < 20; i++) |
| { |
| { |
| Emotes emote = (Emotes)i; |
| Emotes emote = (Emotes)i; |
| new Terminal.ConsoleCommand(emote.ToString().ToLower(), string.Format("emote: {0}", emote), delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand(emote.ToString().ToLower(), string.Format("emote: {0}", emote), delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Emote.DoEmote(emote); |
| Emote.DoEmote(emote); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| } |
| } |
| new Terminal.ConsoleCommand("resetplayerprefs", "Resets any saved settings and variables (not the save game)", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("resetplayerprefs", "Resets any saved settings and variables (not the save game)", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| PlayerPrefs.DeleteAll(); |
| PlayerPrefs.DeleteAll(); |
| Terminal context15 = args.Context; |
| Terminal context15 = args.Context; |
| if (context15 == null) |
| if (context15 == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| context15.AddString("Reset saved player preferences"); |
| context15.AddString("Reset saved player preferences"); |
| }, false, false, false, true, true, null, false, false, false); |
| }, false, false, false, true, true, null, false, false, false); |
| } |
| } |
| |
| |
| . | |
| private static void RemoveObj(UnityEngine.Object[] objs) |
| |
| { |
| |
| foreach (MonoBehaviour monoBehaviour in objs) |
| |
| { |
| |
| Destructible component = monoBehaviour.GetComponent<Destructible>(); |
| |
| ZNetView component2 = monoBehaviour.GetComponent<ZNetView>(); |
| |
| if (component != null) |
| |
| { |
| |
| component.DestroyNow(); |
| |
| } |
| |
| else if (component2 != null && ZNetScene.instance) |
| |
| { |
| |
| ZNetScene.instance.Destroy(monoBehaviour.gameObject); |
| |
| } |
| |
| else |
| |
| { |
| |
| UnityEngine.Object.Destroy(monoBehaviour.gameObject); |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| private static void AddConsoleCheatCommands() |
| private static void AddConsoleCheatCommands() |
| { |
| { |
| new Terminal.ConsoleCommand("xb:version", "Prints mercurial hashset used for this build", delegate(Terminal.ConsoleEventArgs args) |
| new Terminal.ConsoleCommand("xb:version", "Prints mercurial hashset used for this build", delegate(Terminal.ConsoleEventArgs args) |
| { |
| { |
| Terminal context = args.Context; |
| Terminal context = args.Context; |
| if (context == null) |
| if (context == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| context.AddString("Buildhash: " + global::Version.GetVersionString(true)); |
| context.AddString("Buildhash: " + global::Version.GetVersionString(true)); |
| }, false, false, false, false, false, null, false, false, false); |
| }, false, false, false, false, false, null, false, false, false); |
| } |
| } |
| |
| |
| protected static void updateBinds() |
| protected static void updateBinds() |
| { |
| { |
| Terminal.m_binds.Clear(); |
| Terminal.m_binds.Clear(); |
| foreach (string text in Terminal.m_bindList) |
| foreach (string text in Terminal.m_bindList) |
| { |
| { |
| string[] array = text.Split(' ', StringSplitOptions.None); |
| string[] array = text.Split(' ', StringSplitOptions.None); |
| string text2 = string.Join(" ", array, 1, array.Length - 1); |
| string text2 = string.Join(" ", array, 1, array.Length - 1); |
| KeyCode keyCode; |
| KeyCode keyCode; |
| if (Enum.TryParse<KeyCode>(array[0], true, out keyCode)) |
| if (Enum.TryParse<KeyCode>(array[0], true, out keyCode)) |
| { |
| { |
| List<string> list; |
| List<string> list; |
| if (Terminal.m_binds.TryGetValue(keyCode, out list)) |
| if (Terminal.m_binds.TryGetValue(keyCode, out list)) |
| { |
| { |
| list.Add(text2); |
| list.Add(text2); |
| } |
| } |
| else |
| else |
| { |
| { |
| Terminal.m_binds[keyCode] = new List<string> { text2 }; |
| Terminal.m_binds[keyCode] = new List<string> { text2 }; |
| } |
| } |
| } |
| } |
| } |
| } |
| PlayerPrefs.SetString("ConsoleBindings", string.Join("\n", Terminal.m_bindList)); |
| PlayerPrefs.SetString("ConsoleBindings", string.Join("\n", Terminal.m_bindList)); |
| } |
| } |
| |
| |
| private void updateCommandList() |
| private void updateCommandList() |
| { |
| { |
| this.m_commandList.Clear(); |
| this.m_commandList.Clear(); |
| foreach (KeyValuePair<string, Terminal.ConsoleCommand> keyValuePair in Terminal.commands) |
| foreach (KeyValuePair<string, Terminal.ConsoleCommand> keyValuePair in Terminal.commands) |
| { |
| { |
| if (keyValuePair.Value.ShowCommand(this) && (this.m_autoCompleteSecrets || !keyValuePair.Value.IsSecret)) |
| if (keyValuePair.Value.ShowCommand(this) && (this.m_autoCompleteSecrets || !keyValuePair.Value.IsSecret)) |
| { |
| { |
| this.m_commandList.Add(keyValuePair.Key); |
| this.m_commandList.Add(keyValuePair.Key); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| public bool IsCheatsEnabled() |
| public bool IsCheatsEnabled() |
| { |
| { |
| return Terminal.m_cheat && ZNet.instance && ZNet.instance.IsServer(); |
| return Terminal.m_cheat && ZNet.instance && ZNet.instance.IsServer(); |
| } |
| } |
| |
| |
| public void TryRunCommand(string text, bool silentFail = false, bool skipAllowedCheck = false) |
| public void TryRunCommand(string text, bool silentFail = false, bool skipAllowedCheck = false) |
| { |
| { |
| string[] array = text.Split(' ', StringSplitOptions.None); |
| string[] array = text.Split(' ', StringSplitOptions.None); |
| Terminal.ConsoleCommand consoleCommand; |
| Terminal.ConsoleCommand consoleCommand; |
| if (Terminal.commands.TryGetValue(array[0].ToLower(), out consoleCommand)) |
| if (Terminal.commands.TryGetValue(array[0].ToLower(), out consoleCommand)) |
| { |
| { |
| if (consoleCommand.IsValid(this, skipAllowedCheck)) |
| if (consoleCommand.IsValid(this, skipAllowedCheck)) |
| { |
| { |
| consoleCommand.RunAction(new Terminal.ConsoleEventArgs(text, this)); |
| consoleCommand.RunAction(new Terminal.ConsoleEventArgs(text, this)); |
| return; |
| return; |
| } |
| } |
| if (consoleCommand.RemoteCommand && ZNet.instance && !ZNet.instance.IsServer()) |
| if (consoleCommand.RemoteCommand && ZNet.instance && !ZNet.instance.IsServer()) |
| { |
| { |
| ZNet.instance.RemoteCommand(text); |
| ZNet.instance.RemoteCommand(text); |
| return; |
| return; |
| } |
| } |
| if (!silentFail) |
| if (!silentFail) |
| { |
| { |
| this.AddString("'" + text.Split(' ', StringSplitOptions.None)[0] + "' is not valid in the current context."); |
| this.AddString("'" + text.Split(' ', StringSplitOptions.None)[0] + "' is not valid in the current context."); |
| return; |
| return; |
| } |
| } |
| } |
| } |
| else if (!silentFail) |
| else if (!silentFail) |
| { |
| { |
| this.AddString("'" + array[0] + "' is not a recognized command. Type 'help' to see a list of valid commands."); |
| this.AddString("'" + array[0] + "' is not a recognized command. Type 'help' to see a list of valid commands."); |
| } |
| } |
| } |
| } |
| |
| |
| public virtual void Awake() |
| public virtual void Awake() |
| { |
| { |
| Terminal.InitTerminal(); |
| Terminal.InitTerminal(); |
| } |
| } |
| |
| |
| public virtual void Update() |
| public virtual void Update() |
| { |
| { |
| if (this.m_focused) |
| if (this.m_focused) |
| { |
| { |
| this.UpdateInput(); |
| this.UpdateInput(); |
| } |
| } |
| } |
| } |
| |
| |
| private void UpdateInput() |
| private void UpdateInput() |
| { |
| { |
| if (ZInput.GetButton("JoyButtonX")) |
| if (ZInput.GetButton("JoyButtonX")) |
| { |
| { |
| if (ZInput.GetButtonDown("JoyDPadLeft")) |
| if (ZInput.GetButtonDown("JoyDPadLeft")) |
| { |
| { |
| this.m_quickSelect[0] = this.m_input.text; |
| this.m_quickSelect[0] = this.m_input.text; |
| PlatformPrefs.SetString("quick_save_left", this.m_quickSelect[0]); |
| PlatformPrefs.SetString("quick_save_left", this.m_quickSelect[0]); |
| PlayerPrefs.Save(); |
| PlayerPrefs.Save(); |
| } |
| } |
| if (ZInput.GetButtonDown("JoyDPadRight")) |
| if (ZInput.GetButtonDown("JoyDPadRight")) |
| { |
| { |
| this.m_quickSelect[1] = this.m_input.text; |
| this.m_quickSelect[1] = this.m_input.text; |
| PlatformPrefs.SetString("quick_save_right", this.m_quickSelect[1]); |
| PlatformPrefs.SetString("quick_save_right", this.m_quickSelect[1]); |
| PlayerPrefs.Save(); |
| PlayerPrefs.Save(); |
| } |
| } |
| if (ZInput.GetButtonDown("JoyDPadUp")) |
| if (ZInput.GetButtonDown("JoyDPadUp")) |
| { |
| { |
| this.m_quickSelect[2] = this.m_input.text; |
| this.m_quickSelect[2] = this.m_input.text; |
| PlatformPrefs.SetString("quick_save_up", this.m_quickSelect[2]); |
| PlatformPrefs.SetString("quick_save_up", this.m_quickSelect[2]); |
| PlayerPrefs.Save(); |
| PlayerPrefs.Save(); |
| } |
| } |
| if (ZInput.GetButtonDown("JoyDPadDown")) |
| if (ZInput.GetButtonDown("JoyDPadDown")) |
| { |
| { |
| this.m_quickSelect[3] = this.m_input.text; |
| this.m_quickSelect[3] = this.m_input.text; |
| PlatformPrefs.SetString("quick_save_down", this.m_quickSelect[3]); |
| PlatformPrefs.SetString("quick_save_down", this.m_quickSelect[3]); |
| PlayerPrefs.Save(); |
| PlayerPrefs.Save(); |
| } |
| } |
| } |
| } |
| else if (ZInput.GetButton("JoyButtonY")) |
| else if (ZInput.GetButton("JoyButtonY")) |
| { |
| { |
| if (ZInput.GetButtonDown("JoyDPadLeft")) |
| if (ZInput.GetButtonDown("JoyDPadLeft")) |
| { |
| { |
| this.m_input.text = this.m_quickSelect[0]; |
| this.m_input.text = this.m_quickSelect[0]; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| } |
| } |
| if (ZInput.GetButtonDown("JoyDPadRight")) |
| if (ZInput.GetButtonDown("JoyDPadRight")) |
| { |
| { |
| this.m_input.text = this.m_quickSelect[1]; |
| this.m_input.text = this.m_quickSelect[1]; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| } |
| } |
| if (ZInput.GetButtonDown("JoyDPadUp")) |
| if (ZInput.GetButtonDown("JoyDPadUp")) |
| { |
| { |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.text = this.m_quickSelect[2]; |
| this.m_input.text = this.m_quickSelect[2]; |
| } |
| } |
| if (ZInput.GetButtonDown("JoyDPadDown")) |
| if (ZInput.GetButtonDown("JoyDPadDown")) |
| { |
| { |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.text = this.m_quickSelect[3]; |
| this.m_input.text = this.m_quickSelect[3]; |
| } |
| } |
| } |
| } |
| else if ((ZInput.GetButtonDown("ChatUp") || ZInput.GetButtonDown("JoyDPadUp")) && !this.m_input.IsCompositionActive()) |
| else if ((ZInput.GetButtonDown("ChatUp") || ZInput.GetButtonDown("JoyDPadUp")) && !this.m_input.IsCompositionActive()) |
| { |
| { |
| if (this.m_historyPosition > 0) |
| if (this.m_historyPosition > 0) |
| { |
| { |
| this.m_historyPosition--; |
| this.m_historyPosition--; |
| } |
| } |
| this.m_input.text = ((this.m_history.Count > 0) ? this.m_history[this.m_historyPosition] : ""); |
| this.m_input.text = ((this.m_history.Count > 0) ? this.m_history[this.m_historyPosition] : ""); |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| } |
| } |
| else if ((ZInput.GetButtonDown("ChatDown") || ZInput.GetButtonDown("JoyDPadDown")) && !this.m_input.IsCompositionActive()) |
| else if ((ZInput.GetButtonDown("ChatDown") || ZInput.GetButtonDown("JoyDPadDown")) && !this.m_input.IsCompositionActive()) |
| { |
| { |
| if (this.m_historyPosition < this.m_history.Count) |
| if (this.m_historyPosition < this.m_history.Count) |
| { |
| { |
| this.m_historyPosition++; |
| this.m_historyPosition++; |
| } |
| } |
| this.m_input.text = ((this.m_historyPosition < this.m_history.Count) ? this.m_history[this.m_historyPosition] : ""); |
| this.m_input.text = ((this.m_historyPosition < this.m_history.Count) ? this.m_history[this.m_historyPosition] : ""); |
| this.m_input.caretPosition = this.m_input.text.Length; |
| this.m_input.caretPosition = this.m_input.text.Length; |
| } |
| } |
| else if (ZInput.GetKeyDown(KeyCode.Tab, true) || ZInput.GetButtonDown("JoyDPadRight")) |
| else if (ZInput.GetKeyDown(KeyCode.Tab, true) || ZInput.GetButtonDown("JoyDPadRight")) |
| { |
| { |
| if (this.m_commandList.Count == 0) |
| if (this.m_commandList.Count == 0) |
| { |
| { |
| this.updateCommandList(); |
| this.updateCommandList(); |
| } |
| } |
| string[] array = this.m_input.text.Split(' ', StringSplitOptions.None); |
| string[] array = this.m_input.text.Split(' ', StringSplitOptions.None); |
| if (array.Length == 1) |
| if (array.Length == 1) |
| { |
| { |
| this.tabCycle(array[0], this.m_commandList, true); |
| this.tabCycle(array[0], this.m_commandList, true); |
| } |
| } |
| else |
| else |
| { |
| { |
| string text = ((this.m_tabPrefix == '\0') ? array[0] : array[0].Substring(1)); |
| string text = ((this.m_tabPrefix == '\0') ? array[0] : array[0].Substring(1)); |
| Terminal.ConsoleCommand consoleCommand; |
| Terminal.ConsoleCommand consoleCommand; |
| if (Terminal.commands.TryGetValue(text, out consoleCommand)) |
| if (Terminal.commands.TryGetValue(text, out consoleCommand)) |
| { |
| { |
| this.tabCycle(array[1], consoleCommand.GetTabOptions(), false); |
| this.tabCycle(array[1], consoleCommand.GetTabOptions(), false); |
| } |
| } |
| } |
| } |
| } |
| } |
| if ((ZInput.GetButtonDown("ScrollChatUp") || ZInput.GetButtonDown("JoyScrollChatUp")) && this.m_scrollHeight < this.m_chatBuffer.Count - 5) |
| if ((ZInput.GetButtonDown("ScrollChatUp") || ZInput.GetButtonDown("JoyScrollChatUp")) && this.m_scrollHeight < this.m_chatBuffer.Count - 5) |
| { |
| { |
| this.m_scrollHeight++; |
| this.m_scrollHeight++; |
| this.UpdateChat(); |
| this.UpdateChat(); |
| } |
| } |
| if ((ZInput.GetButtonDown("ScrollChatDown") || ZInput.GetButtonDown("JoyScrollChatDown")) && this.m_scrollHeight > 0) |
| if ((ZInput.GetButtonDown("ScrollChatDown") || ZInput.GetButtonDown("JoyScrollChatDown")) && this.m_scrollHeight > 0) |
| { |
| { |
| this.m_scrollHeight--; |
| this.m_scrollHeight--; |
| this.UpdateChat(); |
| this.UpdateChat(); |
| } |
| } |
| if (this.m_input.caretPosition != this.m_tabCaretPositionEnd) |
| if (this.m_input.caretPosition != this.m_tabCaretPositionEnd) |
| { |
| { |
| this.m_tabCaretPosition = -1; |
| this.m_tabCaretPosition = -1; |
| } |
| } |
| if (this.m_lastSearchLength != this.m_input.text.Length) |
| if (this.m_lastSearchLength != this.m_input.text.Length) |
| { |
| { |
| this.m_lastSearchLength = this.m_input.text.Length; |
| this.m_lastSearchLength = this.m_input.text.Length; |
| if (this.m_commandList.Count == 0) |
| if (this.m_commandList.Count == 0) |
| { |
| { |
| this.updateCommandList(); |
| this.updateCommandList(); |
| } |
| } |
| string[] array2 = this.m_input.text.Split(' ', StringSplitOptions.None); |
| string[] array2 = this.m_input.text.Split(' ', StringSplitOptions.None); |
| if (array2.Length == 1) |
| if (array2.Length == 1) |
| { |
| { |
| this.updateSearch(array2[0], this.m_commandList, true); |
| this.updateSearch(array2[0], this.m_commandList, true); |
| return; |
| return; |
| } |
| } |
| string text2 = ((this.m_tabPrefix == '\0') ? array2[0] : ((array2[0].Length == 0) ? "" : array2[0].Substring(1))); |
| string text2 = ((this.m_tabPrefix == '\0') ? array2[0] : ((array2[0].Length == 0) ? "" : array2[0].Substring(1))); |
| Terminal.ConsoleCommand consoleCommand2; |
| Terminal.ConsoleCommand consoleCommand2; |
| if (Terminal.commands.TryGetValue(text2, out consoleCommand2)) |
| if (Terminal.commands.TryGetValue(text2, out consoleCommand2)) |
| { |
| { |
| this.updateSearch(array2[1], consoleCommand2.GetTabOptions(), false); |
| this.updateSearch(array2[1], consoleCommand2.GetTabOptions(), false); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| protected void SendInput() |
| protected void SendInput() |
| { |
| { |
| if (string.IsNullOrEmpty(this.m_input.text)) |
| if (string.IsNullOrEmpty(this.m_input.text)) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.InputText(); |
| this.InputText(); |
| if (this.m_history.Count == 0 || this.m_history[this.m_history.Count - 1] != this.m_input.text) |
| if (this.m_history.Count == 0 || this.m_history[this.m_history.Count - 1] != this.m_input.text) |
| { |
| { |
| this.m_history.Add(this.m_input.text); |
| this.m_history.Add(this.m_input.text); |
| } |
| } |
| this.m_historyPosition = this.m_history.Count; |
| this.m_historyPosition = this.m_history.Count; |
| this.m_input.text = ""; |
| this.m_input.text = ""; |
| this.m_scrollHeight = 0; |
| this.m_scrollHeight = 0; |
| this.UpdateChat(); |
| this.UpdateChat(); |
| if (!Application.isConsolePlatform && !Application.isMobilePlatform) |
| if (!Application.isConsolePlatform && !Application.isMobilePlatform) |
| { |
| { |
| this.m_input.ActivateInputField(); |
| this.m_input.ActivateInputField(); |
| } |
| } |
| } |
| } |
| |
| |
| protected virtual void InputText() |
| protected virtual void InputText() |
| { |
| { |
| string text = this.m_input.text; |
| string text = this.m_input.text; |
| this.AddString(text); |
| this.AddString(text); |
| this.TryRunCommand(text, false, false); |
| this.TryRunCommand(text, false, false); |
| } |
| } |
| |
| |
| protected virtual bool isAllowedCommand(Terminal.ConsoleCommand cmd) |
| protected virtual bool isAllowedCommand(Terminal.ConsoleCommand cmd) |
| { |
| { |
| return true; |
| return true; |
| } |
| } |
| |
| |
| public void AddString(string user, string text, Talker.Type type, bool timestamp = false) |
| public void AddString(string user, string text, Talker.Type type, bool timestamp = false) |
| { |
| { |
| Color color = Color.white; |
| Color color = Color.white; |
| if (type != Talker.Type.Whisper) |
| if (type != Talker.Type.Whisper) |
| { |
| { |
| if (type == Talker.Type.Shout) |
| if (type == Talker.Type.Shout) |
| { |
| { |
| color = Color.yellow; |
| color = Color.yellow; |
| text = text.ToUpper(); |
| text = text.ToUpper(); |
| } |
| } |
| else |
| else |
| { |
| { |
| color = Color.white; |
| color = Color.white; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| color = new Color(1f, 1f, 1f, 0.75f); |
| color = new Color(1f, 1f, 1f, 0.75f); |
| text = text.ToLowerInvariant(); |
| text = text.ToLowerInvariant(); |
| } |
| } |
| string text2 = (timestamp ? ("[" + DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss") + "] ") : ""); |
| string text2 = (timestamp ? ("[" + DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss") + "] ") : ""); |
| text2 = string.Concat(new string[] |
| text2 = string.Concat(new string[] |
| { |
| { |
| text2, |
| text2, |
| "<color=orange>", |
| "<color=orange>", |
| user, |
| user, |
| "</color>: <color=#", |
| "</color>: <color=#", |
| ColorUtility.ToHtmlStringRGBA(color), |
| ColorUtility.ToHtmlStringRGBA(color), |
| ">", |
| ">", |
| text, |
| text, |
| "</color>" |
| "</color>" |
| }); |
| }); |
| this.AddString(text2); |
| this.AddString(text2); |
| } |
| } |
| |
| |
| public void AddString(string text) |
| public void AddString(string text) |
| { |
| { |
| while (this.m_maxVisibleBufferLength > 1) |
| while (this.m_maxVisibleBufferLength > 1) |
| { |
| { |
| try |
| try |
| { |
| { |
| this.m_chatBuffer.Add(text); |
| this.m_chatBuffer.Add(text); |
| while (this.m_chatBuffer.Count > 300) |
| while (this.m_chatBuffer.Count > 300) |
| { |
| { |
| this.m_chatBuffer.RemoveAt(0); |
| this.m_chatBuffer.RemoveAt(0); |
| } |
| } |
| this.UpdateChat(); |
| this.UpdateChat(); |
| break; |
| break; |
| } |
| } |
| catch (Exception) |
| catch (Exception) |
| { |
| { |
| this.m_maxVisibleBufferLength--; |
| this.m_maxVisibleBufferLength--; |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| public void UpdateDisplayName(string oldName, string newName) |
| public void UpdateDisplayName(string oldName, string newName) |
| { |
| { |
| . | |
| if (string.IsNullOrEmpty(oldName)) |
| |
| { |
| |
| Debug.LogError(string.Concat(new string[] |
| |
| { |
| |
| "Failed to update display to \"", |
| |
| newName, |
| |
| "\"! oldName was ", |
| |
| (oldName == null) ? "null" : "empty", |
| |
| " " |
| |
| })); |
| |
| return; |
| |
| } |
| for (int i = 0; i < this.m_chatBuffer.Count; i++) |
| for (int i = 0; i < this.m_chatBuffer.Count; i++) |
| { |
| { |
| this.m_chatBuffer[i] = this.m_chatBuffer[i].Replace(oldName, newName); |
| this.m_chatBuffer[i] = this.m_chatBuffer[i].Replace(oldName, newName); |
| } |
| } |
| this.UpdateChat(); |
| this.UpdateChat(); |
| } |
| } |
| |
| |
| private void UpdateChat() |
| private void UpdateChat() |
| { |
| { |
| StringBuilder stringBuilder = new StringBuilder(); |
| StringBuilder stringBuilder = new StringBuilder(); |
| int num = Mathf.Min(this.m_chatBuffer.Count, Mathf.Max(5, this.m_chatBuffer.Count - this.m_scrollHeight)); |
| int num = Mathf.Min(this.m_chatBuffer.Count, Mathf.Max(5, this.m_chatBuffer.Count - this.m_scrollHeight)); |
| for (int i = Mathf.Max(0, num - this.m_maxVisibleBufferLength); i < num; i++) |
| for (int i = Mathf.Max(0, num - this.m_maxVisibleBufferLength); i < num; i++) |
| { |
| { |
| stringBuilder.Append(this.m_chatBuffer[i]); |
| stringBuilder.Append(this.m_chatBuffer[i]); |
| stringBuilder.Append("\n"); |
| stringBuilder.Append("\n"); |
| } |
| } |
| this.m_output.text = stringBuilder.ToString(); |
| this.m_output.text = stringBuilder.ToString(); |
| } |
| } |
| |
| |
| public static float GetTestValue(string key, float defaultIfMissing = 0f) |
| public static float GetTestValue(string key, float defaultIfMissing = 0f) |
| { |
| { |
| string text; |
| string text; |
| float num; |
| float num; |
| if (Terminal.m_testList.TryGetValue(key, out text) && float.TryParse(text, out num)) |
| if (Terminal.m_testList.TryGetValue(key, out text) && float.TryParse(text, out num)) |
| { |
| { |
| return num; |
| return num; |
| } |
| } |
| return defaultIfMissing; |
| return defaultIfMissing; |
| } |
| } |
| |
| |
| private void tabCycle(string word, List<string> options, bool usePrefix) |
| private void tabCycle(string word, List<string> options, bool usePrefix) |
| { |
| { |
| if (options == null || options.Count == 0) |
| if (options == null || options.Count == 0) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| usePrefix = usePrefix && this.m_tabPrefix > '\0'; |
| usePrefix = usePrefix && this.m_tabPrefix > '\0'; |
| if (usePrefix) |
| if (usePrefix) |
| { |
| { |
| if (word.Length < 1 || word[0] != this.m_tabPrefix) |
| if (word.Length < 1 || word[0] != this.m_tabPrefix) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| word = word.Substring(1); |
| word = word.Substring(1); |
| } |
| } |
| if (this.m_tabCaretPosition == -1) |
| if (this.m_tabCaretPosition == -1) |
| { |
| { |
| this.m_tabOptions.Clear(); |
| this.m_tabOptions.Clear(); |
| this.m_tabCaretPosition = this.m_input.caretPosition; |
| this.m_tabCaretPosition = this.m_input.caretPosition; |
| word = word.ToLower(); |
| word = word.ToLower(); |
| this.m_tabLength = word.Length; |
| this.m_tabLength = word.Length; |
| if (this.m_tabLength == 0) |
| if (this.m_tabLength == 0) |
| { |
| { |
| this.m_tabOptions.AddRange(options); |
| this.m_tabOptions.AddRange(options); |
| } |
| } |
| else |
| else |
| { |
| { |
| foreach (string text in options) |
| foreach (string text in options) |
| { |
| { |
| . | if (text.Length > this.m_tabLength && this.safeSubstring(text, 0, this.m_tabLength).ToLower() == word) |
| if (text != null && text.Length > this.m_tabLength && this.safeSubstring(text, 0, this.m_tabLength).ToLower() == word) |
| { |
| { |
| this.m_tabOptions.Add(text); |
| this.m_tabOptions.Add(text); |
| } |
| } |
| } |
| } |
| } |
| } |
| this.m_tabOptions.Sort(); |
| this.m_tabOptions.Sort(); |
| this.m_tabIndex = -1; |
| this.m_tabIndex = -1; |
| } |
| } |
| if (this.m_tabOptions.Count == 0) |
| if (this.m_tabOptions.Count == 0) |
| { |
| { |
| this.m_tabOptions.AddRange(this.m_lastSearch); |
| this.m_tabOptions.AddRange(this.m_lastSearch); |
| } |
| } |
| if (this.m_tabOptions.Count == 0) |
| if (this.m_tabOptions.Count == 0) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| int num = this.m_tabIndex + 1; |
| int num = this.m_tabIndex + 1; |
| this.m_tabIndex = num; |
| this.m_tabIndex = num; |
| if (num >= this.m_tabOptions.Count) |
| if (num >= this.m_tabOptions.Count) |
| { |
| { |
| this.m_tabIndex = 0; |
| this.m_tabIndex = 0; |
| } |
| } |
| if (this.m_tabCaretPosition - this.m_tabLength >= 0) |
| if (this.m_tabCaretPosition - this.m_tabLength >= 0) |
| { |
| { |
| this.m_input.text = this.safeSubstring(this.m_input.text, 0, this.m_tabCaretPosition - this.m_tabLength) + this.m_tabOptions[this.m_tabIndex]; |
| this.m_input.text = this.safeSubstring(this.m_input.text, 0, this.m_tabCaretPosition - this.m_tabLength) + this.m_tabOptions[this.m_tabIndex]; |
| } |
| } |
| this.m_tabCaretPositionEnd = (this.m_input.caretPosition = this.m_input.text.Length); |
| this.m_tabCaretPositionEnd = (this.m_input.caretPosition = this.m_input.text.Length); |
| } |
| } |
| |
| |
| private void updateSearch(string word, List<string> options, bool usePrefix) |
| private void updateSearch(string word, List<string> options, bool usePrefix) |
| { |
| { |
| if (this.m_search == null) |
| if (this.m_search == null) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.m_search.text = ""; |
| this.m_search.text = ""; |
| if (options == null || options.Count == 0) |
| if (options == null || options.Count == 0) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| usePrefix = usePrefix && this.m_tabPrefix > '\0'; |
| usePrefix = usePrefix && this.m_tabPrefix > '\0'; |
| if (usePrefix) |
| if (usePrefix) |
| { |
| { |
| if (word.Length < 1 || word[0] != this.m_tabPrefix) |
| if (word.Length < 1 || word[0] != this.m_tabPrefix) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| word = word.Substring(1); |
| word = word.Substring(1); |
| } |
| } |
| this.m_lastSearch.Clear(); |
| this.m_lastSearch.Clear(); |
| foreach (string text in options) |
| foreach (string text in options) |
| { |
| { |
| . | string text2 = text.ToLower(); |
| if (text != null) |
| if (text2.Contains(word.ToLower()) && (word.Contains("fx") || !text2.Contains("fx"))) |
| |
| { |
| { |
| . | this.m_lastSearch.Add(text); |
| string text2 = text.ToLower(); |
| |
| if (text2.Contains(word.ToLower()) && (word.Contains("fx") || !text2.Contains("fx"))) |
| |
| { |
| |
| this.m_lastSearch.Add(text); |
| |
| } |
| } |
| } |
| } |
| } |
| int num = 10; |
| int num = 10; |
| for (int i = 0; i < Math.Min(this.m_lastSearch.Count, num); i++) |
| for (int i = 0; i < Math.Min(this.m_lastSearch.Count, num); i++) |
| { |
| { |
| string text3 = this.m_lastSearch[i]; |
| string text3 = this.m_lastSearch[i]; |
| int num2 = text3.ToLower().IndexOf(word.ToLower()); |
| int num2 = text3.ToLower().IndexOf(word.ToLower()); |
| TMP_Text search = this.m_search; |
| TMP_Text search = this.m_search; |
| search.text += this.safeSubstring(text3, 0, num2); |
| search.text += this.safeSubstring(text3, 0, num2); |
| TMP_Text search2 = this.m_search; |
| TMP_Text search2 = this.m_search; |
| search2.text = search2.text + "<color=white>" + this.safeSubstring(text3, num2, word.Length) + "</color>"; |
| search2.text = search2.text + "<color=white>" + this.safeSubstring(text3, num2, word.Length) + "</color>"; |
| TMP_Text search3 = this.m_search; |
| TMP_Text search3 = this.m_search; |
| search3.text = search3.text + this.safeSubstring(text3, num2 + word.Length, -1) + " "; |
| search3.text = search3.text + this.safeSubstring(text3, num2 + word.Length, -1) + " "; |
| } |
| } |
| if (this.m_lastSearch.Count > num) |
| if (this.m_lastSearch.Count > num) |
| { |
| { |
| TMP_Text search4 = this.m_search; |
| TMP_Text search4 = this.m_search; |
| search4.text += string.Format("... {0} more.", this.m_lastSearch.Count - num); |
| search4.text += string.Format("... {0} more.", this.m_lastSearch.Count - num); |
| } |
| } |
| } |
| } |
| |
| |
| private string safeSubstring(string text, int start, int length = -1) |
| private string safeSubstring(string text, int start, int length = -1) |
| { |
| { |
| if (text.Length == 0) |
| if (text.Length == 0) |
| { |
| { |
| return text; |
| return text; |
| } |
| } |
| if (start < 0) |
| if (start < 0) |
| { |
| { |
| start = 0; |
| start = 0; |
| } |
| } |
| if (start + length >= text.Length) |
| if (start + length >= text.Length) |
| { |
| { |
| length = text.Length - start; |
| length = text.Length - start; |
| } |
| } |
| if (length >= 0) |
| if (length >= 0) |
| { |
| { |
| return text.Substring(start, length); |
| return text.Substring(start, length); |
| } |
| } |
| return text.Substring(start); |
| return text.Substring(start); |
| } |
| } |
| |
| |
| protected void LoadQuickSelect() |
| protected void LoadQuickSelect() |
| { |
| { |
| this.m_quickSelect[0] = PlatformPrefs.GetString("quick_save_left", ""); |
| this.m_quickSelect[0] = PlatformPrefs.GetString("quick_save_left", ""); |
| this.m_quickSelect[1] = PlatformPrefs.GetString("quick_save_right", ""); |
| this.m_quickSelect[1] = PlatformPrefs.GetString("quick_save_right", ""); |
| this.m_quickSelect[2] = PlatformPrefs.GetString("quick_save_up", ""); |
| this.m_quickSelect[2] = PlatformPrefs.GetString("quick_save_up", ""); |
| this.m_quickSelect[3] = PlatformPrefs.GetString("quick_save_down", ""); |
| this.m_quickSelect[3] = PlatformPrefs.GetString("quick_save_down", ""); |
| } |
| } |
| |
| |
| public static float TryTestFloat(string key, float defaultValue = 1f) |
| public static float TryTestFloat(string key, float defaultValue = 1f) |
| { |
| { |
| string text; |
| string text; |
| float num; |
| float num; |
| if (Terminal.m_testList.TryGetValue(key, out text) && float.TryParse(text, out num)) |
| if (Terminal.m_testList.TryGetValue(key, out text) && float.TryParse(text, out num)) |
| { |
| { |
| return num; |
| return num; |
| } |
| } |
| return defaultValue; |
| return defaultValue; |
| } |
| } |
| |
| |
| public static int TryTestInt(string key, int defaultValue = 1) |
| public static int TryTestInt(string key, int defaultValue = 1) |
| { |
| { |
| string text; |
| string text; |
| int num; |
| int num; |
| if (Terminal.m_testList.TryGetValue(key, out text) && int.TryParse(text, out num)) |
| if (Terminal.m_testList.TryGetValue(key, out text) && int.TryParse(text, out num)) |
| { |
| { |
| return num; |
| return num; |
| } |
| } |
| return defaultValue; |
| return defaultValue; |
| } |
| } |
| |
| |
| public static string TryTest(string key, string defaultValue = "") |
| public static string TryTest(string key, string defaultValue = "") |
| { |
| { |
| string text; |
| string text; |
| if (Terminal.m_testList.TryGetValue(key, out text)) |
| if (Terminal.m_testList.TryGetValue(key, out text)) |
| { |
| { |
| return text; |
| return text; |
| } |
| } |
| return defaultValue; |
| return defaultValue; |
| } |
| } |
| |
| |
| . | |
| public static int Increment(string key, int by = 1) |
| |
| { |
| |
| string text; |
| |
| if (Terminal.m_testList.TryGetValue(key, out text)) |
| |
| { |
| |
| Terminal.m_testList[key] = (int.Parse(text) + by).ToString(); |
| |
| } |
| |
| else |
| |
| { |
| |
| Terminal.m_testList[key] = by.ToString(); |
| |
| } |
| |
| return int.Parse(Terminal.m_testList[key]); |
| |
| } |
| |
| |
| public static void Log(object obj) |
| public static void Log(object obj) |
| { |
| { |
| if (Terminal.m_showTests) |
| if (Terminal.m_showTests) |
| { |
| { |
| ZLog.Log(obj); |
| ZLog.Log(obj); |
| if (global::Console.instance) |
| if (global::Console.instance) |
| { |
| { |
| global::Console.instance.AddString("Log", obj.ToString(), Talker.Type.Whisper, true); |
| global::Console.instance.AddString("Log", obj.ToString(), Talker.Type.Whisper, true); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| public static void LogWarning(object obj) |
| public static void LogWarning(object obj) |
| { |
| { |
| if (Terminal.m_showTests) |
| if (Terminal.m_showTests) |
| { |
| { |
| ZLog.LogWarning(obj); |
| ZLog.LogWarning(obj); |
| if (global::Console.instance) |
| if (global::Console.instance) |
| { |
| { |
| global::Console.instance.AddString("Warning", obj.ToString(), Talker.Type.Whisper, true); |
| global::Console.instance.AddString("Warning", obj.ToString(), Talker.Type.Whisper, true); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| public static void LogError(object obj) |
| public static void LogError(object obj) |
| { |
| { |
| if (Terminal.m_showTests) |
| if (Terminal.m_showTests) |
| { |
| { |
| ZLog.LogError(obj); |
| ZLog.LogError(obj); |
| if (global::Console.instance) |
| if (global::Console.instance) |
| { |
| { |
| global::Console.instance.AddString("Warning", obj.ToString(), Talker.Type.Whisper, true); |
| global::Console.instance.AddString("Warning", obj.ToString(), Talker.Type.Whisper, true); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| protected abstract Terminal m_terminalInstance { get; } |
| protected abstract Terminal m_terminalInstance { get; } |
| |
| |
| [CompilerGenerated] |
| [CompilerGenerated] |
| . | internal static void <InitTerminal>g__GetInfo|7_125(IEnumerable collection, ref Terminal.<>c__DisplayClass7_0 A_1) |
| internal static void <InitTerminal>g__GetInfo|7_133(IEnumerable collection, ref Terminal.<>c__DisplayClass7_0 A_1) |
| { |
| { |
| foreach (object obj in collection) |
| foreach (object obj in collection) |
| { |
| { |
| Character character = obj as Character; |
| Character character = obj as Character; |
| if (character != null) |
| if (character != null) |
| { |
| { |
| . | Terminal.<InitTerminal>g__count|7_126(character.m_name, character.GetLevel(), 1, ref A_1); |
| Terminal.<InitTerminal>g__count|7_134(character.m_name, character.GetLevel(), 1, ref A_1); |
| } |
| } |
| else if (obj is RandomFlyingBird) |
| else if (obj is RandomFlyingBird) |
| { |
| { |
| . | Terminal.<InitTerminal>g__count|7_126("Bird", 1, 1, ref A_1); |
| Terminal.<InitTerminal>g__count|7_134("Bird", 1, 1, ref A_1); |
| } |
| } |
| else |
| else |
| { |
| { |
| Fish fish = obj as Fish; |
| Fish fish = obj as Fish; |
| if (fish != null) |
| if (fish != null) |
| { |
| { |
| ItemDrop component = fish.GetComponent<ItemDrop>(); |
| ItemDrop component = fish.GetComponent<ItemDrop>(); |
| if (component != null) |
| if (component != null) |
| { |
| { |
| . | Terminal.<InitTerminal>g__count|7_126(component.m_itemData.m_shared.m_name, component.m_itemData.m_quality, component.m_itemData.m_stack, ref A_1); |
| Terminal.<InitTerminal>g__count|7_134(component.m_itemData.m_shared.m_name, component.m_itemData.m_quality, component.m_itemData.m_stack, ref A_1); |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| foreach (object obj2 in collection) |
| foreach (object obj2 in collection) |
| { |
| { |
| MonoBehaviour monoBehaviour = obj2 as MonoBehaviour; |
| MonoBehaviour monoBehaviour = obj2 as MonoBehaviour; |
| if (monoBehaviour != null) |
| if (monoBehaviour != null) |
| { |
| { |
| A_1.args.Context.AddString(string.Format(" {0}, Dist: {1}, Offset: {2}", monoBehaviour.name, Vector3.Distance(Player.m_localPlayer.transform.position, monoBehaviour.transform.position).ToString("0.0"), monoBehaviour.transform.position - Player.m_localPlayer.transform.position)); |
| A_1.args.Context.AddString(string.Format(" {0}, Dist: {1}, Offset: {2}", monoBehaviour.name, Vector3.Distance(Player.m_localPlayer.transform.position, monoBehaviour.transform.position).ToString("0.0"), monoBehaviour.transform.position - Player.m_localPlayer.transform.position)); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| [CompilerGenerated] |
| [CompilerGenerated] |
| . | internal static void <InitTerminal>g__count|7_126(string key, int level, int increment = 1, ref Terminal.<>c__DisplayClass7_0 A_3) |
| internal static void <InitTerminal>g__count|7_134(string key, int level, int increment = 1, ref Terminal.<>c__DisplayClass7_0 A_3) |
| { |
| { |
| Dictionary<int, int> dictionary; |
| Dictionary<int, int> dictionary; |
| if (!A_3.counts.TryGetValue(key, out dictionary)) |
| if (!A_3.counts.TryGetValue(key, out dictionary)) |
| { |
| { |
| dictionary = (A_3.counts[key] = new Dictionary<int, int>()); |
| dictionary = (A_3.counts[key] = new Dictionary<int, int>()); |
| } |
| } |
| int num; |
| int num; |
| if (dictionary.TryGetValue(level, out num)) |
| if (dictionary.TryGetValue(level, out num)) |
| { |
| { |
| dictionary[level] = num + increment; |
| dictionary[level] = num + increment; |
| return; |
| return; |
| } |
| } |
| dictionary[level] = increment; |
| dictionary[level] = increment; |
| } |
| } |
| |
| |
| [CompilerGenerated] |
| [CompilerGenerated] |
| . | internal static void <InitTerminal>g__add|7_127(string key, ref Terminal.<>c__DisplayClass7_1 A_1) |
| internal static void <InitTerminal>g__add|7_135(string key, ref Terminal.<>c__DisplayClass7_1 A_1) |
| { |
| { |
| int total = A_1.total; |
| int total = A_1.total; |
| A_1.total = total + 1; |
| A_1.total = total + 1; |
| int num; |
| int num; |
| if (A_1.counts.TryGetValue(key, out num)) |
| if (A_1.counts.TryGetValue(key, out num)) |
| { |
| { |
| A_1.counts[key] = num + 1; |
| A_1.counts[key] = num + 1; |
| return; |
| return; |
| } |
| } |
| A_1.counts[key] = 1; |
| A_1.counts[key] = 1; |
| } |
| } |
| |
| |
| [CompilerGenerated] |
| [CompilerGenerated] |
| . | internal static void <InitTerminal>g__spawn|7_129(string name, ref Terminal.<>c__DisplayClass7_2 A_1) |
| internal static List<string> <InitTerminal>g__findOpt|7_62() |
| |
| { |
| |
| if (!ZNetScene.instance) |
| |
| { |
| |
| return null; |
| |
| } |
| |
| List<string> list = new List<string>(ZNetScene.instance.GetPrefabNames()); |
| |
| foreach (ZoneSystem.ZoneLocation zoneLocation in ZoneSystem.instance.m_locations) |
| |
| { |
| |
| if (zoneLocation.m_enable || zoneLocation.m_prefab.IsValid) |
| |
| { |
| |
| list.Add(zoneLocation.m_prefab.Name); |
| |
| } |
| |
| } |
| |
| return list; |
| |
| } |
| |
| |
| |
| [CompilerGenerated] |
| |
| internal static List<Tuple<object, Vector3>> <InitTerminal>g__find|7_63(string q) |
| |
| { |
| |
| new Dictionary<string, Dictionary<int, int>>(); |
| |
| GameObject[] array = UnityEngine.Object.FindObjectsOfType<GameObject>(); |
| |
| List<Tuple<object, Vector3>> list = new List<Tuple<object, Vector3>>(); |
| |
| foreach (GameObject gameObject in array) |
| |
| { |
| |
| if (gameObject.name.ToLower().Contains(q)) |
| |
| { |
| |
| list.Add(new Tuple<object, Vector3>(gameObject, gameObject.transform.position)); |
| |
| } |
| |
| } |
| |
| foreach (ZoneSystem.LocationInstance locationInstance in ZoneSystem.instance.GetLocationList()) |
| |
| { |
| |
| if (locationInstance.m_location.m_prefab.Name.ToLower().Contains(q)) |
| |
| { |
| |
| list.Add(new Tuple<object, Vector3>(locationInstance, locationInstance.m_position)); |
| |
| } |
| |
| } |
| |
| List<ZDO> list2 = new List<ZDO>(); |
| |
| int num = 0; |
| |
| while (!ZDOMan.instance.GetAllZDOsWithPrefabIterative(q, list2, ref num)) |
| |
| { |
| |
| } |
| |
| foreach (ZDO zdo in list2) |
| |
| { |
| |
| list.Add(new Tuple<object, Vector3>(zdo, zdo.GetPosition())); |
| |
| } |
| |
| return list; |
| |
| } |
| |
| |
| |
| [CompilerGenerated] |
| |
| internal static void <InitTerminal>g__spawn|7_138(string name, ref Terminal.<>c__DisplayClass7_2 A_1) |
| { |
| { |
| GameObject prefab = ZNetScene.instance.GetPrefab(name); |
| GameObject prefab = ZNetScene.instance.GetPrefab(name); |
| if (!prefab) |
| if (!prefab) |
| { |
| { |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Missing object " + name, 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Missing object " + name, 0, null); |
| return; |
| return; |
| } |
| } |
| for (int i = 0; i < A_1.count; i++) |
| for (int i = 0; i < A_1.count; i++) |
| { |
| { |
| . | Vector3 vector = UnityEngine.Random.insideUnitSphere * ((A_1.count == 1) ? 0f : 0.5f); |
| Vector3 vector = UnityEngine.Random.insideUnitSphere * ((A_1.count == 1) ? 0f : A_1.radius); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Spawning object " + name, 0, null); |
| Player.m_localPlayer.Message(MessageHud.MessageType.TopLeft, "Spawning object " + name, 0, null); |
| GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(prefab, Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward * 2f + Vector3.up + vector, Quaternion.identity); |
| GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(prefab, Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward * 2f + Vector3.up + vector, Quaternion.identity); |
| if (A_1.vals != null) |
| if (A_1.vals != null) |
| { |
| { |
| ZNetView component = gameObject.GetComponent<ZNetView>(); |
| ZNetView component = gameObject.GetComponent<ZNetView>(); |
| if (component != null && component.IsValid()) |
| if (component != null && component.IsValid()) |
| { |
| { |
| component.GetZDO().Set("HasFields", true); |
| component.GetZDO().Set("HasFields", true); |
| foreach (KeyValuePair<string, object> keyValuePair in A_1.vals) |
| foreach (KeyValuePair<string, object> keyValuePair in A_1.vals) |
| { |
| { |
| string[] array = keyValuePair.Key.Split('.', StringSplitOptions.None); |
| string[] array = keyValuePair.Key.Split('.', StringSplitOptions.None); |
| if (array.Length >= 2) |
| if (array.Length >= 2) |
| { |
| { |
| ("HasFields" + array[0]).GetStableHashCode(); |
| ("HasFields" + array[0]).GetStableHashCode(); |
| component.GetZDO().Set("HasFields" + array[0], true); |
| component.GetZDO().Set("HasFields" + array[0], true); |
| keyValuePair.Value.GetType(); |
| keyValuePair.Value.GetType(); |
| if (keyValuePair.Value is float) |
| if (keyValuePair.Value is float) |
| { |
| { |
| component.GetZDO().Set(keyValuePair.Key, (float)keyValuePair.Value); |
| component.GetZDO().Set(keyValuePair.Key, (float)keyValuePair.Value); |
| } |
| } |
| else if (keyValuePair.Value is int) |
| else if (keyValuePair.Value is int) |
| { |
| { |
| component.GetZDO().Set(keyValuePair.Key, (int)keyValuePair.Value); |
| component.GetZDO().Set(keyValuePair.Key, (int)keyValuePair.Value); |
| } |
| } |
| else if (keyValuePair.Value is bool) |
| else if (keyValuePair.Value is bool) |
| { |
| { |
| component.GetZDO().Set(keyValuePair.Key, (bool)keyValuePair.Value); |
| component.GetZDO().Set(keyValuePair.Key, (bool)keyValuePair.Value); |
| } |
| } |
| else |
| else |
| { |
| { |
| component.GetZDO().Set(keyValuePair.Key, keyValuePair.Value.ToString()); |
| component.GetZDO().Set(keyValuePair.Key, keyValuePair.Value.ToString()); |
| } |
| } |
| } |
| } |
| } |
| } |
| component.LoadFields(); |
| component.LoadFields(); |
| } |
| } |
| } |
| } |
| ItemDrop component2 = gameObject.GetComponent<ItemDrop>(); |
| ItemDrop component2 = gameObject.GetComponent<ItemDrop>(); |
| ItemDrop.OnCreateNew(gameObject); |
| ItemDrop.OnCreateNew(gameObject); |
| if (A_1.level > 1) |
| if (A_1.level > 1) |
| { |
| { |
| if (component2) |
| if (component2) |
| { |
| { |
| A_1.level = Mathf.Min(A_1.level, 4); |
| A_1.level = Mathf.Min(A_1.level, 4); |
| } |
| } |
| else |
| else |
| { |
| { |
| A_1.level = Mathf.Min(A_1.level, 9); |
| A_1.level = Mathf.Min(A_1.level, 9); |
| } |
| } |
| Character component3 = gameObject.GetComponent<Character>(); |
| Character component3 = gameObject.GetComponent<Character>(); |
| if (component3 != null) |
| if (component3 != null) |
| { |
| { |
| component3.SetLevel(A_1.level); |
| component3.SetLevel(A_1.level); |
| } |
| } |
| if (A_1.level > 4) |
| if (A_1.level > 4) |
| { |
| { |
| A_1.level = 4; |
| A_1.level = 4; |
| } |
| } |
| if (component2) |
| if (component2) |
| { |
| { |
| component2.SetQuality(A_1.level); |
| component2.SetQuality(A_1.level); |
| } |
| } |
| } |
| } |
| if (A_1.pickup | A_1.use | A_1.onlyIfMissing) |
| if (A_1.pickup | A_1.use | A_1.onlyIfMissing) |
| { |
| { |
| if (A_1.onlyIfMissing && component2 && Player.m_localPlayer.GetInventory().HaveItem(component2.m_itemData.m_shared.m_name, true)) |
| if (A_1.onlyIfMissing && component2 && Player.m_localPlayer.GetInventory().HaveItem(component2.m_itemData.m_shared.m_name, true)) |
| { |
| { |
| ZNetView component4 = gameObject.GetComponent<ZNetView>(); |
| ZNetView component4 = gameObject.GetComponent<ZNetView>(); |
| if (component4 != null) |
| if (component4 != null) |
| { |
| { |
| component4.Destroy(); |
| component4.Destroy(); |
| . | goto IL_351; |
| goto IL_352; |
| } |
| } |
| } |
| } |
| if ((Player.m_localPlayer.Pickup(gameObject, false, false) & A_1.use) && component2) |
| if ((Player.m_localPlayer.Pickup(gameObject, false, false) & A_1.use) && component2) |
| { |
| { |
| Player.m_localPlayer.UseItem(Player.m_localPlayer.GetInventory(), component2.m_itemData, false); |
| Player.m_localPlayer.UseItem(Player.m_localPlayer.GetInventory(), component2.m_itemData, false); |
| } |
| } |
| } |
| } |
| . | IL_351:; |
| IL_352:; |
| } |
| } |
| } |
| } |
| |
| |
| private static bool m_terminalInitialized; |
| private static bool m_terminalInitialized; |
| |
| |
| protected static List<string> m_bindList; |
| protected static List<string> m_bindList; |
| |
| |
| public static Dictionary<string, string> m_testList = new Dictionary<string, string>(); |
| public static Dictionary<string, string> m_testList = new Dictionary<string, string>(); |
| |
| |
| protected static Dictionary<KeyCode, List<string>> m_binds = new Dictionary<KeyCode, List<string>>(); |
| protected static Dictionary<KeyCode, List<string>> m_binds = new Dictionary<KeyCode, List<string>>(); |
| |
| |
| private static bool m_cheat = false; |
| private static bool m_cheat = false; |
| |
| |
| public static bool m_showTests; |
| public static bool m_showTests; |
| |
| |
| protected float m_lastDebugUpdate; |
| protected float m_lastDebugUpdate; |
| |
| |
| protected static Dictionary<string, Terminal.ConsoleCommand> commands = new Dictionary<string, Terminal.ConsoleCommand>(); |
| protected static Dictionary<string, Terminal.ConsoleCommand> commands = new Dictionary<string, Terminal.ConsoleCommand>(); |
| |
| |
| public static ConcurrentQueue<string> m_threadSafeMessages = new ConcurrentQueue<string>(); |
| public static ConcurrentQueue<string> m_threadSafeMessages = new ConcurrentQueue<string>(); |
| |
| |
| public static ConcurrentQueue<string> m_threadSafeConsoleLog = new ConcurrentQueue<string>(); |
| public static ConcurrentQueue<string> m_threadSafeConsoleLog = new ConcurrentQueue<string>(); |
| |
| |
| protected char m_tabPrefix; |
| protected char m_tabPrefix; |
| |
| |
| protected bool m_autoCompleteSecrets; |
| protected bool m_autoCompleteSecrets; |
| |
| |
| private List<string> m_history = new List<string>(); |
| private List<string> m_history = new List<string>(); |
| |
| |
| protected string[] m_quickSelect = new string[4]; |
| protected string[] m_quickSelect = new string[4]; |
| |
| |
| private List<string> m_tabOptions = new List<string>(); |
| private List<string> m_tabOptions = new List<string>(); |
| |
| |
| private int m_historyPosition; |
| private int m_historyPosition; |
| |
| |
| private int m_tabCaretPosition = -1; |
| private int m_tabCaretPosition = -1; |
| |
| |
| private int m_tabCaretPositionEnd; |
| private int m_tabCaretPositionEnd; |
| |
| |
| private int m_tabLength; |
| private int m_tabLength; |
| |
| |
| private int m_tabIndex; |
| private int m_tabIndex; |
| |
| |
| private List<string> m_commandList = new List<string>(); |
| private List<string> m_commandList = new List<string>(); |
| |
| |
| private List<Minimap.PinData> m_findPins = new List<Minimap.PinData>(); |
| private List<Minimap.PinData> m_findPins = new List<Minimap.PinData>(); |
| |
| |
| protected bool m_focused; |
| protected bool m_focused; |
| |
| |
| public RectTransform m_chatWindow; |
| public RectTransform m_chatWindow; |
| |
| |
| public TextMeshProUGUI m_output; |
| public TextMeshProUGUI m_output; |
| |
| |
| public GuiInputField m_input; |
| public GuiInputField m_input; |
| |
| |
| public TMP_Text m_search; |
| public TMP_Text m_search; |
| |
| |
| private int m_lastSearchLength; |
| private int m_lastSearchLength; |
| |
| |
| private List<string> m_lastSearch = new List<string>(); |
| private List<string> m_lastSearch = new List<string>(); |
| |
| |
| protected List<string> m_chatBuffer = new List<string>(); |
| protected List<string> m_chatBuffer = new List<string>(); |
| |
| |
| protected const int m_maxBufferLength = 300; |
| protected const int m_maxBufferLength = 300; |
| |
| |
| public int m_maxVisibleBufferLength = 30; |
| public int m_maxVisibleBufferLength = 30; |
| |
| |
| private const int m_maxScrollHeight = 5; |
| private const int m_maxScrollHeight = 5; |
| |
| |
| private int m_scrollHeight; |
| private int m_scrollHeight; |
| |
| |
| public class ConsoleEventArgs |
| public class ConsoleEventArgs |
| { |
| { |
| public int Length |
| public int Length |
| { |
| { |
| get |
| get |
| { |
| { |
| return this.Args.Length; |
| return this.Args.Length; |
| } |
| } |
| } |
| } |
| |
| |
| public string this[int i] |
| public string this[int i] |
| { |
| { |
| get |
| get |
| { |
| { |
| return this.Args[i]; |
| return this.Args[i]; |
| } |
| } |
| } |
| } |
| |
| |
| public ConsoleEventArgs(string line, Terminal context) |
| public ConsoleEventArgs(string line, Terminal context) |
| { |
| { |
| this.Context = context; |
| this.Context = context; |
| this.FullLine = line; |
| this.FullLine = line; |
| . | |
| int num = line.IndexOf(' '); |
| |
| this.ArgsAll = ((num > 0) ? line.Substring(num + 1) : ""); |
| this.Args = line.Split(' ', StringSplitOptions.None); |
| this.Args = line.Split(' ', StringSplitOptions.None); |
| } |
| } |
| |
| |
| public int TryParameterInt(int parameterIndex, int defaultValue = 1) |
| public int TryParameterInt(int parameterIndex, int defaultValue = 1) |
| { |
| { |
| int num; |
| int num; |
| if (this.TryParameterInt(parameterIndex, out num)) |
| if (this.TryParameterInt(parameterIndex, out num)) |
| { |
| { |
| return num; |
| return num; |
| } |
| } |
| return defaultValue; |
| return defaultValue; |
| } |
| } |
| |
| |
| public bool TryParameterInt(int parameterIndex, out int value) |
| public bool TryParameterInt(int parameterIndex, out int value) |
| { |
| { |
| if (this.Args.Length <= parameterIndex || !int.TryParse(this.Args[parameterIndex], out value)) |
| if (this.Args.Length <= parameterIndex || !int.TryParse(this.Args[parameterIndex], out value)) |
| { |
| { |
| value = 0; |
| value = 0; |
| return false; |
| return false; |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| |
| |
| public bool TryParameterLong(int parameterIndex, out long value) |
| public bool TryParameterLong(int parameterIndex, out long value) |
| { |
| { |
| if (this.Args.Length <= parameterIndex || !long.TryParse(this.Args[parameterIndex], out value)) |
| if (this.Args.Length <= parameterIndex || !long.TryParse(this.Args[parameterIndex], out value)) |
| { |
| { |
| value = 0L; |
| value = 0L; |
| return false; |
| return false; |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| |
| |
| public float TryParameterFloat(int parameterIndex, float defaultValue = 1f) |
| public float TryParameterFloat(int parameterIndex, float defaultValue = 1f) |
| { |
| { |
| float num; |
| float num; |
| if (this.TryParameterFloat(parameterIndex, out num)) |
| if (this.TryParameterFloat(parameterIndex, out num)) |
| { |
| { |
| return num; |
| return num; |
| } |
| } |
| return defaultValue; |
| return defaultValue; |
| } |
| } |
| |
| |
| public bool TryParameterFloat(int parameterIndex, out float value) |
| public bool TryParameterFloat(int parameterIndex, out float value) |
| { |
| { |
| if (this.Args.Length <= parameterIndex || !float.TryParse(this.Args[parameterIndex].Replace(",", "."), NumberStyles.Float, CultureInfo.InvariantCulture, out value)) |
| if (this.Args.Length <= parameterIndex || !float.TryParse(this.Args[parameterIndex].Replace(",", "."), NumberStyles.Float, CultureInfo.InvariantCulture, out value)) |
| { |
| { |
| value = 0f; |
| value = 0f; |
| return false; |
| return false; |
| } |
| } |
| return true; |
| return true; |
| } |
| } |
| |
| |
| public bool HasArgumentAnywhere(string value, int firstIndexToCheck = 0, bool toLower = true) |
| public bool HasArgumentAnywhere(string value, int firstIndexToCheck = 0, bool toLower = true) |
| { |
| { |
| for (int i = firstIndexToCheck; i < this.Args.Length; i++) |
| for (int i = firstIndexToCheck; i < this.Args.Length; i++) |
| { |
| { |
| if ((toLower && this.Args[i].ToLower() == value) || (!toLower && this.Args[i] == value)) |
| if ((toLower && this.Args[i].ToLower() == value) || (!toLower && this.Args[i] == value)) |
| { |
| { |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| return false; |
| return false; |
| } |
| } |
| |
| |
| public string[] Args; |
| public string[] Args; |
| |
| |
| . | |
| public string ArgsAll; |
| |
| |
| public string FullLine; |
| public string FullLine; |
| |
| |
| public Terminal Context; |
| public Terminal Context; |
| } |
| } |
| |
| |
| public class ConsoleCommand |
| public class ConsoleCommand |
| { |
| { |
| public ConsoleCommand(string command, string description, Terminal.ConsoleEventFailable action, bool isCheat = false, bool isNetwork = false, bool onlyServer = false, bool isSecret = false, bool allowInDevBuild = false, Terminal.ConsoleOptionsFetcher optionsFetcher = null, bool alwaysRefreshTabOptions = false, bool remoteCommand = false, bool onlyAdmin = false) |
| public ConsoleCommand(string command, string description, Terminal.ConsoleEventFailable action, bool isCheat = false, bool isNetwork = false, bool onlyServer = false, bool isSecret = false, bool allowInDevBuild = false, Terminal.ConsoleOptionsFetcher optionsFetcher = null, bool alwaysRefreshTabOptions = false, bool remoteCommand = false, bool onlyAdmin = false) |
| { |
| { |
| Terminal.commands[command.ToLower()] = this; |
| Terminal.commands[command.ToLower()] = this; |
| this.Command = command; |
| this.Command = command; |
| this.Description = description; |
| this.Description = description; |
| this.actionFailable = action; |
| this.actionFailable = action; |
| this.IsCheat = isCheat; |
| this.IsCheat = isCheat; |
| this.OnlyServer = onlyServer || onlyAdmin; |
| this.OnlyServer = onlyServer || onlyAdmin; |
| this.IsSecret = isSecret; |
| this.IsSecret = isSecret; |
| this.IsNetwork = isNetwork; |
| this.IsNetwork = isNetwork; |
| this.AllowInDevBuild = allowInDevBuild; |
| this.AllowInDevBuild = allowInDevBuild; |
| this.m_tabOptionsFetcher = optionsFetcher; |
| this.m_tabOptionsFetcher = optionsFetcher; |
| this.m_alwaysRefreshTabOptions = alwaysRefreshTabOptions; |
| this.m_alwaysRefreshTabOptions = alwaysRefreshTabOptions; |
| this.RemoteCommand = remoteCommand; |
| this.RemoteCommand = remoteCommand; |
| this.OnlyAdmin = onlyAdmin; |
| this.OnlyAdmin = onlyAdmin; |
| } |
| } |
| |
| |
| public ConsoleCommand(string command, string description, Terminal.ConsoleEvent action, bool isCheat = false, bool isNetwork = false, bool onlyServer = false, bool isSecret = false, bool allowInDevBuild = false, Terminal.ConsoleOptionsFetcher optionsFetcher = null, bool alwaysRefreshTabOptions = false, bool remoteCommand = false, bool onlyAdmin = false) |
| public ConsoleCommand(string command, string description, Terminal.ConsoleEvent action, bool isCheat = false, bool isNetwork = false, bool onlyServer = false, bool isSecret = false, bool allowInDevBuild = false, Terminal.ConsoleOptionsFetcher optionsFetcher = null, bool alwaysRefreshTabOptions = false, bool remoteCommand = false, bool onlyAdmin = false) |
| { |
| { |
| Terminal.commands[command.ToLower()] = this; |
| Terminal.commands[command.ToLower()] = this; |
| this.Command = command; |
| this.Command = command; |
| this.Description = description; |
| this.Description = description; |
| this.action = action; |
| this.action = action; |
| this.IsCheat = isCheat; |
| this.IsCheat = isCheat; |
| this.OnlyServer = onlyServer; |
| this.OnlyServer = onlyServer; |
| this.IsSecret = isSecret; |
| this.IsSecret = isSecret; |
| this.IsNetwork = isNetwork; |
| this.IsNetwork = isNetwork; |
| this.AllowInDevBuild = allowInDevBuild; |
| this.AllowInDevBuild = allowInDevBuild; |
| this.m_tabOptionsFetcher = optionsFetcher; |
| this.m_tabOptionsFetcher = optionsFetcher; |
| this.m_alwaysRefreshTabOptions = alwaysRefreshTabOptions; |
| this.m_alwaysRefreshTabOptions = alwaysRefreshTabOptions; |
| this.RemoteCommand = remoteCommand; |
| this.RemoteCommand = remoteCommand; |
| this.OnlyAdmin = onlyAdmin; |
| this.OnlyAdmin = onlyAdmin; |
| } |
| } |
| |
| |
| public List<string> GetTabOptions() |
| public List<string> GetTabOptions() |
| { |
| { |
| if (this.m_tabOptionsFetcher != null && (this.m_tabOptions == null || this.m_alwaysRefreshTabOptions)) |
| if (this.m_tabOptionsFetcher != null && (this.m_tabOptions == null || this.m_alwaysRefreshTabOptions)) |
| { |
| { |
| this.m_tabOptions = this.m_tabOptionsFetcher(); |
| this.m_tabOptions = this.m_tabOptionsFetcher(); |
| } |
| } |
| return this.m_tabOptions; |
| return this.m_tabOptions; |
| } |
| } |
| |
| |
| public void RunAction(Terminal.ConsoleEventArgs args) |
| public void RunAction(Terminal.ConsoleEventArgs args) |
| { |
| { |
| if (args.Length >= 2) |
| if (args.Length >= 2) |
| { |
| { |
| List<string> tabOptions = this.GetTabOptions(); |
| List<string> tabOptions = this.GetTabOptions(); |
| if (tabOptions != null) |
| if (tabOptions != null) |
| { |
| { |
| foreach (string text in tabOptions) |
| foreach (string text in tabOptions) |
| { |
| { |
| . | if (args[1].ToLower() == text.ToLower()) |
| if (text != null && args[1].ToLower() == text.ToLower()) |
| { |
| { |
| args.Args[1] = text; |
| args.Args[1] = text; |
| break; |
| break; |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| if (this.action != null) |
| if (this.action != null) |
| { |
| { |
| this.action(args); |
| this.action(args); |
| } |
| } |
| else |
| else |
| { |
| { |
| object obj = this.actionFailable(args); |
| object obj = this.actionFailable(args); |
| if (obj is bool && !(bool)obj) |
| if (obj is bool && !(bool)obj) |
| { |
| { |
| args.Context.AddString(string.Concat(new string[] { "<color=#8b0000>Error executing command. Check parameters and context.</color>\n <color=#888888>", this.Command, " - ", this.Description, "</color>" })); |
| args.Context.AddString(string.Concat(new string[] { "<color=#8b0000>Error executing command. Check parameters and context.</color>\n <color=#888888>", this.Command, " - ", this.Description, "</color>" })); |
| } |
| } |
| string text2 = obj as string; |
| string text2 = obj as string; |
| if (text2 != null) |
| if (text2 != null) |
| { |
| { |
| args.Context.AddString(string.Concat(new string[] { "<color=#8b0000>Error executing command: ", text2, "</color>\n <color=#888888>", this.Command, " - ", this.Description, "</color>" })); |
| args.Context.AddString(string.Concat(new string[] { "<color=#8b0000>Error executing command: ", text2, "</color>\n <color=#888888>", this.Command, " - ", this.Description, "</color>" })); |
| } |
| } |
| } |
| } |
| if (Game.instance) |
| if (Game.instance) |
| { |
| { |
| PlayerProfile playerProfile = Game.instance.GetPlayerProfile(); |
| PlayerProfile playerProfile = Game.instance.GetPlayerProfile(); |
| if (this.IsCheat) |
| if (this.IsCheat) |
| { |
| { |
| playerProfile.m_usedCheats = true; |
| playerProfile.m_usedCheats = true; |
| playerProfile.IncrementStat(PlayerStatType.Cheats, 1f); |
| playerProfile.IncrementStat(PlayerStatType.Cheats, 1f); |
| } |
| } |
| playerProfile.m_knownCommands.IncrementOrSet(args[0].ToLower(), 1f); |
| playerProfile.m_knownCommands.IncrementOrSet(args[0].ToLower(), 1f); |
| } |
| } |
| } |
| } |
| |
| |
| public bool ShowCommand(Terminal context) |
| public bool ShowCommand(Terminal context) |
| { |
| { |
| return !this.IsSecret && (this.IsValid(context, false) || (ZNet.instance && !ZNet.instance.IsServer() && this.RemoteCommand)); |
| return !this.IsSecret && (this.IsValid(context, false) || (ZNet.instance && !ZNet.instance.IsServer() && this.RemoteCommand)); |
| } |
| } |
| |
| |
| public bool IsValid(Terminal context, bool skipAllowedCheck = false) |
| public bool IsValid(Terminal context, bool skipAllowedCheck = false) |
| { |
| { |
| return (!this.IsCheat || context.IsCheatsEnabled()) && (context.isAllowedCommand(this) || skipAllowedCheck) && (!this.IsNetwork || ZNet.instance) && (!this.OnlyServer || (ZNet.instance && ZNet.instance.IsServer())); |
| return (!this.IsCheat || context.IsCheatsEnabled()) && (context.isAllowedCommand(this) || skipAllowedCheck) && (!this.IsNetwork || ZNet.instance) && (!this.OnlyServer || (ZNet.instance && ZNet.instance.IsServer())); |
| } |
| } |
| |
| |
| public string Command; |
| public string Command; |
| |
| |
| public string Description; |
| public string Description; |
| |
| |
| public bool IsCheat; |
| public bool IsCheat; |
| |
| |
| public bool IsNetwork; |
| public bool IsNetwork; |
| |
| |
| public bool OnlyServer; |
| public bool OnlyServer; |
| |
| |
| public bool IsSecret; |
| public bool IsSecret; |
| |
| |
| public bool AllowInDevBuild; |
| public bool AllowInDevBuild; |
| |
| |
| public bool RemoteCommand; |
| public bool RemoteCommand; |
| |
| |
| public bool OnlyAdmin; |
| public bool OnlyAdmin; |
| |
| |
| private Terminal.ConsoleEventFailable actionFailable; |
| private Terminal.ConsoleEventFailable actionFailable; |
| |
| |
| private Terminal.ConsoleEvent action; |
| private Terminal.ConsoleEvent action; |
| |
| |
| private Terminal.ConsoleOptionsFetcher m_tabOptionsFetcher; |
| private Terminal.ConsoleOptionsFetcher m_tabOptionsFetcher; |
| |
| |
| private List<string> m_tabOptions; |
| private List<string> m_tabOptions; |
| |
| |
| private bool m_alwaysRefreshTabOptions; |
| private bool m_alwaysRefreshTabOptions; |
| } |
| } |
| |
| |
| public delegate object ConsoleEventFailable(Terminal.ConsoleEventArgs args); |
| public delegate object ConsoleEventFailable(Terminal.ConsoleEventArgs args); |
| |
| |
| public delegate void ConsoleEvent(Terminal.ConsoleEventArgs args); |
| public delegate void ConsoleEvent(Terminal.ConsoleEventArgs args); |
| |
| |
| public delegate List<string> ConsoleOptionsFetcher(); |
| public delegate List<string> ConsoleOptionsFetcher(); |
| } |
| } |
| |
| |