From 6e401c1d924ad26a225beaa0e4d2d1d333856894 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 18:27:51 -0500 Subject: [PATCH 01/27] Modify MultiAdmin names + Update ServerMod - Fixed all names using "SPC" in MultiAdmin, it should now use "SCP" - Reminder: This change uses "scp_multiadmin.cfg" now instead of "spc_multiadmin.cfg" - Removed misspelled AlphaWarheadDetonationController - Changed "GameConsole.cs" to "Console.cs" - Updated "Console.cs" --- README.md | 2 +- mutliadmin/MultiAdmin/Program.cs | 2 +- mutliadmin/MultiAdmin/Server.cs | 2 +- server_mod/AlphaWarheadDetonationControll.cs | 264 ------------------ .../{GameConsole.cs => Console.cs} | 168 +++++------ 5 files changed, 77 insertions(+), 361 deletions(-) delete mode 100644 server_mod/AlphaWarheadDetonationControll.cs rename server_mod/GameConsole/{GameConsole.cs => Console.cs} (86%) diff --git a/README.md b/README.md index 6bc0034..6b4917e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ The latest release can be found here: [Release link](https://github.com/Grover-c 3. For each instance with a unique config, create a new directory in the servers directory and place each config.txt in there, so for example for two unique configs: * servers/FirstServer/config.txt * servers/SecondServer/config.txt -4. If your config is not in its default location due to a different OS and such, make a new file next to MultiAdmin.exe called spc_multiadmin.cfg and place the follwing setting like so: +4. If your config is not in its default location due to a different OS and such, make a new file next to MultiAdmin.exe called scp_multiadmin.cfg and place the follwing setting like so: - cfg_loc=%appdata%\SCP Secret Laboratory\config.txt ## MultiAdmin Commands diff --git a/mutliadmin/MultiAdmin/Program.cs b/mutliadmin/MultiAdmin/Program.cs index 18d117a..33886cb 100644 --- a/mutliadmin/MultiAdmin/Program.cs +++ b/mutliadmin/MultiAdmin/Program.cs @@ -151,7 +151,7 @@ public static void Main(string[] args) { Write("ARGS:" + string.Join(",", args)); AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnExit); - multiadminConfig = new MultiAdmin.Config("spc_multiadmin.cfg"); + multiadminConfig = new MultiAdmin.Config("scp_multiadmin.cfg"); FindConfig(); configChain = ""; if (StartHandleConfigs(args)) diff --git a/mutliadmin/MultiAdmin/Server.cs b/mutliadmin/MultiAdmin/Server.cs index 809c9bd..8a84912 100644 --- a/mutliadmin/MultiAdmin/Server.cs +++ b/mutliadmin/MultiAdmin/Server.cs @@ -244,7 +244,7 @@ public Boolean StartServer() string[] files = Directory.GetFiles(Directory.GetCurrentDirectory(), "SCPSL.*", SearchOption.TopDirectoryOnly); Write("Executing: " + files[0], ConsoleColor.DarkGreen); SwapConfigs(); - string args = "-batchmode -nographics -key" + session_id + " -silent-crashes -id" + (object)Process.GetCurrentProcess().Id + " -logFile \"" + logFolder + Utils.GetDate() + "_SPC_output_log.txt" + "\""; + string args = "-batchmode -nographics -key" + session_id + " -silent-crashes -id" + (object)Process.GetCurrentProcess().Id + " -logFile \"" + logFolder + Utils.GetDate() + "_SCP_output_log.txt" + "\""; Write("Starting server with the following parameters"); Write(files[0] + " " + args); gameProcess = Process.Start(files[0], args); diff --git a/server_mod/AlphaWarheadDetonationControll.cs b/server_mod/AlphaWarheadDetonationControll.cs deleted file mode 100644 index 8aee402..0000000 --- a/server_mod/AlphaWarheadDetonationControll.cs +++ /dev/null @@ -1,264 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.Networking; - -public class AlphaWarheadDetonationController : NetworkBehaviour -{ - public void StartDetonation() - { - float elapsed = Time.time - this.smCharacterClassManager.smRoundStartTime; - if (this.detonationInProgress || !this.lever.GetState() || elapsed < (float)this.smNukeActivationMinTime) - { - return; - } - this.detonationInProgress = true; - this.NetworkdetonationTime = 90f; - this.doorsOpen = false; - this.smStartTime = Time.time; - } - - public void CancelDetonation() - { - float elapsed = Time.time - this.smStartTime; - if (this.detonationInProgress && this.detonationTime > 2f && elapsed >= (float)this.smCooldown) - { - this.detonationInProgress = false; - this.NetworkdetonationTime = 0f; - } - } - - private void FixedUpdate() - { - if (base.isLocalPlayer && this.awdc != null && this.lightStatus != (this.awdc.detonationTime != 0f)) - { - this.lightStatus = (this.awdc.detonationTime != 0f); - this.SetLights(this.lightStatus); - } - if (base.name == "Host") - { - if (this.detonationTime > 0f) - { - this.NetworkdetonationTime = this.detonationTime - Time.deltaTime; - if (!this.lever.GetState()) - { - this.CancelDetonation(); - } - if (this.detonationTime < 83f && !this.doorsOpen && base.isLocalPlayer) - { - this.doorsOpen = true; - this.CmdOpenDoors(); - } - if (this.detonationTime < 2f && !this.blastDoors && this.detonationInProgress && base.isLocalPlayer) - { - this.blastDoors = true; - this.CmdCloseBlastDoors(); - } - } - else - { - if (this.detonationTime < 0f) - { - base.GetComponent().summary.warheadDetonated = true; - this.Explode(); - } - this.NetworkdetonationTime = 0f; - } - } - if (base.isLocalPlayer && base.isServer) - { - this.TransmitData(this.detonationTime); - } - if (this.awsc == null || this.awdc == null) - { - this.awsc = UnityEngine.Object.FindObjectOfType(); - if (this.host == null) - { - this.host = GameObject.Find("Host"); - } - if (this.host != null) - { - this.awdc = this.host.GetComponent(); - return; - } - } - else - { - this.awsc.UpdateSound(90f - this.awdc.detonationTime, this.detonated); - } - } - - private void Explode() - { - this.detonated = true; - this.ExplodePlayers(); - } - - [ServerCallback] - private void CmdOpenDoors() - { - if (!NetworkServer.active) - { - return; - } - foreach (Door door in UnityEngine.Object.FindObjectsOfType()) - { - if (door.isOpen) - { - door.GetComponent().SetState(true); - } - } - } - - [ServerCallback] - private void ExplodePlayers() - { - if (!NetworkServer.active) - { - return; - } - GameObject[] players = PlayerManager.singleton.players; - for (int i = 0; i < players.Length; i++) - { - players[i].GetComponent().Explode(); - } - } - - [ServerCallback] - private void CmdCloseBlastDoors() - { - if (!NetworkServer.active) - { - return; - } - BlastDoor[] array = UnityEngine.Object.FindObjectsOfType(); - for (int i = 0; i < array.Length; i++) - { - array[i].SetClosed(true); - } - } - - [ClientCallback] - private void TransmitData(float t) - { - if (!NetworkClient.active) - { - return; - } - this.CmdSyncData(t); - } - - [ServerCallback] - private void CmdSyncData(float t) - { - if (!NetworkServer.active) - { - return; - } - this.NetworkdetonationTime = t; - } - - private void Start() - { - this.smCharacterClassManager = base.GetComponent(); - this.smCooldown = ConfigFile.GetInt("nuke_disable_cooldown", 0); - this.smNukeActivationMinTime = ConfigFile.GetInt("nuke_min_time", 0); - if (!TutorialManager.status) - { - this.lever = GameObject.Find("Lever_Alpha_Controller").GetComponent(); - this.lights = UnityEngine.Object.FindObjectsOfType(); - } - } - - private void SetLights(bool b) - { - ToggleableLight[] array = this.lights; - for (int i = 0; i < array.Length; i++) - { - array[i].SetLights(b); - } - } - - private void UNetVersion() - { - } - - public float NetworkdetonationTime - { - get - { - return this.detonationTime; - } - set - { - base.SetSyncVar(value, ref this.detonationTime, 1u); - } - } - - public override bool OnSerialize(NetworkWriter writer, bool forceAll) - { - if (forceAll) - { - writer.Write(this.detonationTime); - return true; - } - bool flag = false; - if ((base.syncVarDirtyBits & 1u) != 0u) - { - if (!flag) - { - writer.WritePackedUInt32(base.syncVarDirtyBits); - flag = true; - } - writer.Write(this.detonationTime); - } - if (!flag) - { - writer.WritePackedUInt32(base.syncVarDirtyBits); - } - return flag; - } - - public override void OnDeserialize(NetworkReader reader, bool initialState) - { - if (initialState) - { - this.detonationTime = reader.ReadSingle(); - return; - } - if ((reader.ReadPackedUInt32() & 1u) != 0u) - { - this.detonationTime = reader.ReadSingle(); - } - } - - [SyncVar] - public float detonationTime; - - private bool detonationInProgress; - - private bool detonated; - - private bool doorsOpen; - - private bool blastDoors; - - private GameObject host; - - private bool lightStatus; - - private AWSoundController awsc; - - private LeverButton lever; - - private AlphaWarheadDetonationController awdc; - - private ToggleableLight[] lights; - - private float smStartTime; - - private int smCooldown; - - private int smNukeActivationMinTime; - - private CharacterClassManager smCharacterClassManager; -} diff --git a/server_mod/GameConsole/GameConsole.cs b/server_mod/GameConsole/Console.cs similarity index 86% rename from server_mod/GameConsole/GameConsole.cs rename to server_mod/GameConsole/Console.cs index 58f52f0..f769dd6 100644 --- a/server_mod/GameConsole/GameConsole.cs +++ b/server_mod/GameConsole/Console.cs @@ -9,21 +9,16 @@ namespace GameConsole { - // Token: 0x02000016 RID: 22 + // Token: 0x0200001D RID: 29 public class Console : MonoBehaviour { - // Token: 0x06000063 RID: 99 - public Console() - { - } - - // Token: 0x06000064 RID: 100 + // Token: 0x06000092 RID: 146 RVA: 0x0000255F File Offset: 0x0000075F public List GetAllLogs() { return this.logs; } - // Token: 0x06000065 RID: 101 + // Token: 0x06000093 RID: 147 RVA: 0x0000B20C File Offset: 0x0000940C public void UpdateValue(string key, string value) { bool flag = false; @@ -42,8 +37,8 @@ public void UpdateValue(string key, string value) } } - // Token: 0x06000066 RID: 102 - public void Awake() + // Token: 0x06000094 RID: 148 RVA: 0x00002567 File Offset: 0x00000767 + private void Awake() { UnityEngine.Object.DontDestroyOnLoad(base.gameObject); if (Console.singleton == null) @@ -54,17 +49,16 @@ public void Awake() UnityEngine.Object.DestroyImmediate(base.gameObject); } - // Token: 0x06000067 RID: 103 - public void Start() + // Token: 0x06000095 RID: 149 RVA: 0x0000B290 File Offset: 0x00009490 + private void Start() { this.AddLog("Hi there! Initializing console...", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); this.AddLog("Done! Type 'help' to print the list of available commands.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - Debug.logger.logEnabled = true; this.RefreshConsoleScreen(); } - // Token: 0x06000068 RID: 104 - public void RefreshConsoleScreen() + // Token: 0x06000096 RID: 150 RVA: 0x0000B2E0 File Offset: 0x000094E0 + private void RefreshConsoleScreen() { bool flag = false; if (this.txt.text.Length > 15000) @@ -113,7 +107,7 @@ public void RefreshConsoleScreen() } } - // Token: 0x06000069 RID: 105 + // Token: 0x06000097 RID: 151 RVA: 0x0000B4AC File Offset: 0x000096AC public void AddLog(string text, Color32 c, bool nospace = false) { this.response = this.response + text + Environment.NewLine; @@ -126,14 +120,14 @@ public void AddLog(string text, Color32 c, bool nospace = false) this.RefreshConsoleScreen(); } - // Token: 0x0600006A RID: 106 - public string ColorToHex(Color32 color) + // Token: 0x06000098 RID: 152 RVA: 0x0000B50C File Offset: 0x0000970C + private string ColorToHex(Color32 color) { string str = color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2"); return "#" + str; } - // Token: 0x0600006B RID: 107 + // Token: 0x06000099 RID: 153 RVA: 0x0000B560 File Offset: 0x00009760 public static GameObject FindConnectedRoot(NetworkConnection conn) { try @@ -148,11 +142,12 @@ public static GameObject FindConnectedRoot(NetworkConnection conn) } catch { + return null; } return null; } - // Token: 0x0600006C RID: 108 + // Token: 0x0600009A RID: 154 RVA: 0x0000B5E4 File Offset: 0x000097E4 public string TypeCommand(string cmd) { try @@ -246,18 +241,18 @@ public string TypeCommand(string cmd) return this.response; } Item[] availableItems = component2.availableItems; - for (int i = 10 * (num2 - 1); i < 10 * num2; i++) + for (int j = 10 * (num2 - 1); j < 10 * num2; j++) { if (10 * (num2 - 1) > availableItems.Length) { this.AddLog("Page '" + num2 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); break; } - if (i >= availableItems.Length) + if (j >= availableItems.Length) { break; } - this.AddLog("ITEM#" + i.ToString("000") + " : " + availableItems[i].label, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog("ITEM#" + j.ToString("000") + " : " + availableItems[j].label, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); } } } @@ -289,7 +284,7 @@ public string TypeCommand(string cmd) { if (commandHint.name == b) { - this.AddLog(commandHint.name + " - " + commandHint.fullDesc + "LOGTYPE02", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog(commandHint.name + " - " + commandHint.fullDesc, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); this.RefreshConsoleScreen(); return this.response; } @@ -298,10 +293,10 @@ public string TypeCommand(string cmd) this.RefreshConsoleScreen(); return this.response; } - this.AddLog("List of available commands:LOGTYPE02", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog("List of available commands:\n", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); foreach (Console.CommandHint commandHint2 in this.hints) { - this.AddLog(commandHint2.name + " - " + commandHint2.shortDesc + "LOGTYPE02", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), true); + this.AddLog(commandHint2.name + " - " + commandHint2.shortDesc, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), true); } this.AddLog("Type 'HELP [COMMAND]' to print a full description of the chosen command.", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); this.RefreshConsoleScreen(); @@ -357,15 +352,15 @@ public string TypeCommand(string cmd) } else if (cmd == "SHOWRIDS") { - GameObject[] array2 = GameObject.FindGameObjectsWithTag("RoomID"); - foreach (GameObject gameObject4 in array2) + GameObject[] array4 = GameObject.FindGameObjectsWithTag("RoomID"); + foreach (GameObject gameObject4 in array4) { gameObject4.GetComponentsInChildren()[0].enabled = !gameObject4.GetComponentsInChildren()[0].enabled; gameObject4.GetComponentsInChildren()[1].enabled = !gameObject4.GetComponentsInChildren()[1].enabled; } - if (array2.Length != 0) + if (array4.Length != 0) { - this.AddLog("Show RIDS: " + array2[0].GetComponentInChildren().enabled.ToString(), new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + this.AddLog("Show RIDS: " + array4[0].GetComponentInChildren().enabled.ToString(), new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); } else { @@ -397,27 +392,18 @@ public string TypeCommand(string cmd) return this.response; } Class[] klasy = component3.klasy; - for (int j = 10 * (num4 - 1); j <= 10 * num4; j++) + for (int k = 10 * (num4 - 1); k < 10 * num4; k++) { if (10 * (num4 - 1) > klasy.Length) { this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); break; } - if (j >= klasy.Length) + if (k >= klasy.Length) { break; } - this.AddLog(string.Concat(new object[] - { - "CLASS#", - j.ToString("000"), - " : ", - klasy[j].fullName, - " (Max HP: ", - klasy[j].maxHP, - ")" - }), new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog("CLASS#" + k.ToString("000") + " : " + klasy[k].fullName, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); } } } @@ -509,10 +495,10 @@ public string TypeCommand(string cmd) else if (cmd == "ROUNDRESTART") { bool flag2 = false; - GameObject[] array3 = GameObject.FindGameObjectsWithTag("Player"); - for (int k = 0; k < array3.Length; k++) + GameObject[] array2 = GameObject.FindGameObjectsWithTag("Player"); + for (int i = 0; i < array2.Length; i++) { - PlayerStats component5 = array3[k].GetComponent(); + PlayerStats component5 = array2[i].GetComponent(); if (component5.isLocalPlayer && component5.isServer) { flag2 = true; @@ -560,7 +546,6 @@ public string TypeCommand(string cmd) } else if (ConfigFile.singleton.ReloadConfig()) { - ((CustomNetworkManager)NetworkManager.singleton).UpdateMotd(0); this.AddLog("Configuration file successfully reloaded. New settings will be applied on your server in next round.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); } else @@ -598,7 +583,7 @@ public string TypeCommand(string cmd) this.AddLog("Player :: " + text3 + " :: " + networkConnection.address, new Color32(128, 160, 128, byte.MaxValue), true); } } - goto IL_1386; + goto IL_1332; } } int duration = 0; @@ -645,11 +630,11 @@ public string TypeCommand(string cmd) { this.AddLog("Command " + cmd + " does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } - IL_1386: + IL_1332: return this.response; } - // Token: 0x0600006D RID: 109 + // Token: 0x0600009B RID: 155 RVA: 0x0000C960 File Offset: 0x0000AB60 public void ProceedButton() { if (this.cmdField.text != string.Empty) @@ -660,8 +645,8 @@ public void ProceedButton() EventSystem.current.SetSelectedGameObject(this.cmdField.gameObject); } - // Token: 0x0600006E RID: 110 - public void LateUpdate() + // Token: 0x0600009C RID: 156 RVA: 0x0000C9BC File Offset: 0x0000ABBC + private void LateUpdate() { if (Input.GetKeyDown(KeyCode.Return)) { @@ -705,7 +690,7 @@ public void LateUpdate() } } - // Token: 0x0600006F RID: 111 + // Token: 0x0600009D RID: 157 RVA: 0x0000CAEC File Offset: 0x0000ACEC public void ToggleConsole() { CursorManager.consoleOpen = !this.console.activeSelf; @@ -731,13 +716,13 @@ public void ToggleConsole() } } - // Token: 0x06000070 RID: 112 - public void QuitGame() + // Token: 0x0600009E RID: 158 RVA: 0x00002593 File Offset: 0x00000793 + private void QuitGame() { Application.Quit(); } - // Token: 0x06000071 RID: 113 + // Token: 0x0600009F RID: 159 RVA: 0x0000CBB0 File Offset: 0x0000ADB0 public void DumpGameObjStats() { GameObject[] array = UnityEngine.Object.FindObjectsOfType(); @@ -762,7 +747,7 @@ public void DumpGameObjStats() ServerConsole.AddLog("Scene dumped to " + text); } - // Token: 0x06000072 RID: 114 + // Token: 0x060000A0 RID: 160 RVA: 0x0000CCD4 File Offset: 0x0000AED4 public void GetStats(string parent, Component obj, Dictionary dictionary) { string key = parent + "_" + obj.GetType().Name; @@ -771,7 +756,7 @@ public void GetStats(string parent, Component obj, Dictionary dicti dictionary.Add(parent + obj.tag, num++); } - // Token: 0x06000073 RID: 115 + // Token: 0x060000A1 RID: 161 RVA: 0x0000CD1C File Offset: 0x0000AF1C public void GetStats(string parent, GameObject obj, Dictionary dictionary, HashSet done) { if (done.Contains(obj.GetInstanceID())) @@ -792,85 +777,80 @@ public void GetStats(string parent, GameObject obj, Dictionary dict } } - // Token: 0x04000069 RID: 105 - public bool allwaysRefreshing; + // Token: 0x0400009F RID: 159 + private bool allwaysRefreshing; - // Token: 0x0400006A RID: 106 - public List logs = new List(); + // Token: 0x040000A0 RID: 160 + private List logs = new List(); - // Token: 0x0400006B RID: 107 - public List values = new List(); + // Token: 0x040000A1 RID: 161 + private List values = new List(); - // Token: 0x0400006C RID: 108 + // Token: 0x040000A2 RID: 162 public Console.CommandHint[] hints; - // Token: 0x0400006D RID: 109 + // Token: 0x040000A3 RID: 163 public Text txt; - // Token: 0x0400006E RID: 110 + // Token: 0x040000A4 RID: 164 public InputField cmdField; - // Token: 0x0400006F RID: 111 + // Token: 0x040000A5 RID: 165 public GameObject console; - // Token: 0x04000070 RID: 112 + // Token: 0x040000A6 RID: 166 public static Console singleton; - // Token: 0x04000071 RID: 113 - public int scrollup; + // Token: 0x040000A7 RID: 167 + private int scrollup; - // Token: 0x04000072 RID: 114 - public int previous_scrlup; + // Token: 0x040000A8 RID: 168 + private int previous_scrlup; - // Token: 0x04000073 RID: 115 - public string loadedLevel; + // Token: 0x040000A9 RID: 169 + private string loadedLevel; - // Token: 0x04000074 RID: 116 - public string response = string.Empty; + // Token: 0x040000AA RID: 170 + private string response = string.Empty; - // Token: 0x02000017 RID: 23 + // Token: 0x0200001E RID: 30 [Serializable] public class CommandHint { - // Token: 0x06000074 RID: 116 - public CommandHint() - { - } - - // Token: 0x04000075 RID: 117 + // Token: 0x040000AB RID: 171 public string name; - // Token: 0x04000076 RID: 118 + // Token: 0x040000AC RID: 172 public string shortDesc; - // Token: 0x04000077 RID: 119 + // Token: 0x040000AD RID: 173 [Multiline] public string fullDesc; } - // Token: 0x02000018 RID: 24 + // Token: 0x0200001F RID: 31 [Serializable] public class Value { - // Token: 0x06000075 RID: 117 + // Token: 0x060000A3 RID: 163 RVA: 0x0000259A File Offset: 0x0000079A public Value(string k, string v) { this.key = k; this.value = v; } - // Token: 0x04000078 RID: 120 + // Token: 0x040000AE RID: 174 public string key; - // Token: 0x04000079 RID: 121 + // Token: 0x040000AF RID: 175 public string value; } - // Token: 0x02000019 RID: 25 + // Token: 0x02000020 RID: 32 [Serializable] public class Log { - // Token: 0x06000076 RID: 118 + // Token: 0x060000A4 RID: 164 RVA: 0x000025B0 File Offset: 0x000007B0 public Log(string t, Color32 c, bool b) { this.text = t; @@ -878,13 +858,13 @@ public Log(string t, Color32 c, bool b) this.nospace = b; } - // Token: 0x0400007A RID: 122 + // Token: 0x040000B0 RID: 176 public string text; - // Token: 0x0400007B RID: 123 + // Token: 0x040000B1 RID: 177 public Color32 color; - // Token: 0x0400007C RID: 124 + // Token: 0x040000B2 RID: 178 public bool nospace; } } From 25bb02f6b30e6d44d269130640fe9d7bb0282aae Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 18:30:00 -0500 Subject: [PATCH 02/27] Added useful info for "CharacterClassManager.cs" --- server_mod/CharacterClassManager Class List.png | Bin 0 -> 22141 bytes .../CharacterClassManager Get Class List.txt | 15 +++++++++++++++ server_mod/CharacterClassManager Max HP.txt | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 server_mod/CharacterClassManager Class List.png create mode 100644 server_mod/CharacterClassManager Get Class List.txt create mode 100644 server_mod/CharacterClassManager Max HP.txt diff --git a/server_mod/CharacterClassManager Class List.png b/server_mod/CharacterClassManager Class List.png new file mode 100644 index 0000000000000000000000000000000000000000..b9c290402d531cef2cf468472bbc1156fb84b443 GIT binary patch literal 22141 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 p3L^0z&TIc?qyMe|hJWS%>KE Date: Sat, 17 Feb 2018 18:44:44 -0500 Subject: [PATCH 03/27] Updated ServerMod - Added ServerMod 1.4 changes - Fully updated to the latest version of SCP: SL --- .../AlphaWarheadDetonationController.cs | 63 +++-- server_mod/CharacterClassManager.cs | 144 ++++++++++- server_mod/CustomNetworkManager.cs | 148 +++++------ server_mod/DisableUselessComponents.cs | 4 - ...nitialization.cs => RadioInitializator.cs} | 0 server_mod/ResolutionManager.cs | 12 +- server_mod/RoundSummary.cs | 234 +++++++----------- server_mod/ServerConsole.cs | 37 +-- 8 files changed, 370 insertions(+), 272 deletions(-) rename server_mod/{RadioInitialization.cs => RadioInitializator.cs} (100%) diff --git a/server_mod/AlphaWarheadDetonationController.cs b/server_mod/AlphaWarheadDetonationController.cs index 8787988..afde734 100644 --- a/server_mod/AlphaWarheadDetonationController.cs +++ b/server_mod/AlphaWarheadDetonationController.cs @@ -2,31 +2,32 @@ using UnityEngine; using UnityEngine.Networking; +// Token: 0x0200006D RID: 109 public class AlphaWarheadDetonationController : NetworkBehaviour { + // Token: 0x060001F8 RID: 504 RVA: 0x0000323E File Offset: 0x0000143E public void StartDetonation() { - float elapsed = Time.time - this.smCharacterClassManager.smRoundStartTime; - if (this.detonationInProgress || !this.lever.GetState() || elapsed < (float)this.smNukeActivationMinTime) + if (this.detonationInProgress || !this.lever.GetState()) { return; } this.detonationInProgress = true; this.NetworkdetonationTime = 90f; this.doorsOpen = false; - this.smStartTime = Time.time; } + // Token: 0x060001F9 RID: 505 RVA: 0x0000326F File Offset: 0x0000146F public void CancelDetonation() { - float elapsed = Time.time - this.smStartTime; - if (this.detonationInProgress && this.detonationTime > 2f && elapsed >= (float)this.smCooldown) + if (this.detonationInProgress && this.detonationTime > 2f) { this.detonationInProgress = false; this.NetworkdetonationTime = 0f; } } + // Token: 0x060001FA RID: 506 RVA: 0x00011D20 File Offset: 0x0000FF20 private void FixedUpdate() { if (base.isLocalPlayer && this.awdc != null && this.lightStatus != (this.awdc.detonationTime != 0f)) @@ -42,7 +43,6 @@ private void FixedUpdate() } if (this.detonationTime > 0f) { - this.detonated = false; this.NetworkdetonationTime = this.detonationTime - Time.deltaTime; if (!this.lever.GetState()) { @@ -51,12 +51,12 @@ private void FixedUpdate() if (this.detonationTime < 83f && !this.doorsOpen && base.isLocalPlayer) { this.doorsOpen = true; - this.CmdOpenDoors(); + this.OpenDoors(); } if (this.detonationTime < 2f && !this.blastDoors && this.detonationInProgress && base.isLocalPlayer) { this.blastDoors = true; - this.CmdCloseBlastDoors(); + this.CloseBlastDoors(); } } else @@ -93,14 +93,16 @@ private void FixedUpdate() } } + // Token: 0x060001FB RID: 507 RVA: 0x00003298 File Offset: 0x00001498 private void Explode() { this.detonated = true; this.ExplodePlayers(); } + // Token: 0x060001FC RID: 508 RVA: 0x00011F18 File Offset: 0x00010118 [ServerCallback] - private void CmdOpenDoors() + private void OpenDoors() { if (!NetworkServer.active) { @@ -108,13 +110,14 @@ private void CmdOpenDoors() } foreach (Door door in UnityEngine.Object.FindObjectsOfType()) { - if (door.isOpen) + if (!door.isOpen && !door.permissionLevel.Contains("CONT") && door.permissionLevel != "UNACCESSIBLE") { - door.GetComponent().SetState(true); + door.OpenWarhead(); } } } + // Token: 0x060001FD RID: 509 RVA: 0x00011F78 File Offset: 0x00010178 [ServerCallback] private void ExplodePlayers() { @@ -122,15 +125,19 @@ private void ExplodePlayers() { return; } - GameObject[] players = PlayerManager.singleton.players; - for (int i = 0; i < players.Length; i++) + GameObject[] array = GameObject.FindGameObjectsWithTag("LiftTarget"); + foreach (GameObject gameObject in PlayerManager.singleton.players) { - players[i].GetComponent().Explode(); + foreach (GameObject gameObject2 in array) + { + gameObject.GetComponent().Explode(Vector3.Distance(gameObject2.transform.position, gameObject.transform.position) < 3.5f); + } } } + // Token: 0x060001FE RID: 510 RVA: 0x00012000 File Offset: 0x00010200 [ServerCallback] - private void CmdCloseBlastDoors() + private void CloseBlastDoors() { if (!NetworkServer.active) { @@ -143,6 +150,7 @@ private void CmdCloseBlastDoors() } } + // Token: 0x060001FF RID: 511 RVA: 0x000032A7 File Offset: 0x000014A7 [ClientCallback] private void TransmitData(float t) { @@ -153,6 +161,7 @@ private void TransmitData(float t) this.CmdSyncData(t); } + // Token: 0x06000200 RID: 512 RVA: 0x000032B8 File Offset: 0x000014B8 [ServerCallback] private void CmdSyncData(float t) { @@ -163,6 +172,7 @@ private void CmdSyncData(float t) this.NetworkdetonationTime = t; } + // Token: 0x06000201 RID: 513 RVA: 0x00012034 File Offset: 0x00010234 private void Start() { this.smCharacterClassManager = base.GetComponent(); @@ -176,6 +186,7 @@ private void Start() } } + // Token: 0x06000202 RID: 514 RVA: 0x000120A0 File Offset: 0x000102A0 private void SetLights(bool b) { ToggleableLight[] array = this.lights; @@ -185,10 +196,14 @@ private void SetLights(bool b) } } + // Token: 0x06000203 RID: 515 RVA: 0x00002195 File Offset: 0x00000395 private void UNetVersion() { } + // Token: 0x17000032 RID: 50 + // (get) Token: 0x06000204 RID: 516 RVA: 0x000032C9 File Offset: 0x000014C9 + // (set) Token: 0x06000205 RID: 517 RVA: 0x000032D1 File Offset: 0x000014D1 public float NetworkdetonationTime { get @@ -201,6 +216,7 @@ public float NetworkdetonationTime } } + // Token: 0x06000206 RID: 518 RVA: 0x000120CC File Offset: 0x000102CC public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) @@ -225,6 +241,7 @@ public override bool OnSerialize(NetworkWriter writer, bool forceAll) return flag; } + // Token: 0x06000207 RID: 519 RVA: 0x000032E1 File Offset: 0x000014E1 public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) @@ -238,36 +255,52 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } + // Token: 0x0400022B RID: 555 [SyncVar] public float detonationTime; + // Token: 0x0400022C RID: 556 private bool detonationInProgress; + // Token: 0x0400022D RID: 557 private bool detonated; + // Token: 0x0400022E RID: 558 private bool doorsOpen; + // Token: 0x0400022F RID: 559 private bool blastDoors; + // Token: 0x04000230 RID: 560 private GameObject host; + // Token: 0x04000231 RID: 561 private bool lightStatus; + // Token: 0x04000232 RID: 562 private AWSoundController awsc; + // Token: 0x04000233 RID: 563 private LeverButton lever; + // Token: 0x04000234 RID: 564 private AlphaWarheadDetonationController awdc; + // Token: 0x04000235 RID: 565 private ToggleableLight[] lights; + // Token: 0x04000236 RID: 566 private float smStartTime; + // Token: 0x04000237 RID: 567 private int smCooldown; + // Token: 0x04000238 RID: 568 private int smNukeActivationMinTime; + // Token: 0x04000239 RID: 569 private CharacterClassManager smCharacterClassManager; + // Token: 0x0400023A RID: 570 public bool smDetonated; } diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index 97119f3..56dad48 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -7,18 +7,22 @@ using UnityEngine.Networking; using UnityEngine.PostProcessing; +// Token: 0x02000078 RID: 120 public class CharacterClassManager : NetworkBehaviour { + // Token: 0x0600025C RID: 604 RVA: 0x000035F9 File Offset: 0x000017F9 public void SetUnit(int unit) { this.NetworkntfUnit = unit; } + // Token: 0x0600025D RID: 605 RVA: 0x00003602 File Offset: 0x00001802 public void SyncDeathPos(Vector3 v) { this.NetworkdeathPosition = v; } + // Token: 0x0600025E RID: 606 RVA: 0x00013648 File Offset: 0x00011848 [ServerCallback] public void AllowContain() { @@ -45,11 +49,34 @@ public void AllowContain() } } + // Token: 0x0600025F RID: 607 RVA: 0x00013704 File Offset: 0x00011904 private void Start() { + if (base.isLocalPlayer) + { + for (int i = 0; i < this.klasy.Length; i++) + { + this.klasy[i].fullName = TranslationReader.Get("Class_Names", i); + this.klasy[i].description = TranslationReader.Get("Class_Descriptions", i); + } + CharacterClassManager.staticClasses = this.klasy; + } + else if (CharacterClassManager.staticClasses == null || CharacterClassManager.staticClasses.Length == 0) + { + for (int j = 0; j < this.klasy.Length; j++) + { + this.klasy[j].description = TranslationReader.Get("Class_Descriptions", j); + this.klasy[j].fullName = TranslationReader.Get("Class_Names", j); + } + } + else + { + this.klasy = CharacterClassManager.staticClasses; + } this.lureSpj = UnityEngine.Object.FindObjectOfType(); this.scp049 = base.GetComponent(); this.scp049_2 = base.GetComponent(); + this.scp096 = base.GetComponent(); this.scp079 = base.GetComponent(); this.scp106 = base.GetComponent(); this.scp173 = base.GetComponent(); @@ -61,10 +88,10 @@ private void Start() base.StartCoroutine("Init"); string text = ConfigFile.GetString("team_respawn_queue", "401431403144144") + "..........................."; this.classTeamQueue.Clear(); - for (int i = 0; i < text.Length; i++) + for (int k = 0; k < text.Length; k++) { int item = 4; - if (!int.TryParse(text[i].ToString(), out item)) + if (!int.TryParse(text[k].ToString(), out item)) { item = 4; } @@ -82,18 +109,20 @@ private void Start() this.SetMaxHP(6, "SCIENTIST_HP", 100); this.SetMaxHP(7, "SCP079_HP", 100); this.SetMaxHP(8, "CI_HP", 120); - this.SetMaxHP(9, "SCP457_HP", 700); + this.SetMaxHP(9, "SCP096_HP", 2000); this.SetMaxHP(10, "SCP049-2_HP", 400); this.SetMaxHP(11, "NTFL_HP", 120); this.SetMaxHP(12, "NTFC_HP", 150); this.SetMaxHP(13, "NTFG_HP", 100); this.smBan049 = !ConfigFile.GetString("SCP049_DISABLE", "no").Equals("no"); + this.smBan096 = !ConfigFile.GetString("SCP096_DISABLE", "no").Equals("no"); this.smBan079 = !ConfigFile.GetString("SCP079_DISABLE", "yes").Equals("no"); this.smBan106 = !ConfigFile.GetString("SCP106_DISABLE", "no").Equals("no"); this.smBan173 = !ConfigFile.GetString("SCP173_DISABLE", "no").Equals("no"); this.smBan457 = !ConfigFile.GetString("SCP457_DISABLE", "no").Equals("no"); } + // Token: 0x06000260 RID: 608 RVA: 0x0000360B File Offset: 0x0000180B private IEnumerator Init() { GameObject host = null; @@ -165,7 +194,6 @@ private IEnumerator Init() this.SetRandomRoles(); rs = null; rs = null; - rs = null; } else { @@ -195,18 +223,18 @@ private IEnumerator Init() catch { } - int num3 = iteration; - iteration = num3 + 1; + int num = iteration; + iteration = num + 1; yield return new WaitForEndOfFrame(); plys = null; plys = null; - plys = null; } yield break; } - [Client] + // Token: 0x06000261 RID: 609 RVA: 0x00013AA4 File Offset: 0x00011CA4 [Command] + [Client] public void CmdSuicide(PlayerStats.HitInfo hitInfo) { if (!NetworkClient.active) @@ -218,13 +246,14 @@ public void CmdSuicide(PlayerStats.HitInfo hitInfo) base.GetComponent().HurtPlayer(hitInfo, base.gameObject); } + // Token: 0x06000262 RID: 610 RVA: 0x0000361A File Offset: 0x0000181A public void ForceRoundStart() { - this.smRoundStartTime = Time.time; ServerConsole.AddLog("New round has been started."); this.CmdUpdateStartText("started"); } + // Token: 0x06000263 RID: 611 RVA: 0x00003631 File Offset: 0x00001831 [ServerCallback] private void CmdUpdateStartText(string str) { @@ -235,6 +264,7 @@ private void CmdUpdateStartText(string str) RoundStart.singleton.Networkinfo = str; } + // Token: 0x06000264 RID: 612 RVA: 0x00013AF8 File Offset: 0x00011CF8 public void InitSCPs() { if (this.curClass != -1 && !TutorialManager.status) @@ -248,11 +278,13 @@ public void InitSCPs() } } + // Token: 0x06000265 RID: 613 RVA: 0x00003646 File Offset: 0x00001846 public void RegisterEscape() { this.CallCmdRegisterEscape(base.gameObject); } + // Token: 0x06000266 RID: 614 RVA: 0x00013B80 File Offset: 0x00011D80 [Command(channel = 2)] private void CmdRegisterEscape(GameObject sender) { @@ -275,12 +307,19 @@ private void CmdRegisterEscape(GameObject sender) } } + // Token: 0x06000267 RID: 615 RVA: 0x00013C60 File Offset: 0x00011E60 public void ApplyProperties() { Class @class = this.klasy[this.curClass]; this.InitSCPs(); Inventory component = base.GetComponent(); - base.GetComponent().SetLoundness(@class.team); + try + { + base.GetComponent().SetLoundness(@class.team); + } + catch + { + } if (base.isLocalPlayer) { base.GetComponent().UpdateClass(); @@ -378,11 +417,13 @@ public void ApplyProperties() } } + // Token: 0x06000268 RID: 616 RVA: 0x00003654 File Offset: 0x00001854 private void EnableFPC() { base.GetComponent().enabled = true; } + // Token: 0x06000269 RID: 617 RVA: 0x00014024 File Offset: 0x00012224 public void RefreshPlyModel(int classID = -1) { if (this.myModel != null) @@ -425,6 +466,7 @@ public void RefreshPlyModel(int classID = -1) base.GetComponent().enabled = (@class.team != Team.RIP); } + // Token: 0x0600026A RID: 618 RVA: 0x00003662 File Offset: 0x00001862 public void SetClassID(int id) { this.NetworkcurClass = id; @@ -435,6 +477,7 @@ public void SetClassID(int id) } } + // Token: 0x0600026B RID: 619 RVA: 0x000141AC File Offset: 0x000123AC public void InstantiateRagdoll(int id) { if (id < 0) @@ -448,6 +491,7 @@ public void InstantiateRagdoll(int id) gameObject.transform.localScale = @class.ragdoll_offset.scale; } + // Token: 0x0600026C RID: 620 RVA: 0x00014248 File Offset: 0x00012448 public void SetRandomRoles() { MTFRespawn component = base.GetComponent(); @@ -484,7 +528,7 @@ public void SetRandomRoles() { this.klasy[0].banClass = true; } - if (this.smBan457) + if (this.smBan096) { this.klasy[9].banClass = true; } @@ -492,7 +536,6 @@ public void SetRandomRoles() { this.klasy[3].banClass = true; } - this.smFirstPick = true; for (int j = 0; j < array.Length; j++) { int num = (this.forceClass != -1) ? this.forceClass : this.Find_Random_ID_Using_Defined_Team(this.classTeamQueue[j]); @@ -505,6 +548,10 @@ public void SetRandomRoles() component2.summary.scientists_start++; } if (this.klasy[num].team == Team.SCP) + { + component2.summary.scp_start++; + } + if (this.klasy[num].team == Team.SCP) { if (this.smBanComputerFirstPick && this.smFirstPick && !this.smBan079) { @@ -537,11 +584,13 @@ public void SetRandomRoles() } } + // Token: 0x0600026D RID: 621 RVA: 0x00003688 File Offset: 0x00001888 private void SetRoundStart(bool b) { this.NetworkroundStarted = b; } + // Token: 0x0600026E RID: 622 RVA: 0x000144C0 File Offset: 0x000126C0 [ServerCallback] private void CmdStartRound() { @@ -553,7 +602,7 @@ private void CmdStartRound() { try { - GameObject.Find("MeshDoor173").GetComponentInChildren().ForceCooldown(25f); + GameObject.Find("MeshDoor173").GetComponentInChildren().ForceCooldown((float)ConfigFile.GetInt("173_door_starting_cooldown", 25)); UnityEngine.Object.FindObjectOfType().SetState(false); } catch @@ -563,6 +612,7 @@ private void CmdStartRound() this.SetRoundStart(true); } + // Token: 0x0600026F RID: 623 RVA: 0x00003691 File Offset: 0x00001891 [ServerCallback] public void SetPlayersClass(int classid, GameObject ply) { @@ -574,6 +624,7 @@ public void SetPlayersClass(int classid, GameObject ply) ply.GetComponent().SetHPAmount(this.klasy[classid].maxHP); } + // Token: 0x06000270 RID: 624 RVA: 0x00014524 File Offset: 0x00012724 private int Find_Random_ID_Using_Defined_Team(Team team) { List list = new List(); @@ -596,11 +647,13 @@ private int Find_Random_ID_Using_Defined_Team(Team team) return list[index]; } + // Token: 0x06000271 RID: 625 RVA: 0x000036BF File Offset: 0x000018BF public bool SpawnProtection() { return this.aliveTime < 2f; } + // Token: 0x06000272 RID: 626 RVA: 0x000145B8 File Offset: 0x000127B8 private void Update() { if (this.curClass == 2) @@ -633,10 +686,14 @@ private void Update() } } + // Token: 0x06000273 RID: 627 RVA: 0x00002195 File Offset: 0x00000395 private void UNetVersion() { } + // Token: 0x17000039 RID: 57 + // (get) Token: 0x06000274 RID: 628 RVA: 0x000036CE File Offset: 0x000018CE + // (set) Token: 0x06000275 RID: 629 RVA: 0x00014650 File Offset: 0x00012850 public int NetworkntfUnit { get @@ -656,6 +713,9 @@ public int NetworkntfUnit } } + // Token: 0x1700003A RID: 58 + // (get) Token: 0x06000276 RID: 630 RVA: 0x000036D6 File Offset: 0x000018D6 + // (set) Token: 0x06000277 RID: 631 RVA: 0x00014694 File Offset: 0x00012894 public int NetworkcurClass { get @@ -675,6 +735,9 @@ public int NetworkcurClass } } + // Token: 0x1700003B RID: 59 + // (get) Token: 0x06000278 RID: 632 RVA: 0x000036DE File Offset: 0x000018DE + // (set) Token: 0x06000279 RID: 633 RVA: 0x000146D8 File Offset: 0x000128D8 public Vector3 NetworkdeathPosition { get @@ -694,6 +757,9 @@ public Vector3 NetworkdeathPosition } } + // Token: 0x1700003C RID: 60 + // (get) Token: 0x0600027A RID: 634 RVA: 0x000036E6 File Offset: 0x000018E6 + // (set) Token: 0x0600027B RID: 635 RVA: 0x0001471C File Offset: 0x0001291C public bool NetworkroundStarted { get @@ -713,6 +779,7 @@ public bool NetworkroundStarted } } + // Token: 0x0600027C RID: 636 RVA: 0x000036EE File Offset: 0x000018EE protected static void InvokeCmdCmdSuicide(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) @@ -723,6 +790,7 @@ protected static void InvokeCmdCmdSuicide(NetworkBehaviour obj, NetworkReader re ((CharacterClassManager)obj).CmdSuicide(GeneratedNetworkCode._ReadHitInfo_PlayerStats(reader)); } + // Token: 0x0600027D RID: 637 RVA: 0x00003713 File Offset: 0x00001913 protected static void InvokeCmdCmdRegisterEscape(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) @@ -733,6 +801,7 @@ protected static void InvokeCmdCmdRegisterEscape(NetworkBehaviour obj, NetworkRe ((CharacterClassManager)obj).CmdRegisterEscape(reader.ReadGameObject()); } + // Token: 0x0600027E RID: 638 RVA: 0x00014760 File Offset: 0x00012960 public void CallCmdSuicide(PlayerStats.HitInfo hitInfo) { if (!NetworkClient.active) @@ -754,6 +823,7 @@ public void CallCmdSuicide(PlayerStats.HitInfo hitInfo) base.SendCommandInternal(networkWriter, 0, "CmdSuicide"); } + // Token: 0x0600027F RID: 639 RVA: 0x000147D4 File Offset: 0x000129D4 public void CallCmdRegisterEscape(GameObject sender) { if (!NetworkClient.active) @@ -775,6 +845,7 @@ public void CallCmdRegisterEscape(GameObject sender) base.SendCommandInternal(networkWriter, 2, "CmdRegisterEscape"); } + // Token: 0x06000280 RID: 640 RVA: 0x00014848 File Offset: 0x00012A48 static CharacterClassManager() { NetworkBehaviour.RegisterCommandDelegate(typeof(CharacterClassManager), CharacterClassManager.kCmdCmdSuicide, new NetworkBehaviour.CmdDelegate(CharacterClassManager.InvokeCmdCmdSuicide)); @@ -783,6 +854,7 @@ static CharacterClassManager() NetworkCRC.RegisterBehaviour("CharacterClassManager", 0); } + // Token: 0x06000281 RID: 641 RVA: 0x000148B4 File Offset: 0x00012AB4 public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) @@ -837,6 +909,7 @@ public override bool OnSerialize(NetworkWriter writer, bool forceAll) return flag; } + // Token: 0x06000282 RID: 642 RVA: 0x000149A4 File Offset: 0x00012BA4 public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) @@ -866,86 +939,131 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } + // Token: 0x06000283 RID: 643 RVA: 0x00003738 File Offset: 0x00001938 public void SetMaxHP(int id, string config_key, int defaultHp) { this.klasy[id].maxHP = ConfigFile.GetInt(config_key, defaultHp); } + // Token: 0x04000272 RID: 626 [SyncVar(hook = "SetUnit")] public int ntfUnit; + // Token: 0x04000273 RID: 627 public float ciPercentage; + // Token: 0x04000274 RID: 628 public int forceClass = -1; + // Token: 0x04000275 RID: 629 [SerializeField] private AudioClip bell; + // Token: 0x04000276 RID: 630 [SerializeField] private AudioClip bell_dead; + // Token: 0x04000277 RID: 631 [HideInInspector] public GameObject myModel; + // Token: 0x04000278 RID: 632 [HideInInspector] public GameObject charCamera; + // Token: 0x04000279 RID: 633 public Class[] klasy; + // Token: 0x0400027A RID: 634 public List classTeamQueue = new List(); + // Token: 0x0400027B RID: 635 [SyncVar(hook = "SetClassID")] public int curClass; + // Token: 0x0400027C RID: 636 private int seed; + // Token: 0x0400027D RID: 637 private GameObject plyCam; + // Token: 0x0400027E RID: 638 public GameObject unfocusedCamera; + // Token: 0x0400027F RID: 639 [SyncVar(hook = "SyncDeathPos")] public Vector3 deathPosition; + // Token: 0x04000280 RID: 640 [SyncVar(hook = "SetRoundStart")] public bool roundStarted; + // Token: 0x04000281 RID: 641 private Scp049PlayerScript scp049; + // Token: 0x04000282 RID: 642 private Scp049_2PlayerScript scp049_2; + // Token: 0x04000283 RID: 643 private Scp079PlayerScript scp079; + // Token: 0x04000284 RID: 644 private Scp106PlayerScript scp106; + // Token: 0x04000285 RID: 645 private Scp173PlayerScript scp173; + // Token: 0x04000286 RID: 646 + private Scp096PlayerScript scp096; + + // Token: 0x04000287 RID: 647 private LureSubjectContainer lureSpj; + // Token: 0x04000288 RID: 648 + private static Class[] staticClasses; + + // Token: 0x04000289 RID: 649 private float aliveTime; + // Token: 0x0400028A RID: 650 private int prevId = -1; + // Token: 0x0400028B RID: 651 private static int kCmdCmdSuicide = -1051695024; + // Token: 0x0400028C RID: 652 private static int kCmdCmdRegisterEscape; + // Token: 0x0400028D RID: 653 public bool smBanComputerFirstPick; + // Token: 0x0400028E RID: 654 public bool smBan049; + // Token: 0x0400028F RID: 655 + public bool smBan096; + + // Token: 0x04000290 RID: 656 public bool smBan079; + // Token: 0x04000291 RID: 657 public bool smBan106; + // Token: 0x04000292 RID: 658 public bool smBan173; + // Token: 0x04000293 RID: 659 public bool smBan457; + // Token: 0x04000294 RID: 660 public bool smFirstPick; + // Token: 0x04000295 RID: 661 private int smStartRoundTimer; + // Token: 0x04000296 RID: 662 private int smWaitForPlayers; + // Token: 0x04000297 RID: 663 public float smRoundStartTime; } diff --git a/server_mod/CustomNetworkManager.cs b/server_mod/CustomNetworkManager.cs index 57411cc..a89380b 100644 --- a/server_mod/CustomNetworkManager.cs +++ b/server_mod/CustomNetworkManager.cs @@ -1,30 +1,39 @@ using System; using System.Collections; using System.IO; +using Dissonance.Integrations.UNet_HLAPI; using GameConsole; using Steamworks; -using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; -// Token: 0x020000E6 RID: 230 +// Token: 0x020000EC RID: 236 public class CustomNetworkManager : NetworkManager { - // Token: 0x0600064F RID: 1615 + // Token: 0x06000685 RID: 1669 RVA: 0x00006673 File Offset: 0x00004873 + private void Update() + { + if (this.popup.activeSelf && Input.GetKey(KeyCode.Escape)) + { + this.ClickButton(); + } + } + + // Token: 0x06000686 RID: 1670 RVA: 0x00006697 File Offset: 0x00004897 public override void OnClientDisconnect(NetworkConnection conn) { this.ShowLog((int)conn.lastError); } - // Token: 0x06000650 RID: 1616 + // Token: 0x06000687 RID: 1671 RVA: 0x000066A5 File Offset: 0x000048A5 public override void OnClientError(NetworkConnection conn, int errorCode) { this.ShowLog(errorCode); } - // Token: 0x06000651 RID: 1617 + // Token: 0x06000688 RID: 1672 RVA: 0x00026184 File Offset: 0x00024384 public override void OnServerConnect(NetworkConnection conn) { foreach (BanPlayer.Ban ban in BanPlayer.bans) @@ -41,16 +50,17 @@ public override void OnServerConnect(NetworkConnection conn) } } - // Token: 0x06000652 RID: 1618 + // Token: 0x06000689 RID: 1673 RVA: 0x000066AE File Offset: 0x000048AE public override void OnServerDisconnect(NetworkConnection conn) { + HlapiServer.OnServerDisconnect(conn); base.OnServerDisconnect(conn); ServerConsole.AddLog("Player disconnect:"); conn.Disconnect(); conn.Dispose(); } - // Token: 0x06000653 RID: 1619 + // Token: 0x0600068A RID: 1674 RVA: 0x000066D3 File Offset: 0x000048D3 public void OnLevelWasLoaded(int level) { if (this.reconnect) @@ -60,7 +70,7 @@ public void OnLevelWasLoaded(int level) } } - // Token: 0x06000654 RID: 1620 + // Token: 0x0600068B RID: 1675 RVA: 0x000066F8 File Offset: 0x000048F8 public override void OnClientSceneChanged(NetworkConnection conn) { base.OnClientSceneChanged(conn); @@ -70,7 +80,7 @@ public override void OnClientSceneChanged(NetworkConnection conn) } } - // Token: 0x06000655 RID: 1621 + // Token: 0x0600068C RID: 1676 RVA: 0x0000672F File Offset: 0x0000492F private void Reconnect() { if (this.reconnect) @@ -80,35 +90,31 @@ private void Reconnect() } } - // Token: 0x06000656 RID: 1622 + // Token: 0x0600068D RID: 1677 RVA: 0x0000674A File Offset: 0x0000494A public void StopReconnecting() { this.reconnect = false; } - // Token: 0x06000657 RID: 1623 + // Token: 0x0600068E RID: 1678 RVA: 0x00026228 File Offset: 0x00024428 public void ShowLog(int id) { this.curLogID = id; - bool flag = PlayerPrefs.GetString("langver", "en") == "pl"; this.popup.SetActive(true); - this.contSize.sizeDelta = ((!flag) ? this.logs[id].msgSize_en : this.logs[id].msgSize_pl); - this.content.text = ((!flag) ? this.logs[id].msg_en : this.logs[id].msg_pl); - this.button.GetComponentInChildren().text = ((!flag) ? this.logs[id].button.content_en : this.logs[id].button.content_pl); - this.button.GetComponent().sizeDelta = new Vector2((!flag) ? this.logs[id].button.size_en : this.logs[id].button.size_pl, 80f); + this.content.text = TranslationReader.Get("Connection_Errors", id); + this.content.rectTransform.sizeDelta = Vector3.zero; } - // Token: 0x06000658 RID: 1624 + // Token: 0x0600068F RID: 1679 RVA: 0x00026278 File Offset: 0x00024478 public void ClickButton() { - ConnInfoButton[] actions = this.logs[this.curLogID].button.actions; - for (int i = 0; i < actions.Length; i++) + foreach (ConnInfoButton connInfoButton in this.logs[this.curLogID].button.actions) { - actions[i].UseButton(); + connInfoButton.UseButton(); } } - // Token: 0x06000659 RID: 1625 + // Token: 0x06000690 RID: 1680 RVA: 0x000262BC File Offset: 0x000244BC private void Start() { this.console = GameConsole.Console.singleton; @@ -118,11 +124,10 @@ private void Start() } } - // Token: 0x0600065A RID: 1626 + // Token: 0x06000691 RID: 1681 RVA: 0x00026308 File Offset: 0x00024508 public void CreateMatch() { - ServerConsole.AddLog("ServerMod - Version 1.2"); - base.maxConnections = ConfigFile.GetInt("max_players", 20); + ServerConsole.AddLog("ServerMod - Version 1.4 beta (Patch 1)"); this.ShowLog(13); this.createpop.SetActive(false); NetworkServer.Reset(); @@ -135,10 +140,11 @@ public void CreateMatch() this.NonsteamHost(); } - // Token: 0x0600065B RID: 1627 + // Token: 0x06000692 RID: 1682 RVA: 0x00006753 File Offset: 0x00004953 private IEnumerator CreateLobby() { yield return new WaitForEndOfFrame(); + base.maxConnections = ConfigFile.GetInt("max_players", 20); string ip = string.Empty; if (ConfigFile.GetString("server_ip", "auto") != "auto") { @@ -158,8 +164,6 @@ private IEnumerator CreateLobby() ip = www.text.Remove(www.text.Length - 1); ServerConsole.AddLog("Done, your game-server IP will be " + ip); www = null; - www = null; - www = null; } ServerConsole.AddLog("Initializing game-server..."); this.StartHost(); @@ -168,30 +172,37 @@ private IEnumerator CreateLobby() yield return new WaitForEndOfFrame(); } ServerConsole.AddLog("Level loaded. Creating match..."); - string info = UnityEngine.Object.FindObjectOfType().smParseName(ConfigFile.GetString("server_name", "Unnamed server"), 0); + string value = string.Concat(new string[] + { + ConfigFile.GetString("server_name", "Unnamed server"), + ":[:BREAK:]:", + ConfigFile.GetString("serverinfo_pastebin_id", "7wV681fT"), + ":[:BREAK:]:", + this.versionstring + }); ServerConsole.ip = ip; - WWWForm form = new WWWForm(); - form.AddField("update", 1); - form.AddField("ip", ip); - form.AddField("info", info); - form.AddField("port", base.networkPort); - form.AddField("players", 0); + WWWForm wwwform = new WWWForm(); + wwwform.AddField("update", 1); + wwwform.AddField("ip", ip); + wwwform.AddField("info", value); + wwwform.AddField("port", base.networkPort); + wwwform.AddField("players", 0); bool codeNotGenerated = false; string pth = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/SCP Secret Laboratory/verkey.txt"; if (File.Exists(pth)) { StreamReader streamReader = new StreamReader(pth); string text = streamReader.ReadToEnd(); - form.AddField("passcode", text); + wwwform.AddField("passcode", text); ServerConsole.password = text; streamReader.Close(); } else { - form.AddField("passcode", string.Empty); + wwwform.AddField("passcode", string.Empty); codeNotGenerated = true; } - WWW www2 = new WWW("https://hubertmoszka.pl/authenticator.php", form); + WWW www2 = new WWW("https://hubertmoszka.pl/authenticator.php", wwwform); yield return www2; if (string.IsNullOrEmpty(www2.error)) { @@ -254,7 +265,7 @@ private IEnumerator CreateLobby() yield break; } - // Token: 0x0600065C RID: 1628 + // Token: 0x06000693 RID: 1683 RVA: 0x00006762 File Offset: 0x00004962 private void NonsteamHost() { base.onlineScene = "Facility"; @@ -262,14 +273,14 @@ private void NonsteamHost() this.StartHostWithPort(); } - // Token: 0x0600065D RID: 1629 + // Token: 0x06000694 RID: 1684 RVA: 0x0000677D File Offset: 0x0000497D public void StartHostWithPort() { ServerConsole.AddLog("Server starting at port " + base.networkPort); this.StartHost(); } - // Token: 0x0600065E RID: 1630 + // Token: 0x06000695 RID: 1685 RVA: 0x0002635C File Offset: 0x0002455C public int GetFreePort() { string @string = ConfigFile.GetString("port_queue", "7777,7778,7779,7780,7781,7782,7783,7784"); @@ -327,79 +338,54 @@ public int GetFreePort() return 7777; } - // Token: 0x04000597 RID: 1431 + // Token: 0x040005D8 RID: 1496 public GameObject popup; - // Token: 0x04000598 RID: 1432 + // Token: 0x040005D9 RID: 1497 public GameObject createpop; - // Token: 0x04000599 RID: 1433 + // Token: 0x040005DA RID: 1498 public RectTransform contSize; - // Token: 0x0400059A RID: 1434 - public TextMeshProUGUI content; + // Token: 0x040005DB RID: 1499 + public Text content; - // Token: 0x0400059B RID: 1435 - public Button button; - - // Token: 0x0400059C RID: 1436 + // Token: 0x040005DC RID: 1500 public CustomNetworkManager.DisconnectLog[] logs; - // Token: 0x0400059D RID: 1437 + // Token: 0x040005DD RID: 1501 private int curLogID; - // Token: 0x0400059E RID: 1438 + // Token: 0x040005DE RID: 1502 public bool reconnect; - // Token: 0x0400059F RID: 1439 + // Token: 0x040005DF RID: 1503 [Space(20f)] public string versionstring; - // Token: 0x040005A0 RID: 1440 + // Token: 0x040005E0 RID: 1504 private GameConsole.Console console; - // Token: 0x020000E7 RID: 231 + // Token: 0x020000ED RID: 237 [Serializable] public class DisconnectLog { - // Token: 0x040005A1 RID: 1441 + // Token: 0x040005E1 RID: 1505 [Multiline] public string msg_en; - // Token: 0x040005A2 RID: 1442 - [Multiline] - public string msg_pl; - - // Token: 0x040005A3 RID: 1443 - public Vector2 msgSize_en; - - // Token: 0x040005A4 RID: 1444 - public Vector2 msgSize_pl; - - // Token: 0x040005A5 RID: 1445 + // Token: 0x040005E2 RID: 1506 public CustomNetworkManager.DisconnectLog.LogButton button; - // Token: 0x040005A6 RID: 1446 + // Token: 0x040005E3 RID: 1507 public bool autoHideOnSceneLoad; - // Token: 0x020000E8 RID: 232 + // Token: 0x020000EE RID: 238 [Serializable] public class LogButton { - // Token: 0x040005A7 RID: 1447 + // Token: 0x040005E4 RID: 1508 public ConnInfoButton[] actions; - - // Token: 0x040005A8 RID: 1448 - public string content_en; - - // Token: 0x040005A9 RID: 1449 - public string content_pl; - - // Token: 0x040005AA RID: 1450 - public float size_en; - - // Token: 0x040005AB RID: 1451 - public float size_pl; } } } diff --git a/server_mod/DisableUselessComponents.cs b/server_mod/DisableUselessComponents.cs index f8e7270..19e1acc 100644 --- a/server_mod/DisableUselessComponents.cs +++ b/server_mod/DisableUselessComponents.cs @@ -27,10 +27,6 @@ public void Start() { PlayerManager.localPlayer = base.gameObject; this.CallCmdSetName((!base.isServer) ? "Player" : "Host", ServerStatic.isDedicated); - if (UnityEngine.Object.FindObjectOfType() != null) - { - UnityEngine.Object.FindObjectOfType().SetPlayer(base.gameObject); - } if (base.GetComponent() != null) { base.GetComponent().enabled = false; diff --git a/server_mod/RadioInitialization.cs b/server_mod/RadioInitializator.cs similarity index 100% rename from server_mod/RadioInitialization.cs rename to server_mod/RadioInitializator.cs diff --git a/server_mod/ResolutionManager.cs b/server_mod/ResolutionManager.cs index 2be9742..25bb5cc 100644 --- a/server_mod/ResolutionManager.cs +++ b/server_mod/ResolutionManager.cs @@ -1,10 +1,12 @@ -using System; +using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; +// Token: 0x02000052 RID: 82 public partial class ResolutionManager : MonoBehaviour { + // Token: 0x0600016E RID: 366 RVA: 0x00010114 File Offset: 0x0000E314 public static void RefreshScreen() { if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null) @@ -12,6 +14,12 @@ public static void RefreshScreen() return; } ResolutionManager.presets[ResolutionManager.preset].SetResolution(); - UnityEngine.Object.FindObjectOfType().txt.text = ResolutionManager.presets[ResolutionManager.preset].width + " × " + ResolutionManager.presets[ResolutionManager.preset].height; + try + { + UnityEngine.Object.FindObjectOfType().txt.text = ResolutionManager.presets[ResolutionManager.preset].width + " × " + ResolutionManager.presets[ResolutionManager.preset].height; + } + catch + { + } } } diff --git a/server_mod/RoundSummary.cs b/server_mod/RoundSummary.cs index 90407c7..1e07c4c 100644 --- a/server_mod/RoundSummary.cs +++ b/server_mod/RoundSummary.cs @@ -5,16 +5,16 @@ using UnityEngine; using UnityEngine.Networking; -// Token: 0x020000BC RID: 188 +// Token: 0x020000C0 RID: 192 public class RoundSummary : NetworkBehaviour { - // Token: 0x0600049D RID: 1181 RVA: 0x00005191 File Offset: 0x00003391 + // Token: 0x060004C4 RID: 1220 RVA: 0x00005226 File Offset: 0x00003426 private void Awake() { Radio.roundEnded = false; } - // Token: 0x0600049E RID: 1182 RVA: 0x00005199 File Offset: 0x00003399 + // Token: 0x060004C5 RID: 1221 RVA: 0x0000522E File Offset: 0x0000342E private void Start() { this.pm = PlayerManager.singleton; @@ -22,7 +22,7 @@ private void Start() base.InvokeRepeating("CheckForEnding", 12f, 3f); } - // Token: 0x0600049F RID: 1183 RVA: 0x0001D0D0 File Offset: 0x0001B2D0 + // Token: 0x060004C6 RID: 1222 RVA: 0x0001DE18 File Offset: 0x0001C018 private void RoundRestart() { bool flag = false; @@ -42,7 +42,7 @@ private void RoundRestart() } } - // Token: 0x060004A0 RID: 1184 + // Token: 0x060004C7 RID: 1223 RVA: 0x0001DEC0 File Offset: 0x0001C0C0 public void CheckForEnding() { if (base.isLocalPlayer && base.isServer && !this.roundHasEnded) @@ -134,7 +134,7 @@ public void CheckForEnding() } } - // Token: 0x060004A1 RID: 1185 RVA: 0x0001D410 File Offset: 0x0001B610 + // Token: 0x060004C8 RID: 1224 RVA: 0x0001E104 File Offset: 0x0001C304 private void Update() { if (RoundSummary.host == null) @@ -147,131 +147,87 @@ private void Update() } } - // Token: 0x060004A2 RID: 1186 RVA: 0x000051C7 File Offset: 0x000033C7 + // Token: 0x060004C9 RID: 1225 RVA: 0x0000525C File Offset: 0x0000345C [Command(channel = 15)] private void CmdSetSummary(RoundSummary.Summary sum, int posttime) { this.CallRpcSetSummary(sum, posttime); } - // Token: 0x060004A3 RID: 1187 RVA: 0x0001D450 File Offset: 0x0001B650 + // Token: 0x060004CA RID: 1226 RVA: 0x0001E144 File Offset: 0x0001C344 [ClientRpc(channel = 15)] public void RpcSetSummary(RoundSummary.Summary sum, int posttime) { Radio.roundEnded = true; string text = string.Empty; - if (PlayerPrefs.GetString("langver", "en") == "pl") + string text2 = text; + text = string.Concat(new object[] { - string text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.classD_escaped, - "/", - sum.classD_start, - " Personelu Klasy D uciekło z placówki\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scientists_escaped, - "/", - sum.scientists_start, - " Naukowców ocalało\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scp_frags, - " Zabitych przez SCP\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scp_start - sum.scp_nozombies, - "/", - sum.scp_start, - " Unieszkodliwionych podmiotów SCP\n" - }); - text = text + "Głowica Alfa: " + ((!sum.warheadDetonated) ? "Nie została użyta" : "Zdetonowana") + "\n\n"; - text2 = text; - text = string.Concat(new object[] - { - text2, - "Następna runda rozpocznie się w ciągu ", - posttime, - " sekund." - }); - } - else + text2, + "", + sum.classD_escaped, + "/", + sum.classD_start, + " ", + TranslationReader.Get("Legancy_Interfaces", 3), + "\n" + }); + text2 = text; + text = string.Concat(new object[] { - string text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.classD_escaped, - "/", - sum.classD_start, - " Class-D Personnel escaped\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scientists_escaped, - "/", - sum.scientists_start, - " Scientists survived\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scp_frags, - " Killed by SCP\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scp_start - sum.scp_alive, - "/", - sum.scp_start, - " Terminated SCP subjects\n" - }); - text = text + "Alpha Warhead: " + ((!sum.warheadDetonated) ? "Unused" : "Detonated") + "\n\n"; - text2 = text; - text = string.Concat(new object[] - { - text2, - "The next round will start within ", - posttime, - " seconds." - }); - } + text2, + "", + sum.scientists_escaped, + "/", + sum.scientists_start, + " ", + TranslationReader.Get("Legancy_Interfaces", 4), + "\n" + }); + text2 = text; + text = string.Concat(new object[] + { + text2, + "", + sum.scp_frags, + " ", + TranslationReader.Get("Legancy_Interfaces", 5), + "\n" + }); + text2 = text; + text = string.Concat(new object[] + { + text2, + "", + Mathf.Clamp(sum.scp_start - sum.scp_alive, 0, sum.scp_start), + "/", + sum.scp_start, + " ", + TranslationReader.Get("Legancy_Interfaces", 6), + "\n" + }); + text2 = text; + text = string.Concat(new string[] + { + text2, + TranslationReader.Get("Legancy_Interfaces", 7), + ": ", + (!sum.warheadDetonated) ? TranslationReader.Get("Legancy_Interfaces", 9) : TranslationReader.Get("Legancy_Interfaces", 8), + "\n\n" + }); + text += TranslationReader.Get("Legancy_Interfaces", 10).Replace("[time]", posttime.ToString()); GameObject gameObject = UserMainInterface.singleton.summary; gameObject.SetActive(true); TextMeshProUGUI component = GameObject.FindGameObjectWithTag("Summary").GetComponent(); component.text = text; } - // Token: 0x060004A4 RID: 1188 RVA: 0x0000215A File Offset: 0x0000035A + // Token: 0x060004CB RID: 1227 RVA: 0x00002195 File Offset: 0x00000395 private void UNetVersion() { } - // Token: 0x060004A5 RID: 1189 RVA: 0x000051D1 File Offset: 0x000033D1 + // Token: 0x060004CC RID: 1228 RVA: 0x00005266 File Offset: 0x00003466 protected static void InvokeCmdCmdSetSummary(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) @@ -282,7 +238,7 @@ protected static void InvokeCmdCmdSetSummary(NetworkBehaviour obj, NetworkReader ((RoundSummary)obj).CmdSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int)reader.ReadPackedUInt32()); } - // Token: 0x060004A6 RID: 1190 RVA: 0x0001D774 File Offset: 0x0001B974 + // Token: 0x060004CD RID: 1229 RVA: 0x0001E378 File Offset: 0x0001C578 public void CallCmdSetSummary(RoundSummary.Summary sum, int posttime) { if (!NetworkClient.active) @@ -305,7 +261,7 @@ public void CallCmdSetSummary(RoundSummary.Summary sum, int posttime) base.SendCommandInternal(networkWriter, 15, "CmdSetSummary"); } - // Token: 0x060004A7 RID: 1191 RVA: 0x00005200 File Offset: 0x00003400 + // Token: 0x060004CE RID: 1230 RVA: 0x00005295 File Offset: 0x00003495 protected static void InvokeRpcRpcSetSummary(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) @@ -316,7 +272,7 @@ protected static void InvokeRpcRpcSetSummary(NetworkBehaviour obj, NetworkReader ((RoundSummary)obj).RpcSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int)reader.ReadPackedUInt32()); } - // Token: 0x060004A8 RID: 1192 RVA: 0x0001D80C File Offset: 0x0001BA0C + // Token: 0x060004CF RID: 1231 RVA: 0x0001E410 File Offset: 0x0001C610 public void CallRpcSetSummary(RoundSummary.Summary sum, int posttime) { if (!NetworkServer.active) @@ -334,7 +290,7 @@ public void CallRpcSetSummary(RoundSummary.Summary sum, int posttime) this.SendRPCInternal(networkWriter, 15, "RpcSetSummary"); } - // Token: 0x060004A9 RID: 1193 RVA: 0x0001D88C File Offset: 0x0001BA8C + // Token: 0x060004D0 RID: 1232 RVA: 0x0001E490 File Offset: 0x0001C690 static RoundSummary() { NetworkBehaviour.RegisterCommandDelegate(typeof(RoundSummary), RoundSummary.kCmdCmdSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeCmdCmdSetSummary)); @@ -343,92 +299,92 @@ static RoundSummary() NetworkCRC.RegisterBehaviour("RoundSummary", 0); } - // Token: 0x060004AA RID: 1194 RVA: 0x0000A298 File Offset: 0x00008498 + // Token: 0x060004D1 RID: 1233 RVA: 0x0000A490 File Offset: 0x00008690 public override bool OnSerialize(NetworkWriter writer, bool forceAll) { bool result; return result; } - // Token: 0x060004AB RID: 1195 RVA: 0x0000215A File Offset: 0x0000035A + // Token: 0x060004D2 RID: 1234 RVA: 0x00002195 File Offset: 0x00000395 public override void OnDeserialize(NetworkReader reader, bool initialState) { } - // Token: 0x04000426 RID: 1062 + // Token: 0x04000455 RID: 1109 public bool debugMode; - // Token: 0x04000427 RID: 1063 + // Token: 0x04000456 RID: 1110 private bool roundHasEnded; - // Token: 0x04000428 RID: 1064 + // Token: 0x04000457 RID: 1111 private PlayerManager pm; - // Token: 0x04000429 RID: 1065 + // Token: 0x04000458 RID: 1112 private CharacterClassManager ccm; - // Token: 0x0400042A RID: 1066 + // Token: 0x04000459 RID: 1113 public static RoundSummary host; - // Token: 0x0400042B RID: 1067 + // Token: 0x0400045A RID: 1114 public RoundSummary.Summary summary; - // Token: 0x0400042C RID: 1068 + // Token: 0x0400045B RID: 1115 private int _ClassDs; - // Token: 0x0400042D RID: 1069 + // Token: 0x0400045C RID: 1116 private int _ChaosInsurgency; - // Token: 0x0400042E RID: 1070 + // Token: 0x0400045D RID: 1117 private int _MobileForces; - // Token: 0x0400042F RID: 1071 + // Token: 0x0400045E RID: 1118 private int _Spectators; - // Token: 0x04000430 RID: 1072 + // Token: 0x0400045F RID: 1119 private int _Scientists; - // Token: 0x04000431 RID: 1073 + // Token: 0x04000460 RID: 1120 private int _SCPs; - // Token: 0x04000432 RID: 1074 + // Token: 0x04000461 RID: 1121 private int _SCPsNozombies; - // Token: 0x04000433 RID: 1075 + // Token: 0x04000462 RID: 1122 private static int kCmdCmdSetSummary = 509590172; - // Token: 0x04000434 RID: 1076 + // Token: 0x04000463 RID: 1123 private static int kRpcRpcSetSummary; - // Token: 0x020000BD RID: 189 + // Token: 0x020000C1 RID: 193 [Serializable] public class Summary { - // Token: 0x04000435 RID: 1077 + // Token: 0x04000464 RID: 1124 public int classD_escaped; - // Token: 0x04000436 RID: 1078 + // Token: 0x04000465 RID: 1125 public int classD_start; - // Token: 0x04000437 RID: 1079 + // Token: 0x04000466 RID: 1126 public int scientists_escaped; - // Token: 0x04000438 RID: 1080 + // Token: 0x04000467 RID: 1127 public int scientists_start; - // Token: 0x04000439 RID: 1081 + // Token: 0x04000468 RID: 1128 public int scp_frags; - // Token: 0x0400043A RID: 1082 + // Token: 0x04000469 RID: 1129 public int scp_start; - // Token: 0x0400043B RID: 1083 + // Token: 0x0400046A RID: 1130 public int scp_alive; - // Token: 0x0400043C RID: 1084 + // Token: 0x0400046B RID: 1131 public int scp_nozombies; - // Token: 0x0400043D RID: 1085 + // Token: 0x0400046C RID: 1132 public bool warheadDetonated; } } diff --git a/server_mod/ServerConsole.cs b/server_mod/ServerConsole.cs index 5e4a18b..5baf6c5 100644 --- a/server_mod/ServerConsole.cs +++ b/server_mod/ServerConsole.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Diagnostics; using UnityEngine; @@ -9,46 +9,47 @@ public IEnumerator RefreshSession() { for (;;) { - WWWForm wwwform = new WWWForm(); - wwwform.AddField("update", 0); - wwwform.AddField("ip", ServerConsole.ip); - wwwform.AddField("passcode", ServerConsole.password); - int num = 0; + WWWForm form = new WWWForm(); + form.AddField("update", 0); + form.AddField("ip", ServerConsole.ip); + form.AddField("passcode", ServerConsole.password); + int plys = 0; try { - num = GameObject.FindGameObjectsWithTag("Player").Length - 1; + plys = GameObject.FindGameObjectsWithTag("Player").Length - 1; } catch { } - wwwform.AddField("players", num); - wwwform.AddField("port", base.GetComponent().networkPort); + form.AddField("players", plys); + form.AddField("port", base.GetComponent().networkPort); float timeBefore = Time.realtimeSinceStartup; - WWW www = new WWW("https://hubertmoszka.pl/authenticator.php", wwwform); + WWW www = new WWW("https://hubertmoszka.pl/authenticator.php", form); yield return www; if (!string.IsNullOrEmpty(www.error) || !www.text.Contains("YES")) { ServerConsole.AddLog("Could not update the session - " + www.error + www.text + "LOGTYPE-8"); } - wwwform.AddField("update", 1); - wwwform.AddField("ip", ServerConsole.ip); - wwwform.AddField("passcode", ServerConsole.password); - wwwform.AddField("info", this.smParseName(ConfigFile.GetString("server_name", "Unnamed server"), num)); - wwwform.AddField("players", num); - wwwform.AddField("port", base.GetComponent().networkPort); + form.AddField("update", 1); + form.AddField("ip", ServerConsole.ip); + form.AddField("passcode", ServerConsole.password); + form.AddField("info", this.smParseName(ConfigFile.GetString("server_name", "Unnamed server"), plys)); + form.AddField("players", plys); + form.AddField("port", base.GetComponent().networkPort); timeBefore = Time.realtimeSinceStartup; - www = new WWW("https://hubertmoszka.pl/authenticator.php", wwwform); + www = new WWW("https://hubertmoszka.pl/authenticator.php", form); yield return www; if (!string.IsNullOrEmpty(www.error) || !www.text.Contains("YES")) { ServerConsole.AddLog("Could not update the session - " + www.error + www.text + "LOGTYPE-8"); } yield return new WaitForSeconds(5f - (Time.realtimeSinceStartup - timeBefore)); + form = null; + www = null; } yield break; } - public string smParseName(string name, int players) { CustomNetworkManager customNetworkManager = (CustomNetworkManager)CustomNetworkManager.singleton; From b0a4d78a155f0b5c4018cde336fb75987582ca4c Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 19:10:10 -0500 Subject: [PATCH 04/27] Add missing feature - Adds a missed feature for "AlphaWarheadDetonationController.cs" --- server_mod/AlphaWarheadDetonationController.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server_mod/AlphaWarheadDetonationController.cs b/server_mod/AlphaWarheadDetonationController.cs index afde734..0cc48da 100644 --- a/server_mod/AlphaWarheadDetonationController.cs +++ b/server_mod/AlphaWarheadDetonationController.cs @@ -5,22 +5,25 @@ // Token: 0x0200006D RID: 109 public class AlphaWarheadDetonationController : NetworkBehaviour { - // Token: 0x060001F8 RID: 504 RVA: 0x0000323E File Offset: 0x0000143E + // Token: 0x060001F8 RID: 504 public void StartDetonation() { - if (this.detonationInProgress || !this.lever.GetState()) + float elapsed = Time.time - this.smCharacterClassManager.smRoundStartTime; + if (this.detonationInProgress || !this.lever.GetState() || elapsed < (float)this.smNukeActivationMinTime) { return; } this.detonationInProgress = true; this.NetworkdetonationTime = 90f; this.doorsOpen = false; + this.smStartTime = Time.time; } - // Token: 0x060001F9 RID: 505 RVA: 0x0000326F File Offset: 0x0000146F + // Token: 0x060001F9 RID: 505 public void CancelDetonation() { - if (this.detonationInProgress && this.detonationTime > 2f) + float elapsed = Time.time - this.smStartTime; + if (this.detonationInProgress && this.detonationTime > 2f && elapsed >= (float)this.smCooldown) { this.detonationInProgress = false; this.NetworkdetonationTime = 0f; From e421938dd2742b00152341a160bbcc64dcd8a12a Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 19:19:35 -0500 Subject: [PATCH 05/27] Updated Version Number and Max Health --- server_mod/CharacterClassManager.cs | 4 ++-- server_mod/CustomNetworkManager.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index 56dad48..3deda61 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -104,9 +104,9 @@ private void Start() this.SetMaxHP(0, "SCP173_HP", 2000); this.SetMaxHP(1, "CLASSD_HP", 100); this.SetMaxHP(3, "SCP106_HP", 700); - this.SetMaxHP(4, "NTFSCIENTIST_HP", 120); + this.SetMaxHP(4, "SCIENTIST_HP", 120); // For some reason this and "NTFSCIENTIST_HP" are swapped? this.SetMaxHP(5, "SCP049_HP", 1200); - this.SetMaxHP(6, "SCIENTIST_HP", 100); + this.SetMaxHP(6, "NTFSCIENTIST_HP", 100); this.SetMaxHP(7, "SCP079_HP", 100); this.SetMaxHP(8, "CI_HP", 120); this.SetMaxHP(9, "SCP096_HP", 2000); diff --git a/server_mod/CustomNetworkManager.cs b/server_mod/CustomNetworkManager.cs index a89380b..d8d4525 100644 --- a/server_mod/CustomNetworkManager.cs +++ b/server_mod/CustomNetworkManager.cs @@ -124,10 +124,10 @@ private void Start() } } - // Token: 0x06000691 RID: 1681 RVA: 0x00026308 File Offset: 0x00024508 + // Token: 0x06000691 RID: 1681 public void CreateMatch() { - ServerConsole.AddLog("ServerMod - Version 1.4 beta (Patch 1)"); + ServerConsole.AddLog("ServerMod - Version 1.4 beta (Patch 2)"); this.ShowLog(13); this.createpop.SetActive(false); NetworkServer.Reset(); From 77a2bd5c97eaf93406f4d0ac76eba95935f15248 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 20:09:34 -0500 Subject: [PATCH 06/27] Fixed Missing Variable --- server_mod/CharacterClassManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index 3deda61..2a05230 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -249,6 +249,7 @@ public void CmdSuicide(PlayerStats.HitInfo hitInfo) // Token: 0x06000262 RID: 610 RVA: 0x0000361A File Offset: 0x0000181A public void ForceRoundStart() { + this.smRoundStartTime = Time.time; ServerConsole.AddLog("New round has been started."); this.CmdUpdateStartText("started"); } From 01fb9928bb34e6d281eb239c992d9384d8c8cc6b Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 20:19:36 -0500 Subject: [PATCH 07/27] Modified Cursor LockState --- server_mod/CursorManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server_mod/CursorManager.cs b/server_mod/CursorManager.cs index a2db9a2..59528e5 100644 --- a/server_mod/CursorManager.cs +++ b/server_mod/CursorManager.cs @@ -7,11 +7,14 @@ public partial class CursorManager : MonoBehaviour public void LateUpdate() { bool visible = CursorManager.eqOpen | CursorManager.pauseOpen | CursorManager.isServerOnly | CursorManager.consoleOpen | CursorManager.is079 | CursorManager.scp106 | CursorManager.roundStarted | CursorManager.raOp; - Cursor.lockState = ((!visible) ? CursorLockMode.Locked : CursorLockMode.None); if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null) { Cursor.lockState = CursorLockMode.None; } + else + { + Cursor.lockState = ((!visible) ? CursorLockMode.Locked : CursorLockMode.None); + } Cursor.visible = visible; } } From ca737c2534e4b4ddbdc744e6ef0accfb7cc892cb Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 20:29:38 -0500 Subject: [PATCH 08/27] Update CustomNetworkManager --- server_mod/CustomNetworkManager.cs | 76 +++++++++++++++++------------- 1 file changed, 44 insertions(+), 32 deletions(-) diff --git a/server_mod/CustomNetworkManager.cs b/server_mod/CustomNetworkManager.cs index d8d4525..4206cbe 100644 --- a/server_mod/CustomNetworkManager.cs +++ b/server_mod/CustomNetworkManager.cs @@ -12,7 +12,7 @@ // Token: 0x020000EC RID: 236 public class CustomNetworkManager : NetworkManager { - // Token: 0x06000685 RID: 1669 RVA: 0x00006673 File Offset: 0x00004873 + // Token: 0x06000681 RID: 1665 private void Update() { if (this.popup.activeSelf && Input.GetKey(KeyCode.Escape)) @@ -21,19 +21,19 @@ private void Update() } } - // Token: 0x06000686 RID: 1670 RVA: 0x00006697 File Offset: 0x00004897 + // Token: 0x06000682 RID: 1666 public override void OnClientDisconnect(NetworkConnection conn) { this.ShowLog((int)conn.lastError); } - // Token: 0x06000687 RID: 1671 RVA: 0x000066A5 File Offset: 0x000048A5 + // Token: 0x06000683 RID: 1667 public override void OnClientError(NetworkConnection conn, int errorCode) { this.ShowLog(errorCode); } - // Token: 0x06000688 RID: 1672 RVA: 0x00026184 File Offset: 0x00024384 + // Token: 0x06000684 RID: 1668 public override void OnServerConnect(NetworkConnection conn) { foreach (BanPlayer.Ban ban in BanPlayer.bans) @@ -50,7 +50,7 @@ public override void OnServerConnect(NetworkConnection conn) } } - // Token: 0x06000689 RID: 1673 RVA: 0x000066AE File Offset: 0x000048AE + // Token: 0x06000685 RID: 1669 public override void OnServerDisconnect(NetworkConnection conn) { HlapiServer.OnServerDisconnect(conn); @@ -60,7 +60,7 @@ public override void OnServerDisconnect(NetworkConnection conn) conn.Dispose(); } - // Token: 0x0600068A RID: 1674 RVA: 0x000066D3 File Offset: 0x000048D3 + // Token: 0x06000686 RID: 1670 public void OnLevelWasLoaded(int level) { if (this.reconnect) @@ -70,7 +70,7 @@ public void OnLevelWasLoaded(int level) } } - // Token: 0x0600068B RID: 1675 RVA: 0x000066F8 File Offset: 0x000048F8 + // Token: 0x06000687 RID: 1671 public override void OnClientSceneChanged(NetworkConnection conn) { base.OnClientSceneChanged(conn); @@ -80,7 +80,7 @@ public override void OnClientSceneChanged(NetworkConnection conn) } } - // Token: 0x0600068C RID: 1676 RVA: 0x0000672F File Offset: 0x0000492F + // Token: 0x06000688 RID: 1672 private void Reconnect() { if (this.reconnect) @@ -90,13 +90,13 @@ private void Reconnect() } } - // Token: 0x0600068D RID: 1677 RVA: 0x0000674A File Offset: 0x0000494A + // Token: 0x06000689 RID: 1673 public void StopReconnecting() { this.reconnect = false; } - // Token: 0x0600068E RID: 1678 RVA: 0x00026228 File Offset: 0x00024428 + // Token: 0x0600068A RID: 1674 public void ShowLog(int id) { this.curLogID = id; @@ -105,16 +105,17 @@ public void ShowLog(int id) this.content.rectTransform.sizeDelta = Vector3.zero; } - // Token: 0x0600068F RID: 1679 RVA: 0x00026278 File Offset: 0x00024478 + // Token: 0x0600068B RID: 1675 public void ClickButton() { - foreach (ConnInfoButton connInfoButton in this.logs[this.curLogID].button.actions) + ConnInfoButton[] actions = this.logs[this.curLogID].button.actions; + for (int i = 0; i < actions.Length; i++) { - connInfoButton.UseButton(); + actions[i].UseButton(); } } - // Token: 0x06000690 RID: 1680 RVA: 0x000262BC File Offset: 0x000244BC + // Token: 0x0600068C RID: 1676 private void Start() { this.console = GameConsole.Console.singleton; @@ -124,7 +125,7 @@ private void Start() } } - // Token: 0x06000691 RID: 1681 + // Token: 0x0600068D RID: 1677 public void CreateMatch() { ServerConsole.AddLog("ServerMod - Version 1.4 beta (Patch 2)"); @@ -140,7 +141,7 @@ public void CreateMatch() this.NonsteamHost(); } - // Token: 0x06000692 RID: 1682 RVA: 0x00006753 File Offset: 0x00004953 + // Token: 0x0600068E RID: 1678 private IEnumerator CreateLobby() { yield return new WaitForEndOfFrame(); @@ -164,6 +165,7 @@ private IEnumerator CreateLobby() ip = www.text.Remove(www.text.Length - 1); ServerConsole.AddLog("Done, your game-server IP will be " + ip); www = null; + www = null; } ServerConsole.AddLog("Initializing game-server..."); this.StartHost(); @@ -265,7 +267,7 @@ private IEnumerator CreateLobby() yield break; } - // Token: 0x06000693 RID: 1683 RVA: 0x00006762 File Offset: 0x00004962 + // Token: 0x0600068F RID: 1679 private void NonsteamHost() { base.onlineScene = "Facility"; @@ -273,14 +275,14 @@ private void NonsteamHost() this.StartHostWithPort(); } - // Token: 0x06000694 RID: 1684 RVA: 0x0000677D File Offset: 0x0000497D + // Token: 0x06000690 RID: 1680 public void StartHostWithPort() { ServerConsole.AddLog("Server starting at port " + base.networkPort); this.StartHost(); } - // Token: 0x06000695 RID: 1685 RVA: 0x0002635C File Offset: 0x0002455C + // Token: 0x06000691 RID: 1681 public int GetFreePort() { string @string = ConfigFile.GetString("port_queue", "7777,7778,7779,7780,7781,7782,7783,7784"); @@ -306,9 +308,12 @@ public int GetFreePort() if (array.Length == 0) { q = "Failed to detect ports."; + throw new Exception(); } + ServerConsole.AddLog("Port queue loaded: " + @string); for (int i = 0; i < array.Length; i++) { + ServerConsole.AddLog("Trying to init port: " + array[i] + "..."); q = "Failed to convert [" + array[i] + "] into integer number!"; base.networkPort = int.Parse(array[i]); if (NetworkServer.Listen(base.networkPort)) @@ -326,9 +331,16 @@ public int GetFreePort() q = "Failed to read config file: " + text; ConfigFile.path = text; ConfigFile.singleton.ReloadConfig(); + ServerConsole.AddLog("Custom config detected, using " + text); + } + else + { + ServerConsole.AddLog("No custom config detected, using config.txt"); } + ServerConsole.AddLog("Done!LOGTYPE-10"); return base.networkPort; } + ServerConsole.AddLog("...failed.LOGTYPE-6"); } } catch @@ -338,53 +350,53 @@ public int GetFreePort() return 7777; } - // Token: 0x040005D8 RID: 1496 + // Token: 0x040005CA RID: 1482 public GameObject popup; - // Token: 0x040005D9 RID: 1497 + // Token: 0x040005CB RID: 1483 public GameObject createpop; - // Token: 0x040005DA RID: 1498 + // Token: 0x040005CC RID: 1484 public RectTransform contSize; - // Token: 0x040005DB RID: 1499 + // Token: 0x040005CD RID: 1485 public Text content; - // Token: 0x040005DC RID: 1500 + // Token: 0x040005CE RID: 1486 public CustomNetworkManager.DisconnectLog[] logs; - // Token: 0x040005DD RID: 1501 + // Token: 0x040005CF RID: 1487 private int curLogID; - // Token: 0x040005DE RID: 1502 + // Token: 0x040005D0 RID: 1488 public bool reconnect; - // Token: 0x040005DF RID: 1503 + // Token: 0x040005D1 RID: 1489 [Space(20f)] public string versionstring; - // Token: 0x040005E0 RID: 1504 + // Token: 0x040005D2 RID: 1490 private GameConsole.Console console; // Token: 0x020000ED RID: 237 [Serializable] public class DisconnectLog { - // Token: 0x040005E1 RID: 1505 + // Token: 0x040005D3 RID: 1491 [Multiline] public string msg_en; - // Token: 0x040005E2 RID: 1506 + // Token: 0x040005D4 RID: 1492 public CustomNetworkManager.DisconnectLog.LogButton button; - // Token: 0x040005E3 RID: 1507 + // Token: 0x040005D5 RID: 1493 public bool autoHideOnSceneLoad; // Token: 0x020000EE RID: 238 [Serializable] public class LogButton { - // Token: 0x040005E4 RID: 1508 + // Token: 0x040005D6 RID: 1494 public ConnInfoButton[] actions; } } From 0d082ef1daa5aee1dee997285196f7999956fb8c Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 20:37:41 -0500 Subject: [PATCH 09/27] Removed Unnecessary Edits --- server_mod/RoundSummary.cs | 300 +------------------------------------ 1 file changed, 4 insertions(+), 296 deletions(-) diff --git a/server_mod/RoundSummary.cs b/server_mod/RoundSummary.cs index 1e07c4c..ef6fe0a 100644 --- a/server_mod/RoundSummary.cs +++ b/server_mod/RoundSummary.cs @@ -1,48 +1,11 @@ using System; -using GameConsole; -using TMPro; -using Unity; using UnityEngine; using UnityEngine.Networking; // Token: 0x020000C0 RID: 192 -public class RoundSummary : NetworkBehaviour +public partial class RoundSummary : NetworkBehaviour { - // Token: 0x060004C4 RID: 1220 RVA: 0x00005226 File Offset: 0x00003426 - private void Awake() - { - Radio.roundEnded = false; - } - - // Token: 0x060004C5 RID: 1221 RVA: 0x0000522E File Offset: 0x0000342E - private void Start() - { - this.pm = PlayerManager.singleton; - this.ccm = base.GetComponent(); - base.InvokeRepeating("CheckForEnding", 12f, 3f); - } - - // Token: 0x060004C6 RID: 1222 RVA: 0x0001DE18 File Offset: 0x0001C018 - private void RoundRestart() - { - bool flag = false; - foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("Player")) - { - PlayerStats component = gameObject.GetComponent(); - if (component.isLocalPlayer && component.isServer) - { - flag = true; - GameConsole.Console.singleton.AddLog("The round is about to restart! Please wait..", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - component.Roundrestart(); - } - } - if (!flag) - { - GameConsole.Console.singleton.AddLog("You're not owner of this server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - - // Token: 0x060004C7 RID: 1223 RVA: 0x0001DEC0 File Offset: 0x0001C0C0 + // Token: 0x060004C3 RID: 1219 RVA: 0x0001A068 File Offset: 0x00018268 public void CheckForEnding() { if (base.isLocalPlayer && base.isServer && !this.roundHasEnded) @@ -59,10 +22,9 @@ public void CheckForEnding() this._SCPs = 0; this._SCPsNozombies = 0; GameObject[] players = this.pm.players; - GameObject[] array = players; - for (int i = 0; i < array.Length; i++) + foreach (GameObject gameObject in players) { - CharacterClassManager component = array[i].GetComponent(); + CharacterClassManager component = gameObject.GetComponent(); if (component.curClass >= 0) { Team team = component.klasy[component.curClass].team; @@ -133,258 +95,4 @@ public void CheckForEnding() } } } - - // Token: 0x060004C8 RID: 1224 RVA: 0x0001E104 File Offset: 0x0001C304 - private void Update() - { - if (RoundSummary.host == null) - { - GameObject gameObject = GameObject.Find("Host"); - if (gameObject != null) - { - RoundSummary.host = gameObject.GetComponent(); - } - } - } - - // Token: 0x060004C9 RID: 1225 RVA: 0x0000525C File Offset: 0x0000345C - [Command(channel = 15)] - private void CmdSetSummary(RoundSummary.Summary sum, int posttime) - { - this.CallRpcSetSummary(sum, posttime); - } - - // Token: 0x060004CA RID: 1226 RVA: 0x0001E144 File Offset: 0x0001C344 - [ClientRpc(channel = 15)] - public void RpcSetSummary(RoundSummary.Summary sum, int posttime) - { - Radio.roundEnded = true; - string text = string.Empty; - string text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.classD_escaped, - "/", - sum.classD_start, - " ", - TranslationReader.Get("Legancy_Interfaces", 3), - "\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scientists_escaped, - "/", - sum.scientists_start, - " ", - TranslationReader.Get("Legancy_Interfaces", 4), - "\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - sum.scp_frags, - " ", - TranslationReader.Get("Legancy_Interfaces", 5), - "\n" - }); - text2 = text; - text = string.Concat(new object[] - { - text2, - "", - Mathf.Clamp(sum.scp_start - sum.scp_alive, 0, sum.scp_start), - "/", - sum.scp_start, - " ", - TranslationReader.Get("Legancy_Interfaces", 6), - "\n" - }); - text2 = text; - text = string.Concat(new string[] - { - text2, - TranslationReader.Get("Legancy_Interfaces", 7), - ": ", - (!sum.warheadDetonated) ? TranslationReader.Get("Legancy_Interfaces", 9) : TranslationReader.Get("Legancy_Interfaces", 8), - "\n\n" - }); - text += TranslationReader.Get("Legancy_Interfaces", 10).Replace("[time]", posttime.ToString()); - GameObject gameObject = UserMainInterface.singleton.summary; - gameObject.SetActive(true); - TextMeshProUGUI component = GameObject.FindGameObjectWithTag("Summary").GetComponent(); - component.text = text; - } - - // Token: 0x060004CB RID: 1227 RVA: 0x00002195 File Offset: 0x00000395 - private void UNetVersion() - { - } - - // Token: 0x060004CC RID: 1228 RVA: 0x00005266 File Offset: 0x00003466 - protected static void InvokeCmdCmdSetSummary(NetworkBehaviour obj, NetworkReader reader) - { - if (!NetworkServer.active) - { - Debug.LogError("Command CmdSetSummary called on client."); - return; - } - ((RoundSummary)obj).CmdSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int)reader.ReadPackedUInt32()); - } - - // Token: 0x060004CD RID: 1229 RVA: 0x0001E378 File Offset: 0x0001C578 - public void CallCmdSetSummary(RoundSummary.Summary sum, int posttime) - { - if (!NetworkClient.active) - { - Debug.LogError("Command function CmdSetSummary called on server."); - return; - } - if (base.isServer) - { - this.CmdSetSummary(sum, posttime); - return; - } - NetworkWriter networkWriter = new NetworkWriter(); - networkWriter.Write(0); - networkWriter.Write((short)((ushort)5)); - networkWriter.WritePackedUInt32((uint)RoundSummary.kCmdCmdSetSummary); - networkWriter.Write(base.GetComponent().netId); - GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); - networkWriter.WritePackedUInt32((uint)posttime); - base.SendCommandInternal(networkWriter, 15, "CmdSetSummary"); - } - - // Token: 0x060004CE RID: 1230 RVA: 0x00005295 File Offset: 0x00003495 - protected static void InvokeRpcRpcSetSummary(NetworkBehaviour obj, NetworkReader reader) - { - if (!NetworkClient.active) - { - Debug.LogError("RPC RpcSetSummary called on server."); - return; - } - ((RoundSummary)obj).RpcSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int)reader.ReadPackedUInt32()); - } - - // Token: 0x060004CF RID: 1231 RVA: 0x0001E410 File Offset: 0x0001C610 - public void CallRpcSetSummary(RoundSummary.Summary sum, int posttime) - { - if (!NetworkServer.active) - { - Debug.LogError("RPC Function RpcSetSummary called on client."); - return; - } - NetworkWriter networkWriter = new NetworkWriter(); - networkWriter.Write(0); - networkWriter.Write((short)((ushort)2)); - networkWriter.WritePackedUInt32((uint)RoundSummary.kRpcRpcSetSummary); - networkWriter.Write(base.GetComponent().netId); - GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); - networkWriter.WritePackedUInt32((uint)posttime); - this.SendRPCInternal(networkWriter, 15, "RpcSetSummary"); - } - - // Token: 0x060004D0 RID: 1232 RVA: 0x0001E490 File Offset: 0x0001C690 - static RoundSummary() - { - NetworkBehaviour.RegisterCommandDelegate(typeof(RoundSummary), RoundSummary.kCmdCmdSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeCmdCmdSetSummary)); - RoundSummary.kRpcRpcSetSummary = -1626633486; - NetworkBehaviour.RegisterRpcDelegate(typeof(RoundSummary), RoundSummary.kRpcRpcSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeRpcRpcSetSummary)); - NetworkCRC.RegisterBehaviour("RoundSummary", 0); - } - - // Token: 0x060004D1 RID: 1233 RVA: 0x0000A490 File Offset: 0x00008690 - public override bool OnSerialize(NetworkWriter writer, bool forceAll) - { - bool result; - return result; - } - - // Token: 0x060004D2 RID: 1234 RVA: 0x00002195 File Offset: 0x00000395 - public override void OnDeserialize(NetworkReader reader, bool initialState) - { - } - - // Token: 0x04000455 RID: 1109 - public bool debugMode; - - // Token: 0x04000456 RID: 1110 - private bool roundHasEnded; - - // Token: 0x04000457 RID: 1111 - private PlayerManager pm; - - // Token: 0x04000458 RID: 1112 - private CharacterClassManager ccm; - - // Token: 0x04000459 RID: 1113 - public static RoundSummary host; - - // Token: 0x0400045A RID: 1114 - public RoundSummary.Summary summary; - - // Token: 0x0400045B RID: 1115 - private int _ClassDs; - - // Token: 0x0400045C RID: 1116 - private int _ChaosInsurgency; - - // Token: 0x0400045D RID: 1117 - private int _MobileForces; - - // Token: 0x0400045E RID: 1118 - private int _Spectators; - - // Token: 0x0400045F RID: 1119 - private int _Scientists; - - // Token: 0x04000460 RID: 1120 - private int _SCPs; - - // Token: 0x04000461 RID: 1121 - private int _SCPsNozombies; - - // Token: 0x04000462 RID: 1122 - private static int kCmdCmdSetSummary = 509590172; - - // Token: 0x04000463 RID: 1123 - private static int kRpcRpcSetSummary; - - // Token: 0x020000C1 RID: 193 - [Serializable] - public class Summary - { - // Token: 0x04000464 RID: 1124 - public int classD_escaped; - - // Token: 0x04000465 RID: 1125 - public int classD_start; - - // Token: 0x04000466 RID: 1126 - public int scientists_escaped; - - // Token: 0x04000467 RID: 1127 - public int scientists_start; - - // Token: 0x04000468 RID: 1128 - public int scp_frags; - - // Token: 0x04000469 RID: 1129 - public int scp_start; - - // Token: 0x0400046A RID: 1130 - public int scp_alive; - - // Token: 0x0400046B RID: 1131 - public int scp_nozombies; - - // Token: 0x0400046C RID: 1132 - public bool warheadDetonated; - } } From 89391de4d0cc9859a80165e49c8cd4c45aa6669a Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Sat, 17 Feb 2018 20:40:09 -0500 Subject: [PATCH 10/27] Updated Scp914_Controller --- server_mod/Scp914_Controller.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server_mod/Scp914_Controller.cs b/server_mod/Scp914_Controller.cs index d9510e7..94ad00a 100644 --- a/server_mod/Scp914_Controller.cs +++ b/server_mod/Scp914_Controller.cs @@ -15,11 +15,12 @@ public void CmdSetupPickup(string label, int result, Vector3 pos) if (gameObject != null) { Pickup pickup = gameObject.GetComponent(); - if (pickup != null) + Pickup pickupParent = gameObject.GetComponentInParent(); + if (pickup != null && pickupParent != null) { pickup.SetDurability(this.avItems[result].durability); - pickup.SetID(result); - pickup.SetPosition(pos); + pickupParent.SetID(result); + pickupParent.SetPosition(pos); } } } From 656049658e6f148dfa65f158acdf306418453300 Mon Sep 17 00:00:00 2001 From: REALM Date: Thu, 22 Feb 2018 14:41:38 +0200 Subject: [PATCH 11/27] conflict fix --- mutliadmin/MultiAdmin/Program.cs | 7 +------ mutliadmin/MultiAdmin/Server.cs | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/mutliadmin/MultiAdmin/Program.cs b/mutliadmin/MultiAdmin/Program.cs index a11e74f..5b67759 100644 --- a/mutliadmin/MultiAdmin/Program.cs +++ b/mutliadmin/MultiAdmin/Program.cs @@ -170,10 +170,6 @@ private static void FixTypo() public static void Main(string[] args) { AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnExit); -<<<<<<< HEAD - multiadminConfig = new MultiAdmin.Config("scp_multiadmin.cfg"); - FindConfig(); -======= FixTypo(); multiadminConfig = new MultiAdmin.Config("scp_multiadmin.cfg"); if (!FindConfig()) @@ -182,7 +178,6 @@ public static void Main(string[] args) return; } ->>>>>>> f86cf09741f51ad0e431ecc84d309b02a30ef3e6 configChain = ""; if (StartHandleConfigs(args)) { @@ -194,4 +189,4 @@ public static void Main(string[] args) } } } -} +} \ No newline at end of file diff --git a/mutliadmin/MultiAdmin/Server.cs b/mutliadmin/MultiAdmin/Server.cs index 9c605dc..1ef029e 100644 --- a/mutliadmin/MultiAdmin/Server.cs +++ b/mutliadmin/MultiAdmin/Server.cs @@ -286,11 +286,7 @@ public Boolean StartServer() string[] files = Directory.GetFiles(Directory.GetCurrentDirectory(), "SCPSL.*", SearchOption.TopDirectoryOnly); Write("Executing: " + files[0], ConsoleColor.DarkGreen); SwapConfigs(); -<<<<<<< HEAD - string args = "-batchmode -nographics -key" + session_id + " -silent-crashes -id" + (object)Process.GetCurrentProcess().Id + " -logFile \"" + logFolder + Utils.GetDate() + "_SCP_output_log.txt" + "\""; -======= string args = "-batchmode -nographics -key" + session_id + " -silent-crashes -id" + (object)Process.GetCurrentProcess().Id + " -logFile \"" + LogFolder + Utils.GetDate() + "_SCP_output_log.txt" + "\""; ->>>>>>> f86cf09741f51ad0e431ecc84d309b02a30ef3e6 Write("Starting server with the following parameters"); Write(files[0] + " " + args); gameProcess = Process.Start(files[0], args); @@ -390,4 +386,4 @@ public void SendMessage(string message) } } -} +} \ No newline at end of file From 1f54d35587179fec6f9ef2b3136af3b33ac2a51c Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 15:21:16 -0500 Subject: [PATCH 12/27] New Config reader + New Commands - New config reader, this now reads the config better, allowing for keys to be contained within other keys, plus it allows for case-insensitive keys. - New GiveAll and GivePlayer commands --- server_mod/CharacterClassManager.cs | 4 +- server_mod/ConfigFile.cs | 112 +++++ server_mod/GameConsole/Console.cs | 747 +++++++++++----------------- server_mod/Inventory.cs | 31 ++ server_mod/Searching.cs | 37 ++ 5 files changed, 463 insertions(+), 468 deletions(-) create mode 100644 server_mod/ConfigFile.cs create mode 100644 server_mod/Inventory.cs create mode 100644 server_mod/Searching.cs diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index 2a05230..a6c2e1c 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -104,9 +104,9 @@ private void Start() this.SetMaxHP(0, "SCP173_HP", 2000); this.SetMaxHP(1, "CLASSD_HP", 100); this.SetMaxHP(3, "SCP106_HP", 700); - this.SetMaxHP(4, "SCIENTIST_HP", 120); // For some reason this and "NTFSCIENTIST_HP" are swapped? + this.SetMaxHP(4, "NTFSCIENTIST_HP", 120); this.SetMaxHP(5, "SCP049_HP", 1200); - this.SetMaxHP(6, "NTFSCIENTIST_HP", 100); + this.SetMaxHP(6, "SCIENTIST_HP", 100); this.SetMaxHP(7, "SCP079_HP", 100); this.SetMaxHP(8, "CI_HP", 120); this.SetMaxHP(9, "SCP096_HP", 2000); diff --git a/server_mod/ConfigFile.cs b/server_mod/ConfigFile.cs new file mode 100644 index 0000000..7c23f89 --- /dev/null +++ b/server_mod/ConfigFile.cs @@ -0,0 +1,112 @@ +using System; +using System.IO; +using GameConsole; +using UnityEngine; + +// Token: 0x0200001C RID: 28 +public class ConfigFile : MonoBehaviour +{ + // Token: 0x0600008B RID: 139 RVA: 0x0000AF80 File Offset: 0x00009180 + private void Awake() + { + ConfigFile.singleton = this; + ConfigFile.path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/SCP Secret Laboratory"; + try + { + if (!Directory.Exists(ConfigFile.path)) + { + Directory.CreateDirectory(ConfigFile.path); + } + } + catch + { + GameConsole.Console.singleton.AddLog("Configuration file directory creation failed.", new Color32(byte.MaxValue, 0, 0, byte.MaxValue), false); + } + ConfigFile.path += "/config.txt"; + } + + // Token: 0x0600008C RID: 140 RVA: 0x0000B00C File Offset: 0x0000920C + private void Start() + { + if (!this.ReloadConfig()) + { + GameConsole.Console.singleton.AddLog("Configuration file could not be loaded - template not found! Loading default settings..", new Color32(byte.MaxValue, 0, 0, byte.MaxValue), false); + GameConsole.Console.singleton.AddLog("Default settings have been loaded.", new Color32(byte.MaxValue, byte.MaxValue, 0, byte.MaxValue), false); + } + } + + // Token: 0x0600008D RID: 141 RVA: 0x0000B068 File Offset: 0x00009268 + public bool ReloadConfig() + { + if (!File.Exists(ConfigFile.path)) + { + try + { + File.Copy("config_template.txt", ConfigFile.path); + } + catch + { + return false; + } + } + StreamReader streamReader = new StreamReader(ConfigFile.path); + this.cfg = streamReader.ReadToEnd(); + streamReader.Close(); + return true; + } + + // Token: 0x0600008E RID: 142 RVA: 0x0000B0C8 File Offset: 0x000092C8 + public static string GetString(string key, string defaultValue = "") + { + string text = ConfigFile.singleton.cfg; + if (text.Contains(key)) + { + try + { + while (!text.ToLower().Replace(" ", "").StartsWith(key.ToLower() + "=")) + { + if (!text.Contains(Environment.NewLine)) + { + return defaultValue; + } + text = text.Remove(0, text.IndexOf(Environment.NewLine) + Environment.NewLine.Length).TrimStart(new char[] + { + ' ' + }); + } + text = text.Remove(0, text.IndexOf("=") + 1); + text = text.TrimStart(new char[] + { + ' ' + }); + return text.Remove(text.IndexOf(";")); + } + catch + { + return defaultValue; + } + return defaultValue; + } + return defaultValue; + } + + // Token: 0x0600008F RID: 143 RVA: 0x0000B1B0 File Offset: 0x000093B0 + public static int GetInt(string key, int defaultValue = 0) + { + int result = 0; + if (int.TryParse(ConfigFile.GetString(key, "errorInConverting"), out result)) + { + return result; + } + return defaultValue; + } + + // Token: 0x0400009C RID: 156 + public static ConfigFile singleton; + + // Token: 0x0400009D RID: 157 + public static string path; + + // Token: 0x0400009E RID: 158 + public string cfg; +} diff --git a/server_mod/GameConsole/Console.cs b/server_mod/GameConsole/Console.cs index f769dd6..393b9d2 100644 --- a/server_mod/GameConsole/Console.cs +++ b/server_mod/GameConsole/Console.cs @@ -1,153 +1,15 @@ -using System; +using System; using System.Collections.Generic; -using System.IO; using UnityEngine; -using UnityEngine.EventSystems; using UnityEngine.Networking; -using UnityEngine.SceneManagement; using UnityEngine.UI; namespace GameConsole { // Token: 0x0200001D RID: 29 - public class Console : MonoBehaviour + public partial class Console : MonoBehaviour { - // Token: 0x06000092 RID: 146 RVA: 0x0000255F File Offset: 0x0000075F - public List GetAllLogs() - { - return this.logs; - } - - // Token: 0x06000093 RID: 147 RVA: 0x0000B20C File Offset: 0x0000940C - public void UpdateValue(string key, string value) - { - bool flag = false; - key = key.ToUpper(); - foreach (Console.Value value2 in this.values) - { - if (value2.key == key) - { - value2.value = value; - flag = true; - } - } - if (!flag) - { - this.values.Add(new Console.Value(key, value)); - } - } - - // Token: 0x06000094 RID: 148 RVA: 0x00002567 File Offset: 0x00000767 - private void Awake() - { - UnityEngine.Object.DontDestroyOnLoad(base.gameObject); - if (Console.singleton == null) - { - Console.singleton = this; - return; - } - UnityEngine.Object.DestroyImmediate(base.gameObject); - } - - // Token: 0x06000095 RID: 149 RVA: 0x0000B290 File Offset: 0x00009490 - private void Start() - { - this.AddLog("Hi there! Initializing console...", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - this.AddLog("Done! Type 'help' to print the list of available commands.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - this.RefreshConsoleScreen(); - } - - // Token: 0x06000096 RID: 150 RVA: 0x0000B2E0 File Offset: 0x000094E0 - private void RefreshConsoleScreen() - { - bool flag = false; - if (this.txt.text.Length > 15000) - { - this.logs.RemoveAt(0); - flag = true; - } - if (this.txt == null) - { - return; - } - this.txt.text = string.Empty; - if (this.logs.Count > 0) - { - for (int i = 0; i < this.logs.Count - this.scrollup; i++) - { - string text = string.Concat(new string[] - { - (!this.logs[i].nospace) ? "\n\n" : "\n", - "", - this.logs[i].text, - "" - }); - if (text.Contains("@#{[")) - { - string str = text.Remove(text.IndexOf("@#{[")); - string text2 = text.Remove(0, text.IndexOf("@#{[") + 4); - text2 = text2.Remove(text2.Length - 12); - foreach (Console.Value value in this.values) - { - if (value.key == text2) - { - text = str + value.value + ""; - } - } - } - Text text3 = this.txt; - text3.text += text; - } - } - if (flag) - { - this.RefreshConsoleScreen(); - } - } - - // Token: 0x06000097 RID: 151 RVA: 0x0000B4AC File Offset: 0x000096AC - public void AddLog(string text, Color32 c, bool nospace = false) - { - this.response = this.response + text + Environment.NewLine; - if (!nospace) - { - this.response += Environment.NewLine; - } - this.scrollup = 0; - this.logs.Add(new Console.Log(text, c, nospace)); - this.RefreshConsoleScreen(); - } - - // Token: 0x06000098 RID: 152 RVA: 0x0000B50C File Offset: 0x0000970C - private string ColorToHex(Color32 color) - { - string str = color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2"); - return "#" + str; - } - - // Token: 0x06000099 RID: 153 RVA: 0x0000B560 File Offset: 0x00009760 - public static GameObject FindConnectedRoot(NetworkConnection conn) - { - try - { - foreach (PlayerController playerController in conn.playerControllers) - { - if (playerController.gameObject.tag == "Player") - { - return playerController.gameObject; - } - } - } - catch - { - return null; - } - return null; - } - - // Token: 0x0600009A RID: 154 RVA: 0x0000B5E4 File Offset: 0x000097E4 + // Token: 0x06000099 RID: 153 RVA: 0x0000B5B0 File Offset: 0x000097B0 public string TypeCommand(string cmd) { try @@ -216,36 +78,223 @@ public string TypeCommand(string cmd) this.AddLog("Second argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } + else if (cmd == "GIVEALL") + { + int num2 = 0; + if (array.Length >= 2 && int.TryParse(array[1], out num2)) + { + string a2 = "offline"; + foreach (GameObject gameObject2 in PlayerManager.singleton.players) + { + a2 = "online"; + CharacterClassManager component2 = gameObject2.GetComponent(); + if (component2 != null && component2.klasy[component2.NetworkcurClass].team != Team.SCP) + { + Inventory component3 = gameObject2.GetComponent(); + if (component3 != null) + { + if (component3.availableItems.Length > num2) + { + Searching component4 = gameObject2.GetComponent(); + if (component4 != null) + { + Locker locker = UnityEngine.Object.FindObjectOfType(); + if (locker != null) + { + if (component3.netFreeSlots > 0) + { + int[] ids = locker.ids; + locker.ids = new int[] + { + num2 + }; + component4.CallCmdPickupItem(locker.gameObject, gameObject2); + locker.SetTaken(false); + locker.ids = ids; + } + else + { + component4.CallCmdPickupItem(locker.gameObject, gameObject2); + locker.SetTaken(false); + component3.CallCmdSetPickup(num2, -4.65664672E+11f, component3.transform.position, component3.transform.rotation, component3.transform.localRotation); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + component3.CallCmdSetPickup(num2, -4.65664672E+11f, component3.transform.position, component3.transform.rotation, component3.transform.localRotation); + component3.netFreeSlots--; + } + } + a2 = "none"; + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - item does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - Player has no inventory!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - Player is an SCP!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a2 = "none"; + } + } + if (a2 == "offline" || a2 == "online") + { + this.AddLog((!(a2 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + else + { + this.AddLog("ITEM#" + num2.ToString("000") + " has been added!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Second argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else if (cmd == "GIVEPLAYER") + { + int num3 = 0; + if (array.Length >= 3 && int.TryParse(array[2], out num3)) + { + string text = array[1]; + string a3 = "offline"; + foreach (GameObject gameObject3 in PlayerManager.singleton.players) + { + a3 = "online"; + CharacterClassManager component5 = gameObject3.GetComponent(); + NicknameSync component6 = gameObject3.GetComponent(); + if (component5 != null && component5.klasy[component5.NetworkcurClass].team != Team.SCP) + { + if (component6 != null) + { + if (component6.NetworkmyNick.ToLower().Contains(text.ToLower())) + { + Inventory component7 = gameObject3.GetComponent(); + if (component7 != null) + { + if (component7.availableItems.Length > num3) + { + Searching component8 = gameObject3.GetComponent(); + if (component8 != null) + { + Locker locker2 = UnityEngine.Object.FindObjectOfType(); + if (locker2 != null) + { + if (component7.netFreeSlots > 0) + { + int[] ids2 = locker2.ids; + locker2.ids = new int[] + { + num3 + }; + component8.CallCmdPickupItem(locker2.gameObject, gameObject3); + locker2.SetTaken(false); + locker2.ids = ids2; + } + else + { + component8.CallCmdPickupItem(locker2.gameObject, gameObject3); + locker2.SetTaken(false); + component7.CallCmdSetPickup(num3, -4.65664672E+11f, component7.transform.position, component7.transform.rotation, component7.transform.localRotation); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + component7.CallCmdSetPickup(num3, -4.65664672E+11f, component7.transform.position, component7.transform.rotation, component7.transform.localRotation); + component7.netFreeSlots--; + } + } + a3 = "none"; + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - item does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player has no inventory!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog(string.Concat(new string[] + { + "Failed to add ITEM#", + num3.ToString("000"), + " - Username doesn't match! (\"", + component6.NetworkmyNick, + "\" against \"", + text, + "\")" + }), new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a3 = "none"; + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player has no nickname!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a3 = "none"; + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player is an SCP!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a3 = "none"; + } + } + if (a3 == "offline" || a3 == "online") + { + this.AddLog((!(a3 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + else + { + this.AddLog("ITEM#" + num3.ToString("000") + " has been added!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Third argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } else if (cmd == "ITEMLIST") { - string a2 = "offline"; - foreach (GameObject gameObject2 in GameObject.FindGameObjectsWithTag("Player")) + string a4 = "offline"; + foreach (GameObject gameObject4 in GameObject.FindGameObjectsWithTag("Player")) { - int num2 = 1; - if (array.Length >= 2 && !int.TryParse(array[1], out num2)) + int num4 = 1; + if (array.Length >= 2 && !int.TryParse(array[1], out num4)) { this.AddLog("Please enter correct page number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); return this.response; } - if (gameObject2.GetComponent().isLocalPlayer) + if (gameObject4.GetComponent().isLocalPlayer) { - a2 = "online"; - Inventory component2 = gameObject2.GetComponent(); - if (component2 != null) + a4 = "online"; + Inventory component9 = gameObject4.GetComponent(); + if (component9 != null) { - a2 = "none"; - if (num2 < 1) + a4 = "none"; + if (num4 < 1) { - this.AddLog("Page '" + num2 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); this.RefreshConsoleScreen(); return this.response; } - Item[] availableItems = component2.availableItems; - for (int j = 10 * (num2 - 1); j < 10 * num2; j++) + Item[] availableItems = component9.availableItems; + for (int j = 10 * (num4 - 1); j < 10 * num4; j++) { - if (10 * (num2 - 1) > availableItems.Length) + if (10 * (num4 - 1) > availableItems.Length) { - this.AddLog("Page '" + num2 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); break; } if (j >= availableItems.Length) @@ -257,9 +306,9 @@ public string TypeCommand(string cmd) } } } - if (a2 != "none") + if (a4 != "none") { - this.AddLog((!(a2 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog((!(a4 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } else if (cmd == "CLS" || cmd == "CLEAR") @@ -315,20 +364,20 @@ public string TypeCommand(string cmd) else { bool flag = false; - string text = array[1]; + string text2 = array[1]; using (List.Enumerator enumerator = this.values.GetEnumerator()) { while (enumerator.MoveNext()) { - if (enumerator.Current.key == text) + if (enumerator.Current.key == text2) { flag = true; this.AddLog(string.Concat(new string[] { "The value of ", - text, + text2, " is: @#{[", - text, + text2, "}]#@" }), new Color32(50, 70, 100, byte.MaxValue), false); } @@ -336,27 +385,27 @@ public string TypeCommand(string cmd) } if (!flag) { - this.AddLog("Key " + text + " not found!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Key " + text2 + " not found!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } } else if (cmd == "SEED") { - GameObject gameObject3 = GameObject.Find("Host"); - int num3 = -1; - if (gameObject3 != null) + GameObject gameObject5 = GameObject.Find("Host"); + int num5 = -1; + if (gameObject5 != null) { - num3 = gameObject3.GetComponent().seed; + num5 = gameObject5.GetComponent().seed; } - this.AddLog("Map seed is: " + ((num3 != -1) ? num3.ToString() : "NONE") + "", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + this.AddLog("Map seed is: " + ((num5 != -1) ? num5.ToString() : "NONE") + "", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); } else if (cmd == "SHOWRIDS") { GameObject[] array4 = GameObject.FindGameObjectsWithTag("RoomID"); - foreach (GameObject gameObject4 in array4) + foreach (GameObject gameObject6 in array4) { - gameObject4.GetComponentsInChildren()[0].enabled = !gameObject4.GetComponentsInChildren()[0].enabled; - gameObject4.GetComponentsInChildren()[1].enabled = !gameObject4.GetComponentsInChildren()[1].enabled; + gameObject6.GetComponentsInChildren()[0].enabled = !gameObject6.GetComponentsInChildren()[0].enabled; + gameObject6.GetComponentsInChildren()[1].enabled = !gameObject6.GetComponentsInChildren()[1].enabled; } if (array4.Length != 0) { @@ -369,34 +418,34 @@ public string TypeCommand(string cmd) } else if (cmd == "CLASSLIST") { - string a3 = "offline"; - foreach (GameObject gameObject5 in GameObject.FindGameObjectsWithTag("Player")) + string a5 = "offline"; + foreach (GameObject gameObject7 in GameObject.FindGameObjectsWithTag("Player")) { - int num4 = 1; - if (array.Length >= 2 && !int.TryParse(array[1], out num4)) + int num6 = 1; + if (array.Length >= 2 && !int.TryParse(array[1], out num6)) { this.AddLog("Please enter correct page number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); return this.response; } - if (gameObject5.GetComponent().isLocalPlayer) + if (gameObject7.GetComponent().isLocalPlayer) { - a3 = "online"; - CharacterClassManager component3 = gameObject5.GetComponent(); - if (component3 != null) + a5 = "online"; + CharacterClassManager component10 = gameObject7.GetComponent(); + if (component10 != null) { - a3 = "none"; - if (num4 < 1) + a5 = "none"; + if (num6 < 1) { - this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num6 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); this.RefreshConsoleScreen(); return this.response; } - Class[] klasy = component3.klasy; - for (int k = 10 * (num4 - 1); k < 10 * num4; k++) + Class[] klasy = component10.klasy; + for (int k = 10 * (num6 - 1); k < 10 * num6; k++) { - if (10 * (num4 - 1) > klasy.Length) + if (10 * (num6 - 1) > klasy.Length) { - this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num6 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); break; } if (k >= klasy.Length) @@ -408,46 +457,46 @@ public string TypeCommand(string cmd) } } } - if (a3 != "none") + if (a5 != "none") { - this.AddLog((!(a3 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog((!(a5 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } else if (cmd == "GOTO") { if (array.Length >= 2) { - GameObject gameObject6 = null; - foreach (GameObject gameObject7 in GameObject.FindGameObjectsWithTag("RoomID")) + GameObject gameObject8 = null; + foreach (GameObject gameObject9 in GameObject.FindGameObjectsWithTag("RoomID")) { - if (gameObject7.GetComponent().id.ToUpper() == array[1].ToUpper()) + if (gameObject9.GetComponent().id.ToUpper() == array[1].ToUpper()) { - gameObject6 = gameObject7; + gameObject8 = gameObject9; } } - string a4 = "offline"; - if (gameObject6 != null) + string a6 = "offline"; + if (gameObject8 != null) { - foreach (GameObject gameObject8 in GameObject.FindGameObjectsWithTag("Player")) + foreach (GameObject gameObject10 in GameObject.FindGameObjectsWithTag("Player")) { - if (gameObject8.GetComponent().isLocalPlayer) + if (gameObject10.GetComponent().isLocalPlayer) { - if (array[1].ToUpper() == "RANGE" && !gameObject8.GetComponent().isOnRange) + if (array[1].ToUpper() == "RANGE" && !gameObject10.GetComponent().isOnRange) { - a4 = "range"; + a6 = "range"; } else { - a4 = "none"; - gameObject8.transform.position = gameObject6.transform.position; + a6 = "none"; + gameObject10.transform.position = gameObject8.transform.position; } } } - if (a4 == "range") + if (a6 == "range") { this.AddLog("Shooting range is disabled!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } - else if (a4 == "offline") + else if (a6 == "offline") { this.AddLog("You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } @@ -469,23 +518,23 @@ public string TypeCommand(string cmd) } else if (cmd == "RANGE") { - string a5 = "offline"; - foreach (GameObject gameObject9 in GameObject.FindGameObjectsWithTag("Player")) + string a7 = "offline"; + foreach (GameObject gameObject11 in GameObject.FindGameObjectsWithTag("Player")) { - if (gameObject9.GetComponent().isLocalPlayer) + if (gameObject11.GetComponent().isLocalPlayer) { - a5 = "online"; - ShootingRange component4 = gameObject9.GetComponent(); - if (component4 != null) + a7 = "online"; + ShootingRange component11 = gameObject11.GetComponent(); + if (component11 != null) { - a5 = "none"; - component4.isOnRange = true; + a7 = "none"; + component11.isOnRange = true; } } } - if (a5 == "offline" || a5 == "online") + if (a7 == "offline" || a7 == "online") { - this.AddLog((!(a5 == "offline")) ? "Player range script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog((!(a7 == "offline")) ? "Player range script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } else { @@ -495,15 +544,15 @@ public string TypeCommand(string cmd) else if (cmd == "ROUNDRESTART") { bool flag2 = false; - GameObject[] array2 = GameObject.FindGameObjectsWithTag("Player"); - for (int i = 0; i < array2.Length; i++) + GameObject[] array5 = GameObject.FindGameObjectsWithTag("Player"); + for (int l = 0; l < array5.Length; l++) { - PlayerStats component5 = array2[i].GetComponent(); - if (component5.isLocalPlayer && component5.isServer) + PlayerStats component12 = array5[l].GetComponent(); + if (component12.isLocalPlayer && component12.isServer) { flag2 = true; this.AddLog("The round is about to restart! Please wait..", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - component5.Roundrestart(); + component12.Roundrestart(); } } if (!flag2) @@ -519,14 +568,14 @@ public string TypeCommand(string cmd) } else { - string text2 = array[1]; - if (text2 != null) + string text3 = array[1]; + if (text3 != null) { - if (!(text2 == "RELOAD") && !(text2 == "R") && !(text2 == "RLD")) + if (!(text3 == "RELOAD") && !(text3 == "R") && !(text3 == "RLD")) { - if (!(text2 == "PATH")) + if (!(text3 == "PATH")) { - if (text2 == "VALUE") + if (text3 == "VALUE") { if (array.Length < 3) { @@ -568,22 +617,22 @@ public string TypeCommand(string cmd) while (enumerator2.MoveNext()) { NetworkConnection networkConnection = enumerator2.Current; - string text3 = string.Empty; - GameObject gameObject10 = Console.FindConnectedRoot(networkConnection); - if (gameObject10 != null) + string text4 = string.Empty; + GameObject gameObject12 = Console.FindConnectedRoot(networkConnection); + if (gameObject12 != null) { - text3 = gameObject10.GetComponent().myNick; + text4 = gameObject12.GetComponent().myNick; } - if (text3 == string.Empty) + if (text4 == string.Empty) { this.AddLog("Player :: " + networkConnection.address, new Color32(160, 128, 128, byte.MaxValue), true); } else { - this.AddLog("Player :: " + text3 + " :: " + networkConnection.address, new Color32(128, 160, 128, byte.MaxValue), true); + this.AddLog("Player :: " + text4 + " :: " + networkConnection.address, new Color32(128, 160, 128, byte.MaxValue), true); } } - goto IL_1332; + goto IL_1AE6; } } int duration = 0; @@ -592,8 +641,8 @@ public string TypeCommand(string cmd) bool flag3 = false; foreach (NetworkConnection networkConnection2 in NetworkServer.connections) { - GameObject gameObject11 = Console.FindConnectedRoot(networkConnection2); - if (networkConnection2.address.ToUpper().Contains(array[1]) || (gameObject11 != null && gameObject11.GetComponent().myNick.ToUpper().Contains(array[1]))) + GameObject gameObject13 = Console.FindConnectedRoot(networkConnection2); + if (networkConnection2.address.ToUpper().Contains(array[1]) || (gameObject13 != null && gameObject13.GetComponent().myNick.ToUpper().Contains(array[1]))) { flag3 = true; BanPlayer.BanConnection(networkConnection2, duration); @@ -630,242 +679,8 @@ public string TypeCommand(string cmd) { this.AddLog("Command " + cmd + " does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } - IL_1332: + IL_1AE6: return this.response; } - - // Token: 0x0600009B RID: 155 RVA: 0x0000C960 File Offset: 0x0000AB60 - public void ProceedButton() - { - if (this.cmdField.text != string.Empty) - { - this.TypeCommand(this.cmdField.text); - } - this.cmdField.text = string.Empty; - EventSystem.current.SetSelectedGameObject(this.cmdField.gameObject); - } - - // Token: 0x0600009C RID: 156 RVA: 0x0000C9BC File Offset: 0x0000ABBC - private void LateUpdate() - { - if (Input.GetKeyDown(KeyCode.Return)) - { - this.ProceedButton(); - } - if (Input.GetKeyDown(KeyCode.BackQuote)) - { - this.ToggleConsole(); - } - this.scrollup += Mathf.RoundToInt(Input.GetAxisRaw("Mouse ScrollWheel") * 10f); - if (this.logs.Count > 0) - { - this.scrollup = Mathf.Clamp(this.scrollup, 0, this.logs.Count - 1); - } - else - { - this.scrollup = 0; - } - if (this.previous_scrlup != this.scrollup) - { - this.previous_scrlup = this.scrollup; - this.RefreshConsoleScreen(); - } - Scene activeScene = SceneManager.GetActiveScene(); - if (activeScene.name != this.loadedLevel) - { - this.loadedLevel = activeScene.name; - this.AddLog(string.Concat(new string[] - { - "Scene Manager: Loaded scene '", - activeScene.name, - "' [", - activeScene.path, - "]" - }), new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - this.RefreshConsoleScreen(); - } - if (this.allwaysRefreshing) - { - this.RefreshConsoleScreen(); - } - } - - // Token: 0x0600009D RID: 157 RVA: 0x0000CAEC File Offset: 0x0000ACEC - public void ToggleConsole() - { - CursorManager.consoleOpen = !this.console.activeSelf; - this.cmdField.text = string.Empty; - this.console.SetActive(!this.console.activeSelf); - if (PlayerManager.singleton != null) - { - foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("Player")) - { - if (gameObject.GetComponent().isLocalPlayer) - { - FirstPersonController component = gameObject.GetComponent(); - if (component != null) - { - component.usingConsole = this.console.activeSelf; - } - } - } - } - if (this.console.activeSelf) - { - EventSystem.current.SetSelectedGameObject(this.cmdField.gameObject); - } - } - - // Token: 0x0600009E RID: 158 RVA: 0x00002593 File Offset: 0x00000793 - private void QuitGame() - { - Application.Quit(); - } - - // Token: 0x0600009F RID: 159 RVA: 0x0000CBB0 File Offset: 0x0000ADB0 - public void DumpGameObjStats() - { - GameObject[] array = UnityEngine.Object.FindObjectsOfType(); - Dictionary dictionary = new Dictionary(); - foreach (GameObject gameObject in array) - { - int num; - dictionary.TryGetValue(gameObject.name.Trim(), out num); - num++; - dictionary.Add(gameObject.name.Trim(), num); - ServerConsole.AddLog(gameObject.name.Trim() + " " + num); - } - string text = "C:\\dev\\unity-scene_stats.txt"; - ServerConsole.AddLog("Dumping scene stats to " + text + " ..."); - using (StreamWriter streamWriter = new StreamWriter(text, false)) - { - foreach (KeyValuePair keyValuePair in dictionary) - { - streamWriter.WriteLine("{0}={1}", keyValuePair.Key, keyValuePair.Value); - } - } - ServerConsole.AddLog("Scene dumped to " + text); - } - - // Token: 0x060000A0 RID: 160 RVA: 0x0000CCD4 File Offset: 0x0000AED4 - public void GetStats(string parent, Component obj, Dictionary dictionary) - { - string key = parent + "_" + obj.GetType().Name; - int num = 0; - dictionary.TryGetValue(key, out num); - dictionary.Add(parent + obj.tag, num++); - } - - // Token: 0x060000A1 RID: 161 RVA: 0x0000CD1C File Offset: 0x0000AF1C - public void GetStats(string parent, GameObject obj, Dictionary dictionary, HashSet done) - { - if (done.Contains(obj.GetInstanceID())) - { - return; - } - string text = parent + "_" + obj.name; - int num = 0; - dictionary.TryGetValue(text, out num); - dictionary.Add(parent + obj.tag, num++); - done.Add(obj.GetInstanceID()); - foreach (Component component in base.gameObject.GetComponents()) - { - if (!(component == obj)) - { - this.GetStats(text, component, dictionary); - } - } - } - - // Token: 0x0400009F RID: 159 - private bool allwaysRefreshing; - - // Token: 0x040000A0 RID: 160 - private List logs = new List(); - - // Token: 0x040000A1 RID: 161 - private List values = new List(); - - // Token: 0x040000A2 RID: 162 - public Console.CommandHint[] hints; - - // Token: 0x040000A3 RID: 163 - public Text txt; - - // Token: 0x040000A4 RID: 164 - public InputField cmdField; - - // Token: 0x040000A5 RID: 165 - public GameObject console; - - // Token: 0x040000A6 RID: 166 - public static Console singleton; - - // Token: 0x040000A7 RID: 167 - private int scrollup; - - // Token: 0x040000A8 RID: 168 - private int previous_scrlup; - - // Token: 0x040000A9 RID: 169 - private string loadedLevel; - - // Token: 0x040000AA RID: 170 - private string response = string.Empty; - - // Token: 0x0200001E RID: 30 - [Serializable] - public class CommandHint - { - // Token: 0x040000AB RID: 171 - public string name; - - // Token: 0x040000AC RID: 172 - public string shortDesc; - - // Token: 0x040000AD RID: 173 - [Multiline] - public string fullDesc; - } - - // Token: 0x0200001F RID: 31 - [Serializable] - public class Value - { - // Token: 0x060000A3 RID: 163 RVA: 0x0000259A File Offset: 0x0000079A - public Value(string k, string v) - { - this.key = k; - this.value = v; - } - - // Token: 0x040000AE RID: 174 - public string key; - - // Token: 0x040000AF RID: 175 - public string value; - } - - // Token: 0x02000020 RID: 32 - [Serializable] - public class Log - { - // Token: 0x060000A4 RID: 164 RVA: 0x000025B0 File Offset: 0x000007B0 - public Log(string t, Color32 c, bool b) - { - this.text = t; - this.color = c; - this.nospace = b; - } - - // Token: 0x040000B0 RID: 176 - public string text; - - // Token: 0x040000B1 RID: 177 - public Color32 color; - - // Token: 0x040000B2 RID: 178 - public bool nospace; - } } } diff --git a/server_mod/Inventory.cs b/server_mod/Inventory.cs new file mode 100644 index 0000000..19d9e5e --- /dev/null +++ b/server_mod/Inventory.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Networking; +using UnityEngine.UI; + +// Token: 0x02000092 RID: 146 +public partial class Inventory : NetworkBehaviour +{ + // Token: 0x06000348 RID: 840 RVA: 0x000181B8 File Offset: 0x000163B8 + [Command(channel = 2)] + public void CmdSetPickup(int dropedItemID, float dur, Vector3 pos, Quaternion camRot, Quaternion myRot) + { + GameObject gameObject = UnityEngine.Object.Instantiate(this.pickupPrefab); + NetworkServer.Spawn(gameObject); + gameObject.GetComponent().SetDurability(dur); + gameObject.GetComponent().SetID(dropedItemID); + gameObject.GetComponent().SetPosition(((this.ccm.curClass != 2) ? pos : this.ccm.deathPosition) + Vector3.up * 0.9f); + gameObject.GetComponent().SetRotation(new Vector3(camRot.eulerAngles.x, myRot.eulerAngles.y, 0f)); + gameObject.GetComponent().SetName(string.Concat(new object[] + { + "PICKUP#", + dropedItemID, + ":", + UnityEngine.Random.Range(0f, 1E+10f).ToString("0000000000") + })); + this.netFreeSlots++; + } + + public int netFreeSlots; +} diff --git a/server_mod/Searching.cs b/server_mod/Searching.cs new file mode 100644 index 0000000..e7ccc64 --- /dev/null +++ b/server_mod/Searching.cs @@ -0,0 +1,37 @@ +using System; +using UnityEngine; +using UnityEngine.Networking; +using UnityEngine.UI; + +// Token: 0x020000D7 RID: 215 +public partial class Searching : NetworkBehaviour +{ + // Token: 0x060005E6 RID: 1510 RVA: 0x000236B0 File Offset: 0x000218B0 + [Command(channel = 2)] + public void CmdPickupItem(GameObject t, GameObject taker) + { + int id = 0; + Pickup component = t.GetComponent(); + Inventory component2 = taker.GetComponent(); + if (component != null) + { + id = component.id; + component.PickupItem(); + if (component2 != null) + { + component2.netFreeSlots--; + } + } + Locker component3 = t.GetComponent(); + if (component3 != null) + { + id = component3.GetItem(); + component3.SetTaken(true); + if (component2 != null) + { + component2.netFreeSlots--; + } + } + this.CallRpcPickupItem(taker, id, (!(t.GetComponent() == null)) ? component.durability : -1f); + } +} From 22937197af305784f95c36f6c0fd305850a7f856 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 19:47:16 -0500 Subject: [PATCH 13/27] Clean up everything - Cleaned up as much code as I could for now - Added "GetBool" function to ConfigFile - Merged with Grover-c13's code to make it more compatible - Removed unneccesary files - Renamed incorrectly named files - Added "FORCE_DISABLE_ENABLE" Config option, this can force enable or force disable SCPs (Overrides default ban value with chosen values) --- .../AlphaWarheadDetonationController.cs | 80 +- server_mod/AnimationController.cs | 2 - .../CharacterClassManager Get Class List.txt | 15 - server_mod/CharacterClassManager Max HP.txt | 13 - server_mod/CharacterClassManager.cs | 475 ++++----- server_mod/ConfigFile.cs | 80 +- server_mod/CursorManager.cs | 14 +- server_mod/CustomNetworkManager.cs | 149 ++- server_mod/GameConsole/Console.cs | 934 ++++++++++++------ server_mod/Inventory.cs | 6 +- server_mod/RadioInitializator.cs | 2 - server_mod/ResolutionManager.cs | 21 +- server_mod/RoundSummary.cs | 300 +++++- server_mod/Scp914_Controller.cs | 35 +- server_mod/Searching.cs | 4 +- server_mod/ServerConsole.cs | 10 +- 16 files changed, 1359 insertions(+), 781 deletions(-) delete mode 100644 server_mod/CharacterClassManager Get Class List.txt delete mode 100644 server_mod/CharacterClassManager Max HP.txt diff --git a/server_mod/AlphaWarheadDetonationController.cs b/server_mod/AlphaWarheadDetonationController.cs index 0cc48da..934ee2a 100644 --- a/server_mod/AlphaWarheadDetonationController.cs +++ b/server_mod/AlphaWarheadDetonationController.cs @@ -2,10 +2,8 @@ using UnityEngine; using UnityEngine.Networking; -// Token: 0x0200006D RID: 109 public class AlphaWarheadDetonationController : NetworkBehaviour { - // Token: 0x060001F8 RID: 504 public void StartDetonation() { float elapsed = Time.time - this.smCharacterClassManager.smRoundStartTime; @@ -19,7 +17,6 @@ public void StartDetonation() this.smStartTime = Time.time; } - // Token: 0x060001F9 RID: 505 public void CancelDetonation() { float elapsed = Time.time - this.smStartTime; @@ -30,7 +27,6 @@ public void CancelDetonation() } } - // Token: 0x060001FA RID: 506 RVA: 0x00011D20 File Offset: 0x0000FF20 private void FixedUpdate() { if (base.isLocalPlayer && this.awdc != null && this.lightStatus != (this.awdc.detonationTime != 0f)) @@ -46,6 +42,7 @@ private void FixedUpdate() } if (this.detonationTime > 0f) { + this.detonated = false; this.NetworkdetonationTime = this.detonationTime - Time.deltaTime; if (!this.lever.GetState()) { @@ -54,12 +51,12 @@ private void FixedUpdate() if (this.detonationTime < 83f && !this.doorsOpen && base.isLocalPlayer) { this.doorsOpen = true; - this.OpenDoors(); + this.CmdOpenDoors(); } if (this.detonationTime < 2f && !this.blastDoors && this.detonationInProgress && base.isLocalPlayer) { this.blastDoors = true; - this.CloseBlastDoors(); + this.CmdCloseBlastDoors(); } } else @@ -96,16 +93,14 @@ private void FixedUpdate() } } - // Token: 0x060001FB RID: 507 RVA: 0x00003298 File Offset: 0x00001498 private void Explode() { this.detonated = true; this.ExplodePlayers(); } - // Token: 0x060001FC RID: 508 RVA: 0x00011F18 File Offset: 0x00010118 [ServerCallback] - private void OpenDoors() + private void CmdOpenDoors() { if (!NetworkServer.active) { @@ -113,14 +108,23 @@ private void OpenDoors() } foreach (Door door in UnityEngine.Object.FindObjectsOfType()) { - if (!door.isOpen && !door.permissionLevel.Contains("CONT") && door.permissionLevel != "UNACCESSIBLE") + /* + * Old version is missing the checks for + * + * ... !door.permissionLevel.Contains("CONT") && door.permissionLevel != "UNACCESSIBLE" ... + */ + if (!door.isOpen && !door.permissionLevel.Contains("CONT") && door.permissionLevel != "UNACCESSIBLE") { - door.OpenWarhead(); + /* + * New update uses this code, is it a more standardized / labelled way of opening the warhead room door? + * + * door.OpenWarhead(); + */ + door.GetComponent().SetState(true); } } } - // Token: 0x060001FD RID: 509 RVA: 0x00011F78 File Offset: 0x00010178 [ServerCallback] private void ExplodePlayers() { @@ -128,19 +132,29 @@ private void ExplodePlayers() { return; } - GameObject[] array = GameObject.FindGameObjectsWithTag("LiftTarget"); - foreach (GameObject gameObject in PlayerManager.singleton.players) + + /* + * New update uses this code, try and find what difference it makes? + * + * GameObject[] array = GameObject.FindGameObjectsWithTag("LiftTarget"); + * foreach (GameObject gameObject in PlayerManager.singleton.players) + * { + * foreach (GameObject gameObject2 in array) + * { + * gameObject.GetComponent().Explode(Vector3.Distance(gameObject2.transform.position, gameObject.transform.position) < 3.5f); + * } + * } + */ + + GameObject[] players = PlayerManager.singleton.players; + for (int i = 0; i < players.Length; i++) { - foreach (GameObject gameObject2 in array) - { - gameObject.GetComponent().Explode(Vector3.Distance(gameObject2.transform.position, gameObject.transform.position) < 3.5f); - } + players[i].GetComponent().Explode(); } } - // Token: 0x060001FE RID: 510 RVA: 0x00012000 File Offset: 0x00010200 [ServerCallback] - private void CloseBlastDoors() + private void CmdCloseBlastDoors() { if (!NetworkServer.active) { @@ -153,7 +167,6 @@ private void CloseBlastDoors() } } - // Token: 0x060001FF RID: 511 RVA: 0x000032A7 File Offset: 0x000014A7 [ClientCallback] private void TransmitData(float t) { @@ -164,7 +177,6 @@ private void TransmitData(float t) this.CmdSyncData(t); } - // Token: 0x06000200 RID: 512 RVA: 0x000032B8 File Offset: 0x000014B8 [ServerCallback] private void CmdSyncData(float t) { @@ -175,7 +187,6 @@ private void CmdSyncData(float t) this.NetworkdetonationTime = t; } - // Token: 0x06000201 RID: 513 RVA: 0x00012034 File Offset: 0x00010234 private void Start() { this.smCharacterClassManager = base.GetComponent(); @@ -189,7 +200,6 @@ private void Start() } } - // Token: 0x06000202 RID: 514 RVA: 0x000120A0 File Offset: 0x000102A0 private void SetLights(bool b) { ToggleableLight[] array = this.lights; @@ -199,14 +209,10 @@ private void SetLights(bool b) } } - // Token: 0x06000203 RID: 515 RVA: 0x00002195 File Offset: 0x00000395 private void UNetVersion() { } - // Token: 0x17000032 RID: 50 - // (get) Token: 0x06000204 RID: 516 RVA: 0x000032C9 File Offset: 0x000014C9 - // (set) Token: 0x06000205 RID: 517 RVA: 0x000032D1 File Offset: 0x000014D1 public float NetworkdetonationTime { get @@ -219,7 +225,6 @@ public float NetworkdetonationTime } } - // Token: 0x06000206 RID: 518 RVA: 0x000120CC File Offset: 0x000102CC public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) @@ -244,7 +249,6 @@ public override bool OnSerialize(NetworkWriter writer, bool forceAll) return flag; } - // Token: 0x06000207 RID: 519 RVA: 0x000032E1 File Offset: 0x000014E1 public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) @@ -258,52 +262,36 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } - // Token: 0x0400022B RID: 555 [SyncVar] public float detonationTime; - // Token: 0x0400022C RID: 556 private bool detonationInProgress; - // Token: 0x0400022D RID: 557 private bool detonated; - // Token: 0x0400022E RID: 558 private bool doorsOpen; - // Token: 0x0400022F RID: 559 private bool blastDoors; - // Token: 0x04000230 RID: 560 private GameObject host; - // Token: 0x04000231 RID: 561 private bool lightStatus; - // Token: 0x04000232 RID: 562 private AWSoundController awsc; - // Token: 0x04000233 RID: 563 private LeverButton lever; - // Token: 0x04000234 RID: 564 private AlphaWarheadDetonationController awdc; - // Token: 0x04000235 RID: 565 private ToggleableLight[] lights; - // Token: 0x04000236 RID: 566 private float smStartTime; - // Token: 0x04000237 RID: 567 private int smCooldown; - // Token: 0x04000238 RID: 568 private int smNukeActivationMinTime; - // Token: 0x04000239 RID: 569 private CharacterClassManager smCharacterClassManager; - // Token: 0x0400023A RID: 570 public bool smDetonated; } diff --git a/server_mod/AnimationController.cs b/server_mod/AnimationController.cs index 1f2e5f9..8669c64 100644 --- a/server_mod/AnimationController.cs +++ b/server_mod/AnimationController.cs @@ -3,10 +3,8 @@ using UnityEngine; using UnityEngine.Networking; -// Token: 0x02000062 RID: 98 public partial class AnimationController : NetworkBehaviour { - // Token: 0x060001B0 RID: 432 public void DoAnimation(string trigger) { if (!base.isLocalPlayer && this.handAnimator != null) diff --git a/server_mod/CharacterClassManager Get Class List.txt b/server_mod/CharacterClassManager Get Class List.txt deleted file mode 100644 index 10cf129..0000000 --- a/server_mod/CharacterClassManager Get Class List.txt +++ /dev/null @@ -1,15 +0,0 @@ - int classID = 0; - foreach (Class curClass in this.klasy) - { - ServerConsole.AddLog(string.Concat(new object[] - { - "Class #", - classID, - ": ", - curClass.fullName, - " - ", - curClass.maxHP, - "HP" - })); - classID++; - } \ No newline at end of file diff --git a/server_mod/CharacterClassManager Max HP.txt b/server_mod/CharacterClassManager Max HP.txt deleted file mode 100644 index f412ab6..0000000 --- a/server_mod/CharacterClassManager Max HP.txt +++ /dev/null @@ -1,13 +0,0 @@ - this.SetMaxHP(0, "SCP173_HP", 2000); - this.SetMaxHP(1, "CLASSD_HP", 100); - this.SetMaxHP(3, "SCP106_HP", 700); - this.SetMaxHP(4, "NTFSCIENTIST_HP", 120); - this.SetMaxHP(5, "SCP049_HP", 1200); - this.SetMaxHP(6, "SCIENTIST_HP", 100); - this.SetMaxHP(7, "SCP079_HP", 100); - this.SetMaxHP(8, "CI_HP", 120); - this.SetMaxHP(9, "SCP096_HP", 2000); - this.SetMaxHP(10, "SCP049-2_HP", 400); - this.SetMaxHP(11, "NTFL_HP", 120); - this.SetMaxHP(12, "NTFC_HP", 150); - this.SetMaxHP(13, "NTFG_HP", 100); \ No newline at end of file diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index a6c2e1c..c064f26 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -7,22 +7,18 @@ using UnityEngine.Networking; using UnityEngine.PostProcessing; -// Token: 0x02000078 RID: 120 public class CharacterClassManager : NetworkBehaviour { - // Token: 0x0600025C RID: 604 RVA: 0x000035F9 File Offset: 0x000017F9 public void SetUnit(int unit) { this.NetworkntfUnit = unit; } - // Token: 0x0600025D RID: 605 RVA: 0x00003602 File Offset: 0x00001802 public void SyncDeathPos(Vector3 v) { this.NetworkdeathPosition = v; } - // Token: 0x0600025E RID: 606 RVA: 0x00013648 File Offset: 0x00011848 [ServerCallback] public void AllowContain() { @@ -49,80 +45,118 @@ public void AllowContain() } } - // Token: 0x0600025F RID: 607 RVA: 0x00013704 File Offset: 0x00011904 private void Start() { - if (base.isLocalPlayer) - { - for (int i = 0; i < this.klasy.Length; i++) - { - this.klasy[i].fullName = TranslationReader.Get("Class_Names", i); - this.klasy[i].description = TranslationReader.Get("Class_Descriptions", i); - } - CharacterClassManager.staticClasses = this.klasy; - } - else if (CharacterClassManager.staticClasses == null || CharacterClassManager.staticClasses.Length == 0) - { - for (int j = 0; j < this.klasy.Length; j++) - { - this.klasy[j].description = TranslationReader.Get("Class_Descriptions", j); - this.klasy[j].fullName = TranslationReader.Get("Class_Names", j); - } - } - else - { - this.klasy = CharacterClassManager.staticClasses; - } - this.lureSpj = UnityEngine.Object.FindObjectOfType(); + // Code for using translation files + if (CharacterClassManager.staticClasses == null || CharacterClassManager.staticClasses.Length <= 0) + { + for (int curClass = 0; curClass < this.klasy.Length; curClass++) + { + this.klasy[curClass].fullName = TranslationReader.Get("Class_Names", curClass); + this.klasy[curClass].description = TranslationReader.Get("Class_Descriptions", curClass); + } + + CharacterClassManager.staticClasses = this.klasy; + } + else + { + this.klasy = CharacterClassManager.staticClasses; + } + + this.lureSpj = UnityEngine.Object.FindObjectOfType(); + this.scp049 = base.GetComponent(); this.scp049_2 = base.GetComponent(); - this.scp096 = base.GetComponent(); this.scp079 = base.GetComponent(); - this.scp106 = base.GetComponent(); + + /* + * The script for this already exists in game, this allows for it to be loaded anyways + * (Prepare for future updates, am I right?) + */ + this.scp096 = base.GetComponent(); + + this.scp106 = base.GetComponent(); this.scp173 = base.GetComponent(); + this.forceClass = ConfigFile.GetInt("server_forced_class", -1); - this.smBanComputerFirstPick = (ConfigFile.GetString("NO_SCP079_FIRST", "true").ToLower() == "true"); - this.ciPercentage = (float)ConfigFile.GetInt("ci_on_start_percent", 10); + this.smBanComputerFirstPick = ConfigFile.GetBool("NO_SCP079_FIRST", true); + this.ciPercentage = (float) ConfigFile.GetInt("ci_on_start_percent", 10); this.smStartRoundTimer = ConfigFile.GetInt("START_ROUND_TIMER", 20); this.smWaitForPlayers = ConfigFile.GetInt("START_ROUND_MINIMUM_PLAYERS", 2) - 1; base.StartCoroutine("Init"); - string text = ConfigFile.GetString("team_respawn_queue", "401431403144144") + "..........................."; + + /* + * Original code had unneccesary "."s + * + * ... + "..........................." ... + */ + string teamRespawnQueue = ConfigFile.GetString("team_respawn_queue", "401431403144144"); this.classTeamQueue.Clear(); - for (int k = 0; k < text.Length; k++) + + // Loops through each number from "teamRespawnQueue" and adds to the team respawn queue (Defaulting to team 4, NTF) + for (int i = 0; i < teamRespawnQueue.Length; i++) { int item = 4; - if (!int.TryParse(text[k].ToString(), out item)) + if (!int.TryParse(teamRespawnQueue[i].ToString(), out item)) { item = 4; } - this.classTeamQueue.Add((Team)item); + this.classTeamQueue.Add((Team) item); } + + // While the team queue is shorter than max player count, add more NTF to spawn in + while (this.classTeamQueue.Length < CustomNetworkManager.singleton.maxConnections) + { + this.classTeamQueue.Add((Team) 4); + } + if (!base.isLocalPlayer && TutorialManager.status) { this.ApplyProperties(); } - this.SetMaxHP(0, "SCP173_HP", 2000); - this.SetMaxHP(1, "CLASSD_HP", 100); - this.SetMaxHP(3, "SCP106_HP", 700); - this.SetMaxHP(4, "NTFSCIENTIST_HP", 120); - this.SetMaxHP(5, "SCP049_HP", 1200); - this.SetMaxHP(6, "SCIENTIST_HP", 100); - this.SetMaxHP(7, "SCP079_HP", 100); - this.SetMaxHP(8, "CI_HP", 120); - this.SetMaxHP(9, "SCP096_HP", 2000); - this.SetMaxHP(10, "SCP049-2_HP", 400); - this.SetMaxHP(11, "NTFL_HP", 120); - this.SetMaxHP(12, "NTFC_HP", 150); - this.SetMaxHP(13, "NTFG_HP", 100); - this.smBan049 = !ConfigFile.GetString("SCP049_DISABLE", "no").Equals("no"); - this.smBan096 = !ConfigFile.GetString("SCP096_DISABLE", "no").Equals("no"); - this.smBan079 = !ConfigFile.GetString("SCP079_DISABLE", "yes").Equals("no"); - this.smBan106 = !ConfigFile.GetString("SCP106_DISABLE", "no").Equals("no"); - this.smBan173 = !ConfigFile.GetString("SCP173_DISABLE", "no").Equals("no"); - this.smBan457 = !ConfigFile.GetString("SCP457_DISABLE", "no").Equals("no"); - } + this.SetMaxHP(0, "SCP173_HP", this.klasy[0].maxHP); + this.SetMaxHP(1, "CLASSD_HP", this.klasy[1].maxHP); + this.SetMaxHP(3, "SCP106_HP", this.klasy[3].maxHP); + this.SetMaxHP(4, "NTFSCIENTIST_HP", this.klasy[4].maxHP); + this.SetMaxHP(5, "SCP049_HP", this.klasy[5].maxHP); + this.SetMaxHP(6, "SCIENTIST_HP", this.klasy[6].maxHP); + this.SetMaxHP(7, "SCP079_HP", this.klasy[7].maxHP); + this.SetMaxHP(8, "CI_HP", this.klasy[8].maxHP); + this.SetMaxHP(9, "SCP096_HP", this.klasy[9].maxHP); // As seen in "CharacterClassManager Class List.png", class 9 is SCP-096 for now + this.SetMaxHP(10, "SCP049-2_HP", this.klasy[10].maxHP); + this.SetMaxHP(11, "NTFL_HP", this.klasy[11].maxHP); + this.SetMaxHP(12, "NTFC_HP", this.klasy[12].maxHP); + this.SetMaxHP(13, "NTFG_HP", this.klasy[13].maxHP); + + this.smBan049 = ConfigFile.GetBool("SCP049_DISABLE", false); + this.smBan079 = ConfigFile.GetBool("SCP079_DISABLE", true); + this.smBan096 = ConfigFile.GetBool("SCP096_DISABLE", true); + this.smBan106 = ConfigFile.GetBool("SCP106_DISABLE", false); + this.smBan173 = ConfigFile.GetBool("SCP173_DISABLE", false); + this.smBan457 = ConfigFile.GetBool("SCP457_DISABLE", true); + + // This should be discouraged, this could possibly allow for classes not fully implemented yet to be spawned in + this.smForceSCPBans = ConfigFile.GetBool("FORCE_DISABLE_ENABLE", false); + + // For debugging, set this to true to output a class list (Though this can just be done through an in-game command) + if (false) + { + for (int classID = 0; classID < this.klasy.Length; classID++) + { + ServerConsole.AddLog(string.Concat(new object[] + { + "Class #", + classID, + ": ", + this.klasy[classID].fullName, + " - ", + this.klasy[classID].curClass.maxHP, + "HP" + })); + } + } + } - // Token: 0x06000260 RID: 608 RVA: 0x0000360B File Offset: 0x0000180B private IEnumerator Init() { GameObject host = null; @@ -131,24 +165,28 @@ private IEnumerator Init() host = GameObject.Find("Host"); yield return new WaitForEndOfFrame(); } - while (this.seed == 0) + while (this.seed == 0) // If the seed hasn't been set, generate one { this.seed = host.GetComponent().seed; UnityEngine.Object.FindObjectOfType().UpdateValue("seed", this.seed.ToString()); } + if (!base.isLocalPlayer) { yield break; } yield return new WaitForSeconds(2f); + if (base.isServer) { if (ServerStatic.isDedicated) { ServerConsole.AddLog("Waiting for players.."); } + CursorManager.roundStarted = true; RoundStart rs = RoundStart.singleton; + if (TutorialManager.status) { this.ForceRoundStart(); @@ -158,26 +196,42 @@ private IEnumerator Init() rs.ShowButton(); int timeLeft = this.smStartRoundTimer; int maxPlayers = 1; + while (rs.info != "started") { if (maxPlayers > this.smWaitForPlayers) { - int num = timeLeft; - timeLeft = num - 1; + timeLeft--; } - int num2 = PlayerManager.singleton.players.Length; - if (num2 > maxPlayers) + + int playerCount = PlayerManager.singleton.players.Length; + + if (playerCount > maxPlayers) { - maxPlayers = num2; - if (maxPlayers == NetworkManager.singleton.maxConnections) - { - timeLeft = 0; - } - else if (timeLeft % 5 > 0) - { - timeLeft = timeLeft / 5 * 5 + 5; - } + maxPlayers = playerCount; + + // If the server is full, start the game immediately + if (maxPlayers == NetworkManager.singleton.maxConnections) + { + timeLeft = 0; + } + + /* + * Don't know why this isn't just adding five, like so + * + * timeLeft += 5; + */ + else if (timeLeft % 5 > 0) + { + timeLeft = timeLeft / 5 * 5 + 5; + } + + else + { + timeLeft += 5; + } } + if (timeLeft > 0) { this.CmdUpdateStartText(timeLeft.ToString()); @@ -186,13 +240,15 @@ private IEnumerator Init() { this.ForceRoundStart(); } + yield return new WaitForSeconds(1f); } } + CursorManager.roundStarted = false; this.CmdStartRound(); - this.SetRandomRoles(); - rs = null; + this.SetRandomRoles(); // Set player's roles + rs = null; } else @@ -207,34 +263,36 @@ private IEnumerator Init() this.CallCmdSuicide(default(PlayerStats.HitInfo)); } } + int iteration = 0; for (;;) { GameObject[] plys = PlayerManager.singleton.players; + if (iteration >= plys.Length) { yield return new WaitForSeconds(3f); + iteration = 0; } try { - plys[iteration].GetComponent().InitSCPs(); + plys[iteration].GetComponent().InitSCPs(); // Initialize SCPs for all connected players } catch { } - int num = iteration; - iteration = num + 1; + + iteration++; + yield return new WaitForEndOfFrame(); plys = null; - plys = null; } yield break; } - // Token: 0x06000261 RID: 609 RVA: 0x00013AA4 File Offset: 0x00011CA4 - [Command] [Client] + [Command] public void CmdSuicide(PlayerStats.HitInfo hitInfo) { if (!NetworkClient.active) @@ -246,7 +304,6 @@ public void CmdSuicide(PlayerStats.HitInfo hitInfo) base.GetComponent().HurtPlayer(hitInfo, base.gameObject); } - // Token: 0x06000262 RID: 610 RVA: 0x0000361A File Offset: 0x0000181A public void ForceRoundStart() { this.smRoundStartTime = Time.time; @@ -254,7 +311,6 @@ public void ForceRoundStart() this.CmdUpdateStartText("started"); } - // Token: 0x06000263 RID: 611 RVA: 0x00003631 File Offset: 0x00001831 [ServerCallback] private void CmdUpdateStartText(string str) { @@ -265,7 +321,6 @@ private void CmdUpdateStartText(string str) RoundStart.singleton.Networkinfo = str; } - // Token: 0x06000264 RID: 612 RVA: 0x00013AF8 File Offset: 0x00011CF8 public void InitSCPs() { if (this.curClass != -1 && !TutorialManager.status) @@ -274,54 +329,56 @@ public void InitSCPs() this.scp049.Init(this.curClass, c); this.scp049_2.Init(this.curClass, c); this.scp079.Init(this.curClass, c); - this.scp106.Init(this.curClass, c); + this.scp096.Init(this.curClass, c); // Preparing for future SCP + this.scp106.Init(this.curClass, c); this.scp173.Init(this.curClass, c); } } - // Token: 0x06000265 RID: 613 RVA: 0x00003646 File Offset: 0x00001846 public void RegisterEscape() { this.CallCmdRegisterEscape(base.gameObject); } - // Token: 0x06000266 RID: 614 RVA: 0x00013B80 File Offset: 0x00011D80 [Command(channel = 2)] private void CmdRegisterEscape(GameObject sender) { - CharacterClassManager component = sender.GetComponent(); - if (Vector3.Distance(sender.transform.position, base.GetComponent().worldPosition) < (float)(base.GetComponent().radius * 2)) + CharacterClassManager escapeeClassManager = sender.GetComponent(); + + if (Vector3.Distance(sender.transform.position, base.GetComponent().worldPosition) < (float) (base.GetComponent().radius * 2)) { - RoundSummary component2 = GameObject.Find("Host").GetComponent(); - if (this.klasy[component.curClass].team == Team.CDP) + RoundSummary roundSummary = GameObject.Find("Host").GetComponent(); + + if (this.klasy[escapeeClassManager.curClass].team == Team.CDP) { - component2.summary.classD_escaped++; + roundSummary.summary.classD_escaped++; this.SetClassID(8); base.GetComponent().SetHPAmount(this.klasy[8].maxHP); } - if (this.klasy[component.curClass].team == Team.RSC) + if (this.klasy[escapeeClassManager.curClass].team == Team.RSC) { - component2.summary.scientists_escaped++; + roundSummary.summary.scientists_escaped++; this.SetClassID(4); base.GetComponent().SetHPAmount(this.klasy[4].maxHP); } } } - // Token: 0x06000267 RID: 615 RVA: 0x00013C60 File Offset: 0x00011E60 public void ApplyProperties() { Class @class = this.klasy[this.curClass]; this.InitSCPs(); Inventory component = base.GetComponent(); - try - { - base.GetComponent().SetLoundness(@class.team); - } - catch - { - } - if (base.isLocalPlayer) + + try + { + base.GetComponent().SetLoundness(@class.team); + } + catch + { + } + + if (base.isLocalPlayer) { base.GetComponent().UpdateClass(); base.GetComponent().CallCmdTarget(null); @@ -398,7 +455,7 @@ public void ApplyProperties() base.GetComponent().SetRecoil(@class.classRecoil); int maxHP = @class.maxHP; component3.maxHP = maxHP; - UnityEngine.Object.FindObjectOfType().lerpedHP = (float)maxHP; + UnityEngine.Object.FindObjectOfType().lerpedHP = (float) maxHP; } else { @@ -418,13 +475,11 @@ public void ApplyProperties() } } - // Token: 0x06000268 RID: 616 RVA: 0x00003654 File Offset: 0x00001854 private void EnableFPC() { base.GetComponent().enabled = true; } - // Token: 0x06000269 RID: 617 RVA: 0x00014024 File Offset: 0x00012224 public void RefreshPlyModel(int classID = -1) { if (this.myModel != null) @@ -467,7 +522,6 @@ public void RefreshPlyModel(int classID = -1) base.GetComponent().enabled = (@class.team != Team.RIP); } - // Token: 0x0600026A RID: 618 RVA: 0x00003662 File Offset: 0x00001862 public void SetClassID(int id) { this.NetworkcurClass = id; @@ -478,7 +532,6 @@ public void SetClassID(int id) } } - // Token: 0x0600026B RID: 619 RVA: 0x000141AC File Offset: 0x000123AC public void InstantiateRagdoll(int id) { if (id < 0) @@ -492,106 +545,119 @@ public void InstantiateRagdoll(int id) gameObject.transform.localScale = @class.ragdoll_offset.scale; } - // Token: 0x0600026C RID: 620 RVA: 0x00014248 File Offset: 0x00012448 public void SetRandomRoles() { - MTFRespawn component = base.GetComponent(); + MTFRespawn mtfRespawn = base.GetComponent(); + if (base.isLocalPlayer && base.isServer) { - List list = new List(); - List list2 = new List(); + List playerList = new List(); + List shuffledPlayerList = new List(); + foreach (GameObject item in PlayerManager.singleton.players) { - list.Add(item); - } - while (list.Count > 0) - { - int index = UnityEngine.Random.Range(0, list.Count); - list2.Add(list[index]); - list.RemoveAt(index); - } - GameObject[] array = list2.ToArray(); - RoundSummary component2 = base.GetComponent(); - bool flag = false; - if ((float)UnityEngine.Random.Range(0, 100) < this.ciPercentage) - { - flag = true; - } - if (this.smBanComputerFirstPick || this.smBan079) - { - this.klasy[7].banClass = true; + playerList.Add(item); } - if (this.smBan049) - { - this.klasy[5].banClass = true; - } - if (this.smBan173) - { - this.klasy[0].banClass = true; - } - if (this.smBan096) + + while (playerList.Count > 0) { - this.klasy[9].banClass = true; + int index = UnityEngine.Random.Range(0, playerList.Count); + shuffledPlayerList.Add(playerList[index]); + playerList.RemoveAt(index); } - if (this.smBan106) + + GameObject[] shuffledPlyrs = shuffledPlayerList.ToArray(); + + RoundSummary roundSummary = base.GetComponent(); + + bool spawnChaos = false; + + if ((float) UnityEngine.Random.Range(0, 100) < this.ciPercentage) { - this.klasy[3].banClass = true; + spawnChaos = true; } - for (int j = 0; j < array.Length; j++) + + // SCP-173 + this.klasy[0].banClass = this.smForceSCPBans ? this.smBan173 : (this.smBan173 ? true : this.klasy[0].banClass); + + // SCP-106 + this.klasy[3].banClass = this.smForceSCPBans ? this.smBan106 : (this.smBan106 ? true : this.klasy[3].banClass); + + // SCP-049 + this.klasy[5].banClass = this.smForceSCPBans ? this.smBan049 : (this.smBan049 ? true : this.klasy[5].banClass); + + // SCP-079 + this.klasy[7].banClass = this.smForceSCPBans ? (this.smBanComputerFirstPick ? true : this.smBan079) : (this.smBanComputerFirstPick || this.smBan079 ? true : this.klasy[7].banClass); + + // SCP-096 + this.klasy[9].banClass = this.smForceSCPBans ? this.smBan096 : (this.smBan096 ? true : this.klasy[9].banClass); + + + /* + * Unreleased SCP, not implemented yet + * + * // SCP-457 + * this.klasy[9].banClass = this.smForceSCPBans ? this.smBan457 : (this.smBan457 ? true : this.klasy[9].banClass); + */ + + this.smFirstPick = true; + + for (int curPlayer = 0; curPlayer < shuffledPlyrs.Length; curPlayer++) { - int num = (this.forceClass != -1) ? this.forceClass : this.Find_Random_ID_Using_Defined_Team(this.classTeamQueue[j]); - if (this.klasy[num].team == Team.CDP) - { - component2.summary.classD_start++; - } - if (this.klasy[num].team == Team.RSC) + int randomClass = (this.forceClass != -1) ? this.forceClass : this.Find_Random_ID_Using_Defined_Team(this.classTeamQueue[curPlayer]); + + if (this.klasy[randomClass].team == Team.CDP) { - component2.summary.scientists_start++; + roundSummary.summary.classD_start++; } - if (this.klasy[num].team == Team.SCP) + + if (this.klasy[randomClass].team == Team.RSC) { - component2.summary.scp_start++; + roundSummary.summary.scientists_start++; } - if (this.klasy[num].team == Team.SCP) + + if (this.klasy[randomClass].team == Team.SCP) { if (this.smBanComputerFirstPick && this.smFirstPick && !this.smBan079) { this.klasy[7].banClass = false; } this.smFirstPick = false; - component2.summary.scp_start++; + + roundSummary.summary.scp_start++; } - if (num == 4) + + if (randomClass == 4) { - if (flag) + if (spawnChaos) { - num = 8; + randomClass = 8; // Number 8 is Chaos' class number } else { - component.playersToNTF.Add(array[j]); + mtfRespawn.playersToNTF.Add(shuffledPlyrs[curPlayer]); } } + if (TutorialManager.status) { this.SetPlayersClass(14, base.gameObject); } - else if (num != 4) + else if (randomClass != 4) { - this.SetPlayersClass(num, array[j]); + this.SetPlayersClass(randomClass, shuffledPlyrs[curPlayer]); } } - component.SummonNTF(); + + mtfRespawn.SummonNTF(); } } - // Token: 0x0600026D RID: 621 RVA: 0x00003688 File Offset: 0x00001888 private void SetRoundStart(bool b) { this.NetworkroundStarted = b; } - // Token: 0x0600026E RID: 622 RVA: 0x000144C0 File Offset: 0x000126C0 [ServerCallback] private void CmdStartRound() { @@ -603,7 +669,7 @@ private void CmdStartRound() { try { - GameObject.Find("MeshDoor173").GetComponentInChildren().ForceCooldown((float)ConfigFile.GetInt("173_door_starting_cooldown", 25)); + GameObject.Find("MeshDoor173").GetComponentInChildren().ForceCooldown((float) ConfigFile.GetInt("173_door_starting_cooldown", 25)); UnityEngine.Object.FindObjectOfType().SetState(false); } catch @@ -613,7 +679,6 @@ private void CmdStartRound() this.SetRoundStart(true); } - // Token: 0x0600026F RID: 623 RVA: 0x00003691 File Offset: 0x00001891 [ServerCallback] public void SetPlayersClass(int classid, GameObject ply) { @@ -625,7 +690,6 @@ public void SetPlayersClass(int classid, GameObject ply) ply.GetComponent().SetHPAmount(this.klasy[classid].maxHP); } - // Token: 0x06000270 RID: 624 RVA: 0x00014524 File Offset: 0x00012724 private int Find_Random_ID_Using_Defined_Team(Team team) { List list = new List(); @@ -648,13 +712,11 @@ private int Find_Random_ID_Using_Defined_Team(Team team) return list[index]; } - // Token: 0x06000271 RID: 625 RVA: 0x000036BF File Offset: 0x000018BF public bool SpawnProtection() { return this.aliveTime < 2f; } - // Token: 0x06000272 RID: 626 RVA: 0x000145B8 File Offset: 0x000127B8 private void Update() { if (this.curClass == 2) @@ -687,14 +749,10 @@ private void Update() } } - // Token: 0x06000273 RID: 627 RVA: 0x00002195 File Offset: 0x00000395 private void UNetVersion() { } - // Token: 0x17000039 RID: 57 - // (get) Token: 0x06000274 RID: 628 RVA: 0x000036CE File Offset: 0x000018CE - // (set) Token: 0x06000275 RID: 629 RVA: 0x00014650 File Offset: 0x00012850 public int NetworkntfUnit { get @@ -714,9 +772,6 @@ public int NetworkntfUnit } } - // Token: 0x1700003A RID: 58 - // (get) Token: 0x06000276 RID: 630 RVA: 0x000036D6 File Offset: 0x000018D6 - // (set) Token: 0x06000277 RID: 631 RVA: 0x00014694 File Offset: 0x00012894 public int NetworkcurClass { get @@ -736,9 +791,6 @@ public int NetworkcurClass } } - // Token: 0x1700003B RID: 59 - // (get) Token: 0x06000278 RID: 632 RVA: 0x000036DE File Offset: 0x000018DE - // (set) Token: 0x06000279 RID: 633 RVA: 0x000146D8 File Offset: 0x000128D8 public Vector3 NetworkdeathPosition { get @@ -758,9 +810,6 @@ public Vector3 NetworkdeathPosition } } - // Token: 0x1700003C RID: 60 - // (get) Token: 0x0600027A RID: 634 RVA: 0x000036E6 File Offset: 0x000018E6 - // (set) Token: 0x0600027B RID: 635 RVA: 0x0001471C File Offset: 0x0001291C public bool NetworkroundStarted { get @@ -780,7 +829,6 @@ public bool NetworkroundStarted } } - // Token: 0x0600027C RID: 636 RVA: 0x000036EE File Offset: 0x000018EE protected static void InvokeCmdCmdSuicide(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) @@ -791,7 +839,6 @@ protected static void InvokeCmdCmdSuicide(NetworkBehaviour obj, NetworkReader re ((CharacterClassManager)obj).CmdSuicide(GeneratedNetworkCode._ReadHitInfo_PlayerStats(reader)); } - // Token: 0x0600027D RID: 637 RVA: 0x00003713 File Offset: 0x00001913 protected static void InvokeCmdCmdRegisterEscape(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkServer.active) @@ -802,7 +849,6 @@ protected static void InvokeCmdCmdRegisterEscape(NetworkBehaviour obj, NetworkRe ((CharacterClassManager)obj).CmdRegisterEscape(reader.ReadGameObject()); } - // Token: 0x0600027E RID: 638 RVA: 0x00014760 File Offset: 0x00012960 public void CallCmdSuicide(PlayerStats.HitInfo hitInfo) { if (!NetworkClient.active) @@ -824,7 +870,6 @@ public void CallCmdSuicide(PlayerStats.HitInfo hitInfo) base.SendCommandInternal(networkWriter, 0, "CmdSuicide"); } - // Token: 0x0600027F RID: 639 RVA: 0x000147D4 File Offset: 0x000129D4 public void CallCmdRegisterEscape(GameObject sender) { if (!NetworkClient.active) @@ -846,7 +891,6 @@ public void CallCmdRegisterEscape(GameObject sender) base.SendCommandInternal(networkWriter, 2, "CmdRegisterEscape"); } - // Token: 0x06000280 RID: 640 RVA: 0x00014848 File Offset: 0x00012A48 static CharacterClassManager() { NetworkBehaviour.RegisterCommandDelegate(typeof(CharacterClassManager), CharacterClassManager.kCmdCmdSuicide, new NetworkBehaviour.CmdDelegate(CharacterClassManager.InvokeCmdCmdSuicide)); @@ -855,7 +899,6 @@ static CharacterClassManager() NetworkCRC.RegisterBehaviour("CharacterClassManager", 0); } - // Token: 0x06000281 RID: 641 RVA: 0x000148B4 File Offset: 0x00012AB4 public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) @@ -910,7 +953,6 @@ public override bool OnSerialize(NetworkWriter writer, bool forceAll) return flag; } - // Token: 0x06000282 RID: 642 RVA: 0x000149A4 File Offset: 0x00012BA4 public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) @@ -940,131 +982,94 @@ public override void OnDeserialize(NetworkReader reader, bool initialState) } } - // Token: 0x06000283 RID: 643 RVA: 0x00003738 File Offset: 0x00001938 public void SetMaxHP(int id, string config_key, int defaultHp) { - this.klasy[id].maxHP = ConfigFile.GetInt(config_key, defaultHp); + this.klasy[id].maxHP = ConfigFile.GetInt(config_key, defaultHp); } - // Token: 0x04000272 RID: 626 [SyncVar(hook = "SetUnit")] public int ntfUnit; - // Token: 0x04000273 RID: 627 public float ciPercentage; - // Token: 0x04000274 RID: 628 public int forceClass = -1; - // Token: 0x04000275 RID: 629 [SerializeField] private AudioClip bell; - // Token: 0x04000276 RID: 630 [SerializeField] private AudioClip bell_dead; - // Token: 0x04000277 RID: 631 [HideInInspector] public GameObject myModel; - // Token: 0x04000278 RID: 632 [HideInInspector] public GameObject charCamera; - // Token: 0x04000279 RID: 633 public Class[] klasy; - // Token: 0x0400027A RID: 634 public List classTeamQueue = new List(); - // Token: 0x0400027B RID: 635 [SyncVar(hook = "SetClassID")] public int curClass; - // Token: 0x0400027C RID: 636 private int seed; - // Token: 0x0400027D RID: 637 private GameObject plyCam; - // Token: 0x0400027E RID: 638 public GameObject unfocusedCamera; - // Token: 0x0400027F RID: 639 [SyncVar(hook = "SyncDeathPos")] public Vector3 deathPosition; - // Token: 0x04000280 RID: 640 [SyncVar(hook = "SetRoundStart")] public bool roundStarted; - // Token: 0x04000281 RID: 641 private Scp049PlayerScript scp049; - // Token: 0x04000282 RID: 642 private Scp049_2PlayerScript scp049_2; - // Token: 0x04000283 RID: 643 private Scp079PlayerScript scp079; - // Token: 0x04000284 RID: 644 - private Scp106PlayerScript scp106; + private Scp096PlayerScript scp096; // Preparing for future SCP - // Token: 0x04000285 RID: 645 - private Scp173PlayerScript scp173; + private Scp106PlayerScript scp106; - // Token: 0x04000286 RID: 646 - private Scp096PlayerScript scp096; + private Scp173PlayerScript scp173; - // Token: 0x04000287 RID: 647 - private LureSubjectContainer lureSpj; + private LureSubjectContainer lureSpj; - // Token: 0x04000288 RID: 648 - private static Class[] staticClasses; + private static Class[] staticClasses; - // Token: 0x04000289 RID: 649 - private float aliveTime; + private float aliveTime; - // Token: 0x0400028A RID: 650 private int prevId = -1; - // Token: 0x0400028B RID: 651 private static int kCmdCmdSuicide = -1051695024; - // Token: 0x0400028C RID: 652 private static int kCmdCmdRegisterEscape; - // Token: 0x0400028D RID: 653 public bool smBanComputerFirstPick; - // Token: 0x0400028E RID: 654 public bool smBan049; - // Token: 0x0400028F RID: 655 - public bool smBan096; + public bool smBan079; - // Token: 0x04000290 RID: 656 - public bool smBan079; + public bool smBan096; - // Token: 0x04000291 RID: 657 - public bool smBan106; + public bool smBan106; - // Token: 0x04000292 RID: 658 public bool smBan173; - // Token: 0x04000293 RID: 659 public bool smBan457; - // Token: 0x04000294 RID: 660 - public bool smFirstPick; + public bool smForceSCPBans; + + public bool smFirstPick; - // Token: 0x04000295 RID: 661 private int smStartRoundTimer; - // Token: 0x04000296 RID: 662 private int smWaitForPlayers; - // Token: 0x04000297 RID: 663 public float smRoundStartTime; } diff --git a/server_mod/ConfigFile.cs b/server_mod/ConfigFile.cs index 7c23f89..fb38af5 100644 --- a/server_mod/ConfigFile.cs +++ b/server_mod/ConfigFile.cs @@ -3,10 +3,8 @@ using GameConsole; using UnityEngine; -// Token: 0x0200001C RID: 28 public class ConfigFile : MonoBehaviour { - // Token: 0x0600008B RID: 139 RVA: 0x0000AF80 File Offset: 0x00009180 private void Awake() { ConfigFile.singleton = this; @@ -25,7 +23,6 @@ private void Awake() ConfigFile.path += "/config.txt"; } - // Token: 0x0600008C RID: 140 RVA: 0x0000B00C File Offset: 0x0000920C private void Start() { if (!this.ReloadConfig()) @@ -35,7 +32,6 @@ private void Start() } } - // Token: 0x0600008D RID: 141 RVA: 0x0000B068 File Offset: 0x00009268 public bool ReloadConfig() { if (!File.Exists(ConfigFile.path)) @@ -55,7 +51,6 @@ public bool ReloadConfig() return true; } - // Token: 0x0600008E RID: 142 RVA: 0x0000B0C8 File Offset: 0x000092C8 public static string GetString(string key, string defaultValue = "") { string text = ConfigFile.singleton.cfg; @@ -69,16 +64,10 @@ public static string GetString(string key, string defaultValue = "") { return defaultValue; } - text = text.Remove(0, text.IndexOf(Environment.NewLine) + Environment.NewLine.Length).TrimStart(new char[] - { - ' ' - }); + text = text.Remove(0, text.IndexOf(Environment.NewLine) + Environment.NewLine.Length); } text = text.Remove(0, text.IndexOf("=") + 1); - text = text.TrimStart(new char[] - { - ' ' - }); + text = text.TrimStart(' '); return text.Remove(text.IndexOf(";")); } catch @@ -90,23 +79,60 @@ public static string GetString(string key, string defaultValue = "") return defaultValue; } - // Token: 0x0600008F RID: 143 RVA: 0x0000B1B0 File Offset: 0x000093B0 - public static int GetInt(string key, int defaultValue = 0) - { - int result = 0; - if (int.TryParse(ConfigFile.GetString(key, "errorInConverting"), out result)) - { - return result; - } - return defaultValue; - } + public static int GetInt(string key, int defaultValue = 0) + { + int result = 0; + if (int.TryParse(ConfigFile.GetString(key, "errorInConverting"), out result)) + { + return result; + } + return defaultValue; + } + + public static bool GetBool(string key, bool defaultValue = true) + { + string configValue = ConfigFile.GetString(key, "errorInConverting").ToLower(); + + // Why did I make it so you can use these words? Because I can. + string[] trueWords = new string[] + { + "true", + "yes", + "sure", + "yeah", + "yea", + "affirmative", + "aye" + }; + + string[] falseWords = new string[] + { + "false", + "no", + "nope", + "nah", + "negative", + "nay" + }; + + foreach (string word in trueWords) + { + if (configValue.Equals(word.ToLower())) + return true; + } + + foreach (string word in falseWords) + { + if (configValue.Equals(word.ToLower())) + return false; + } + + return defaultValue; + } - // Token: 0x0400009C RID: 156 - public static ConfigFile singleton; + public static ConfigFile singleton; - // Token: 0x0400009D RID: 157 public static string path; - // Token: 0x0400009E RID: 158 public string cfg; } diff --git a/server_mod/CursorManager.cs b/server_mod/CursorManager.cs index 59528e5..92c85c2 100644 --- a/server_mod/CursorManager.cs +++ b/server_mod/CursorManager.cs @@ -7,14 +7,16 @@ public partial class CursorManager : MonoBehaviour public void LateUpdate() { bool visible = CursorManager.eqOpen | CursorManager.pauseOpen | CursorManager.isServerOnly | CursorManager.consoleOpen | CursorManager.is079 | CursorManager.scp106 | CursorManager.roundStarted | CursorManager.raOp; - if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null) + + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null) { Cursor.lockState = CursorLockMode.None; } - else - { - Cursor.lockState = ((!visible) ? CursorLockMode.Locked : CursorLockMode.None); - } - Cursor.visible = visible; + else + { + Cursor.lockState = ((!visible) ? CursorLockMode.Locked : CursorLockMode.None); + } + + Cursor.visible = visible; } } diff --git a/server_mod/CustomNetworkManager.cs b/server_mod/CustomNetworkManager.cs index 4206cbe..ff5fa8d 100644 --- a/server_mod/CustomNetworkManager.cs +++ b/server_mod/CustomNetworkManager.cs @@ -1,39 +1,34 @@ using System; using System.Collections; using System.IO; -using Dissonance.Integrations.UNet_HLAPI; using GameConsole; using Steamworks; +using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; -// Token: 0x020000EC RID: 236 public class CustomNetworkManager : NetworkManager { - // Token: 0x06000681 RID: 1665 - private void Update() - { - if (this.popup.activeSelf && Input.GetKey(KeyCode.Escape)) - { - this.ClickButton(); - } - } + private void Update() + { + if (this.popup.activeSelf && Input.GetKey(KeyCode.Escape)) + { + this.ClickButton(); + } + } - // Token: 0x06000682 RID: 1666 - public override void OnClientDisconnect(NetworkConnection conn) + public override void OnClientDisconnect(NetworkConnection conn) { - this.ShowLog((int)conn.lastError); + this.ShowLog((int) conn.lastError); } - // Token: 0x06000683 RID: 1667 public override void OnClientError(NetworkConnection conn, int errorCode) { this.ShowLog(errorCode); } - // Token: 0x06000684 RID: 1668 public override void OnServerConnect(NetworkConnection conn) { foreach (BanPlayer.Ban ban in BanPlayer.bans) @@ -50,17 +45,15 @@ public override void OnServerConnect(NetworkConnection conn) } } - // Token: 0x06000685 RID: 1669 public override void OnServerDisconnect(NetworkConnection conn) { - HlapiServer.OnServerDisconnect(conn); - base.OnServerDisconnect(conn); + HlapiServer.OnServerDisconnect(conn); + base.OnServerDisconnect(conn); ServerConsole.AddLog("Player disconnect:"); conn.Disconnect(); conn.Dispose(); } - // Token: 0x06000686 RID: 1670 public void OnLevelWasLoaded(int level) { if (this.reconnect) @@ -70,7 +63,6 @@ public void OnLevelWasLoaded(int level) } } - // Token: 0x06000687 RID: 1671 public override void OnClientSceneChanged(NetworkConnection conn) { base.OnClientSceneChanged(conn); @@ -80,7 +72,6 @@ public override void OnClientSceneChanged(NetworkConnection conn) } } - // Token: 0x06000688 RID: 1672 private void Reconnect() { if (this.reconnect) @@ -90,22 +81,19 @@ private void Reconnect() } } - // Token: 0x06000689 RID: 1673 public void StopReconnecting() { this.reconnect = false; } - // Token: 0x0600068A RID: 1674 public void ShowLog(int id) { - this.curLogID = id; - this.popup.SetActive(true); - this.content.text = TranslationReader.Get("Connection_Errors", id); - this.content.rectTransform.sizeDelta = Vector3.zero; - } + this.curLogID = id; + this.popup.SetActive(true); + this.content.text = TranslationReader.Get("Connection_Errors", id); + this.content.rectTransform.sizeDelta = Vector3.zero; + } - // Token: 0x0600068B RID: 1675 public void ClickButton() { ConnInfoButton[] actions = this.logs[this.curLogID].button.actions; @@ -115,7 +103,6 @@ public void ClickButton() } } - // Token: 0x0600068C RID: 1676 private void Start() { this.console = GameConsole.Console.singleton; @@ -125,10 +112,9 @@ private void Start() } } - // Token: 0x0600068D RID: 1677 public void CreateMatch() { - ServerConsole.AddLog("ServerMod - Version 1.4 beta (Patch 2)"); + ServerConsole.AddLog("ServerMod - Version 1.5"); this.ShowLog(13); this.createpop.SetActive(false); NetworkServer.Reset(); @@ -141,12 +127,12 @@ public void CreateMatch() this.NonsteamHost(); } - // Token: 0x0600068E RID: 1678 private IEnumerator CreateLobby() { yield return new WaitForEndOfFrame(); - base.maxConnections = ConfigFile.GetInt("max_players", 20); - string ip = string.Empty; + base.maxConnections = ConfigFile.GetInt("max_players", 20); + + string ip = string.Empty; if (ConfigFile.GetString("server_ip", "auto") != "auto") { ip = ConfigFile.GetString("server_ip", "auto"); @@ -165,7 +151,6 @@ private IEnumerator CreateLobby() ip = www.text.Remove(www.text.Length - 1); ServerConsole.AddLog("Done, your game-server IP will be " + ip); www = null; - www = null; } ServerConsole.AddLog("Initializing game-server..."); this.StartHost(); @@ -174,37 +159,40 @@ private IEnumerator CreateLobby() yield return new WaitForEndOfFrame(); } ServerConsole.AddLog("Level loaded. Creating match..."); - string value = string.Concat(new string[] - { - ConfigFile.GetString("server_name", "Unnamed server"), - ":[:BREAK:]:", - ConfigFile.GetString("serverinfo_pastebin_id", "7wV681fT"), - ":[:BREAK:]:", - this.versionstring - }); - ServerConsole.ip = ip; - WWWForm wwwform = new WWWForm(); - wwwform.AddField("update", 1); - wwwform.AddField("ip", ip); - wwwform.AddField("info", value); - wwwform.AddField("port", base.networkPort); - wwwform.AddField("players", 0); + + string info = string.Concat(new string[] + { + UnityEngine.Object.FindObjectOfType().smParseName(ConfigFile.GetString("server_name", "Unnamed server"), 0), + ":[:BREAK:]:", + ConfigFile.GetString("serverinfo_pastebin_id", "7wV681fT"), + ":[:BREAK:]:", + this.versionstring + }); + + ServerConsole.ip = ip; + WWWForm form = new WWWForm(); + form.AddField("update", 1); + form.AddField("ip", ip); + form.AddField("info", info); + form.AddField("port", base.networkPort); + form.AddField("players", 0); + bool codeNotGenerated = false; string pth = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/SCP Secret Laboratory/verkey.txt"; if (File.Exists(pth)) { StreamReader streamReader = new StreamReader(pth); string text = streamReader.ReadToEnd(); - wwwform.AddField("passcode", text); + form.AddField("passcode", text); ServerConsole.password = text; streamReader.Close(); } else { - wwwform.AddField("passcode", string.Empty); + form.AddField("passcode", string.Empty); codeNotGenerated = true; } - WWW www2 = new WWW("https://hubertmoszka.pl/authenticator.php", wwwform); + WWW www2 = new WWW("https://hubertmoszka.pl/authenticator.php", form); yield return www2; if (string.IsNullOrEmpty(www2.error)) { @@ -267,7 +255,6 @@ private IEnumerator CreateLobby() yield break; } - // Token: 0x0600068F RID: 1679 private void NonsteamHost() { base.onlineScene = "Facility"; @@ -275,14 +262,12 @@ private void NonsteamHost() this.StartHostWithPort(); } - // Token: 0x06000690 RID: 1680 public void StartHostWithPort() { ServerConsole.AddLog("Server starting at port " + base.networkPort); this.StartHost(); } - // Token: 0x06000691 RID: 1681 public int GetFreePort() { string @string = ConfigFile.GetString("port_queue", "7777,7778,7779,7780,7781,7782,7783,7784"); @@ -308,13 +293,14 @@ public int GetFreePort() if (array.Length == 0) { q = "Failed to detect ports."; - throw new Exception(); - } - ServerConsole.AddLog("Port queue loaded: " + @string); - for (int i = 0; i < array.Length; i++) + throw new Exception(); + } + ServerConsole.AddLog("Port queue loaded: " + @string); + + for (int i = 0; i < array.Length; i++) { - ServerConsole.AddLog("Trying to init port: " + array[i] + "..."); - q = "Failed to convert [" + array[i] + "] into integer number!"; + ServerConsole.AddLog("Trying to init port: " + array[i] + "..."); + q = "Failed to convert [" + array[i] + "] into integer number!"; base.networkPort = int.Parse(array[i]); if (NetworkServer.Listen(base.networkPort)) { @@ -331,17 +317,19 @@ public int GetFreePort() q = "Failed to read config file: " + text; ConfigFile.path = text; ConfigFile.singleton.ReloadConfig(); - ServerConsole.AddLog("Custom config detected, using " + text); - } - else - { - ServerConsole.AddLog("No custom config detected, using config.txt"); - } - ServerConsole.AddLog("Done!LOGTYPE-10"); - return base.networkPort; + ServerConsole.AddLog("Custom config detected, using " + text); + } + else + { + ServerConsole.AddLog("No custom config detected, using config.txt"); + } + ServerConsole.AddLog("Done!LOGTYPE-10"); + + return base.networkPort; } - ServerConsole.AddLog("...failed.LOGTYPE-6"); - } + + ServerConsole.AddLog("...failed.LOGTYPE-6"); + } } catch { @@ -350,53 +338,38 @@ public int GetFreePort() return 7777; } - // Token: 0x040005CA RID: 1482 public GameObject popup; - // Token: 0x040005CB RID: 1483 public GameObject createpop; - // Token: 0x040005CC RID: 1484 public RectTransform contSize; - // Token: 0x040005CD RID: 1485 public Text content; - // Token: 0x040005CE RID: 1486 public CustomNetworkManager.DisconnectLog[] logs; - // Token: 0x040005CF RID: 1487 private int curLogID; - // Token: 0x040005D0 RID: 1488 public bool reconnect; - // Token: 0x040005D1 RID: 1489 [Space(20f)] public string versionstring; - // Token: 0x040005D2 RID: 1490 private GameConsole.Console console; - // Token: 0x020000ED RID: 237 [Serializable] public class DisconnectLog { - // Token: 0x040005D3 RID: 1491 [Multiline] public string msg_en; - // Token: 0x040005D4 RID: 1492 public CustomNetworkManager.DisconnectLog.LogButton button; - // Token: 0x040005D5 RID: 1493 public bool autoHideOnSceneLoad; - // Token: 0x020000EE RID: 238 [Serializable] public class LogButton { - // Token: 0x040005D6 RID: 1494 public ConnInfoButton[] actions; } } diff --git a/server_mod/GameConsole/Console.cs b/server_mod/GameConsole/Console.cs index 393b9d2..c99cd63 100644 --- a/server_mod/GameConsole/Console.cs +++ b/server_mod/GameConsole/Console.cs @@ -1,15 +1,147 @@ -using System; +using System; using System.Collections.Generic; +using System.IO; using UnityEngine; +using UnityEngine.EventSystems; using UnityEngine.Networking; +using UnityEngine.SceneManagement; using UnityEngine.UI; namespace GameConsole { - // Token: 0x0200001D RID: 29 - public partial class Console : MonoBehaviour + public class Console : MonoBehaviour { - // Token: 0x06000099 RID: 153 RVA: 0x0000B5B0 File Offset: 0x000097B0 + public Console() + { + } + + public List GetAllLogs() + { + return this.logs; + } + + public void UpdateValue(string key, string value) + { + bool flag = false; + key = key.ToUpper(); + foreach (Console.Value value2 in this.values) + { + if (value2.key == key) + { + value2.value = value; + flag = true; + } + } + if (!flag) + { + this.values.Add(new Console.Value(key, value)); + } + } + + public void Awake() + { + UnityEngine.Object.DontDestroyOnLoad(base.gameObject); + if (Console.singleton == null) + { + Console.singleton = this; + return; + } + UnityEngine.Object.DestroyImmediate(base.gameObject); + } + + public void Start() + { + this.AddLog("Hi there! Initializing console...", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + this.AddLog("Done! Type 'help' to print the list of available commands.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + Debug.logger.logEnabled = true; + this.RefreshConsoleScreen(); + } + + public void RefreshConsoleScreen() + { + bool flag = false; + if (this.txt.text.Length > 15000) + { + this.logs.RemoveAt(0); + flag = true; + } + if (this.txt == null) + { + return; + } + this.txt.text = string.Empty; + if (this.logs.Count > 0) + { + for (int i = 0; i < this.logs.Count - this.scrollup; i++) + { + string text = string.Concat(new string[] + { + (!this.logs[i].nospace) ? "\n\n" : "\n", + "", + this.logs[i].text, + "" + }); + if (text.Contains("@#{[")) + { + string str = text.Remove(text.IndexOf("@#{[")); + string text2 = text.Remove(0, text.IndexOf("@#{[") + 4); + text2 = text2.Remove(text2.Length - 12); + foreach (Console.Value value in this.values) + { + if (value.key == text2) + { + text = str + value.value + ""; + } + } + } + Text text3 = this.txt; + text3.text += text; + } + } + if (flag) + { + this.RefreshConsoleScreen(); + } + } + + public void AddLog(string text, Color32 c, bool nospace = false) + { + this.response = this.response + text + Environment.NewLine; + if (!nospace) + { + this.response += Environment.NewLine; + } + this.scrollup = 0; + this.logs.Add(new Console.Log(text, c, nospace)); + this.RefreshConsoleScreen(); + } + + public string ColorToHex(Color32 color) + { + string str = color.r.ToString("X2") + color.g.ToString("X2") + color.b.ToString("X2"); + return "#" + str; + } + + public static GameObject FindConnectedRoot(NetworkConnection conn) + { + try + { + foreach (PlayerController playerController in conn.playerControllers) + { + if (playerController.gameObject.tag == "Player") + { + return playerController.gameObject; + } + } + } + catch + { + } + return null; + } + public string TypeCommand(string cmd) { try @@ -78,237 +210,237 @@ public string TypeCommand(string cmd) this.AddLog("Second argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } - else if (cmd == "GIVEALL") - { - int num2 = 0; - if (array.Length >= 2 && int.TryParse(array[1], out num2)) - { - string a2 = "offline"; - foreach (GameObject gameObject2 in PlayerManager.singleton.players) - { - a2 = "online"; - CharacterClassManager component2 = gameObject2.GetComponent(); - if (component2 != null && component2.klasy[component2.NetworkcurClass].team != Team.SCP) - { - Inventory component3 = gameObject2.GetComponent(); - if (component3 != null) - { - if (component3.availableItems.Length > num2) - { - Searching component4 = gameObject2.GetComponent(); - if (component4 != null) - { - Locker locker = UnityEngine.Object.FindObjectOfType(); - if (locker != null) - { - if (component3.netFreeSlots > 0) - { - int[] ids = locker.ids; - locker.ids = new int[] - { - num2 - }; - component4.CallCmdPickupItem(locker.gameObject, gameObject2); - locker.SetTaken(false); - locker.ids = ids; - } - else - { - component4.CallCmdPickupItem(locker.gameObject, gameObject2); - locker.SetTaken(false); - component3.CallCmdSetPickup(num2, -4.65664672E+11f, component3.transform.position, component3.transform.rotation, component3.transform.localRotation); - } - } - else - { - this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - component3.CallCmdSetPickup(num2, -4.65664672E+11f, component3.transform.position, component3.transform.rotation, component3.transform.localRotation); - component3.netFreeSlots--; - } - } - a2 = "none"; - } - else - { - this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - item does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - else - { - this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - Player has no inventory!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - else - { - this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - Player is an SCP!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - a2 = "none"; - } - } - if (a2 == "offline" || a2 == "online") - { - this.AddLog((!(a2 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - else - { - this.AddLog("ITEM#" + num2.ToString("000") + " has been added!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - } - } - else - { - this.AddLog("Second argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - else if (cmd == "GIVEPLAYER") - { - int num3 = 0; - if (array.Length >= 3 && int.TryParse(array[2], out num3)) - { - string text = array[1]; - string a3 = "offline"; - foreach (GameObject gameObject3 in PlayerManager.singleton.players) - { - a3 = "online"; - CharacterClassManager component5 = gameObject3.GetComponent(); - NicknameSync component6 = gameObject3.GetComponent(); - if (component5 != null && component5.klasy[component5.NetworkcurClass].team != Team.SCP) - { - if (component6 != null) - { - if (component6.NetworkmyNick.ToLower().Contains(text.ToLower())) - { - Inventory component7 = gameObject3.GetComponent(); - if (component7 != null) - { - if (component7.availableItems.Length > num3) - { - Searching component8 = gameObject3.GetComponent(); - if (component8 != null) - { - Locker locker2 = UnityEngine.Object.FindObjectOfType(); - if (locker2 != null) - { - if (component7.netFreeSlots > 0) - { - int[] ids2 = locker2.ids; - locker2.ids = new int[] - { - num3 - }; - component8.CallCmdPickupItem(locker2.gameObject, gameObject3); - locker2.SetTaken(false); - locker2.ids = ids2; - } - else - { - component8.CallCmdPickupItem(locker2.gameObject, gameObject3); - locker2.SetTaken(false); - component7.CallCmdSetPickup(num3, -4.65664672E+11f, component7.transform.position, component7.transform.rotation, component7.transform.localRotation); - } - } - else - { - this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - component7.CallCmdSetPickup(num3, -4.65664672E+11f, component7.transform.position, component7.transform.rotation, component7.transform.localRotation); - component7.netFreeSlots--; - } - } - a3 = "none"; - } - else - { - this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - item does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - else - { - this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player has no inventory!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - else - { - this.AddLog(string.Concat(new string[] - { - "Failed to add ITEM#", - num3.ToString("000"), - " - Username doesn't match! (\"", - component6.NetworkmyNick, - "\" against \"", - text, - "\")" - }), new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - a3 = "none"; - } - } - else - { - this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player has no nickname!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - a3 = "none"; - } - } - else - { - this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player is an SCP!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - a3 = "none"; - } - } - if (a3 == "offline" || a3 == "online") - { - this.AddLog((!(a3 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - else - { - this.AddLog("ITEM#" + num3.ToString("000") + " has been added!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - } - } - else - { - this.AddLog("Third argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - else if (cmd == "ITEMLIST") + else if (cmd == "GIVEALL") + { + int num2 = 0; + if (array.Length >= 2 && int.TryParse(array[1], out num2)) + { + string a2 = "offline"; + foreach (GameObject gameObject2 in PlayerManager.singleton.players) + { + a2 = "online"; + CharacterClassManager component2 = gameObject2.GetComponent(); + if (component2 != null && component2.klasy[component2.NetworkcurClass].team != Team.SCP) + { + Inventory component3 = gameObject2.GetComponent(); + if (component3 != null) + { + if (component3.availableItems.Length > num2) + { + Searching component4 = gameObject2.GetComponent(); + if (component4 != null) + { + Locker locker = UnityEngine.Object.FindObjectOfType(); + if (locker != null) + { + if (component3.netFreeSlots > 0) + { + int[] ids = locker.ids; + locker.ids = new int[] + { + num2 + }; + component4.CallCmdPickupItem(locker.gameObject, gameObject2); + locker.SetTaken(false); + locker.ids = ids; + } + else + { + component4.CallCmdPickupItem(locker.gameObject, gameObject2); + locker.SetTaken(false); + component3.CallCmdSetPickup(num2, -4.65664672E+11f, component3.transform.position, component3.transform.rotation, component3.transform.localRotation); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + component3.CallCmdSetPickup(num2, -4.65664672E+11f, component3.transform.position, component3.transform.rotation, component3.transform.localRotation); + component3.netFreeSlots--; + } + } + a2 = "none"; + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - item does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - Player has no inventory!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - Player is an SCP!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a2 = "none"; + } + } + if (a2 == "offline" || a2 == "online") + { + this.AddLog((!(a2 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + else + { + this.AddLog("ITEM#" + num2.ToString("000") + " has been added!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Second argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else if (cmd == "GIVEPLAYER") + { + int num3 = 0; + if (array.Length >= 3 && int.TryParse(array[2], out num3)) + { + string text = array[1]; + string a3 = "offline"; + foreach (GameObject gameObject3 in PlayerManager.singleton.players) + { + a3 = "online"; + CharacterClassManager component5 = gameObject3.GetComponent(); + NicknameSync component6 = gameObject3.GetComponent(); + if (component5 != null && component5.klasy[component5.NetworkcurClass].team != Team.SCP) + { + if (component6 != null) + { + if (component6.NetworkmyNick.ToLower().Contains(text.ToLower())) + { + Inventory component7 = gameObject3.GetComponent(); + if (component7 != null) + { + if (component7.availableItems.Length > num3) + { + Searching component8 = gameObject3.GetComponent(); + if (component8 != null) + { + Locker locker2 = UnityEngine.Object.FindObjectOfType(); + if (locker2 != null) + { + if (component7.netFreeSlots > 0) + { + int[] ids2 = locker2.ids; + locker2.ids = new int[] + { + num3 + }; + component8.CallCmdPickupItem(locker2.gameObject, gameObject3); + locker2.SetTaken(false); + locker2.ids = ids2; + } + else + { + component8.CallCmdPickupItem(locker2.gameObject, gameObject3); + locker2.SetTaken(false); + component7.CallCmdSetPickup(num3, -4.65664672E+11f, component7.transform.position, component7.transform.rotation, component7.transform.localRotation); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + component7.CallCmdSetPickup(num3, -4.65664672E+11f, component7.transform.position, component7.transform.rotation, component7.transform.localRotation); + component7.netFreeSlots--; + } + } + a3 = "none"; + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - item does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player has no inventory!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog(string.Concat(new string[] + { + "Failed to add ITEM#", + num3.ToString("000"), + " - Username doesn't match! (\"", + component6.NetworkmyNick, + "\" against \"", + text, + "\")" + }), new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a3 = "none"; + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player has no nickname!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a3 = "none"; + } + } + else + { + this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - Player is an SCP!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + a3 = "none"; + } + } + if (a3 == "offline" || a3 == "online") + { + this.AddLog((!(a3 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + else + { + this.AddLog("ITEM#" + num3.ToString("000") + " has been added!", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + } + } + else + { + this.AddLog("Third argument has to be a number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + else if (cmd == "ITEMLIST") { - string a4 = "offline"; - foreach (GameObject gameObject4 in GameObject.FindGameObjectsWithTag("Player")) + string a2 = "offline"; + foreach (GameObject gameObject2 in GameObject.FindGameObjectsWithTag("Player")) { - int num4 = 1; - if (array.Length >= 2 && !int.TryParse(array[1], out num4)) + int num2 = 1; + if (array.Length >= 2 && !int.TryParse(array[1], out num2)) { this.AddLog("Please enter correct page number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); return this.response; } - if (gameObject4.GetComponent().isLocalPlayer) + if (gameObject2.GetComponent().isLocalPlayer) { - a4 = "online"; - Inventory component9 = gameObject4.GetComponent(); - if (component9 != null) + a2 = "online"; + Inventory component2 = gameObject2.GetComponent(); + if (component2 != null) { - a4 = "none"; - if (num4 < 1) + a2 = "none"; + if (num2 < 1) { - this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num2 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); this.RefreshConsoleScreen(); return this.response; } - Item[] availableItems = component9.availableItems; - for (int j = 10 * (num4 - 1); j < 10 * num4; j++) + Item[] availableItems = component2.availableItems; + for (int i = 10 * (num2 - 1); i < 10 * num2; i++) { - if (10 * (num4 - 1) > availableItems.Length) + if (10 * (num2 - 1) > availableItems.Length) { - this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num2 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); break; } - if (j >= availableItems.Length) + if (i >= availableItems.Length) { break; } - this.AddLog("ITEM#" + j.ToString("000") + " : " + availableItems[j].label, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog("ITEM#" + i.ToString("000") + " : " + availableItems[i].label, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); } } } } - if (a4 != "none") + if (a2 != "none") { - this.AddLog((!(a4 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog((!(a2 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } else if (cmd == "CLS" || cmd == "CLEAR") @@ -333,7 +465,7 @@ public string TypeCommand(string cmd) { if (commandHint.name == b) { - this.AddLog(commandHint.name + " - " + commandHint.fullDesc, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog(commandHint.name + " - " + commandHint.fullDesc + "LOGTYPE02", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); this.RefreshConsoleScreen(); return this.response; } @@ -342,10 +474,10 @@ public string TypeCommand(string cmd) this.RefreshConsoleScreen(); return this.response; } - this.AddLog("List of available commands:\n", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog("List of available commands:LOGTYPE02", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); foreach (Console.CommandHint commandHint2 in this.hints) { - this.AddLog(commandHint2.name + " - " + commandHint2.shortDesc, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), true); + this.AddLog(commandHint2.name + " - " + commandHint2.shortDesc + "LOGTYPE02", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), true); } this.AddLog("Type 'HELP [COMMAND]' to print a full description of the chosen command.", new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); this.RefreshConsoleScreen(); @@ -364,20 +496,20 @@ public string TypeCommand(string cmd) else { bool flag = false; - string text2 = array[1]; + string text = array[1]; using (List.Enumerator enumerator = this.values.GetEnumerator()) { while (enumerator.MoveNext()) { - if (enumerator.Current.key == text2) + if (enumerator.Current.key == text) { flag = true; this.AddLog(string.Concat(new string[] { "The value of ", - text2, + text, " is: @#{[", - text2, + text, "}]#@" }), new Color32(50, 70, 100, byte.MaxValue), false); } @@ -385,31 +517,31 @@ public string TypeCommand(string cmd) } if (!flag) { - this.AddLog("Key " + text2 + " not found!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Key " + text + " not found!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } } else if (cmd == "SEED") { - GameObject gameObject5 = GameObject.Find("Host"); - int num5 = -1; - if (gameObject5 != null) + GameObject gameObject3 = GameObject.Find("Host"); + int num3 = -1; + if (gameObject3 != null) { - num5 = gameObject5.GetComponent().seed; + num3 = gameObject3.GetComponent().seed; } - this.AddLog("Map seed is: " + ((num5 != -1) ? num5.ToString() : "NONE") + "", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + this.AddLog("Map seed is: " + ((num3 != -1) ? num3.ToString() : "NONE") + "", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); } else if (cmd == "SHOWRIDS") { - GameObject[] array4 = GameObject.FindGameObjectsWithTag("RoomID"); - foreach (GameObject gameObject6 in array4) + GameObject[] array2 = GameObject.FindGameObjectsWithTag("RoomID"); + foreach (GameObject gameObject4 in array2) { - gameObject6.GetComponentsInChildren()[0].enabled = !gameObject6.GetComponentsInChildren()[0].enabled; - gameObject6.GetComponentsInChildren()[1].enabled = !gameObject6.GetComponentsInChildren()[1].enabled; + gameObject4.GetComponentsInChildren()[0].enabled = !gameObject4.GetComponentsInChildren()[0].enabled; + gameObject4.GetComponentsInChildren()[1].enabled = !gameObject4.GetComponentsInChildren()[1].enabled; } - if (array4.Length != 0) + if (array2.Length != 0) { - this.AddLog("Show RIDS: " + array4[0].GetComponentInChildren().enabled.ToString(), new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + this.AddLog("Show RIDS: " + array2[0].GetComponentInChildren().enabled.ToString(), new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); } else { @@ -418,85 +550,94 @@ public string TypeCommand(string cmd) } else if (cmd == "CLASSLIST") { - string a5 = "offline"; - foreach (GameObject gameObject7 in GameObject.FindGameObjectsWithTag("Player")) + string a3 = "offline"; + foreach (GameObject gameObject5 in GameObject.FindGameObjectsWithTag("Player")) { - int num6 = 1; - if (array.Length >= 2 && !int.TryParse(array[1], out num6)) + int num4 = 1; + if (array.Length >= 2 && !int.TryParse(array[1], out num4)) { this.AddLog("Please enter correct page number!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); return this.response; } - if (gameObject7.GetComponent().isLocalPlayer) + if (gameObject5.GetComponent().isLocalPlayer) { - a5 = "online"; - CharacterClassManager component10 = gameObject7.GetComponent(); - if (component10 != null) + a3 = "online"; + CharacterClassManager component3 = gameObject5.GetComponent(); + if (component3 != null) { - a5 = "none"; - if (num6 < 1) + a3 = "none"; + if (num4 < 1) { - this.AddLog("Page '" + num6 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); this.RefreshConsoleScreen(); return this.response; } - Class[] klasy = component10.klasy; - for (int k = 10 * (num6 - 1); k < 10 * num6; k++) + Class[] klasy = component3.klasy; + for (int j = 10 * (num4 - 1); j <= 10 * num4; j++) { - if (10 * (num6 - 1) > klasy.Length) + if (10 * (num4 - 1) > klasy.Length) { - this.AddLog("Page '" + num6 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog("Page '" + num4 + "' does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); break; } - if (k >= klasy.Length) + if (j >= klasy.Length) { break; } - this.AddLog("CLASS#" + k.ToString("000") + " : " + klasy[k].fullName, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); + this.AddLog(string.Concat(new object[] + { + "CLASS#", + j.ToString("000"), + " : ", + klasy[j].fullName, + " (Max HP: ", + klasy[j].maxHP, + ")" + }), new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), false); } } } } - if (a5 != "none") + if (a3 != "none") { - this.AddLog((!(a5 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog((!(a3 == "offline")) ? "Player inventory script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } } else if (cmd == "GOTO") { if (array.Length >= 2) { - GameObject gameObject8 = null; - foreach (GameObject gameObject9 in GameObject.FindGameObjectsWithTag("RoomID")) + GameObject gameObject6 = null; + foreach (GameObject gameObject7 in GameObject.FindGameObjectsWithTag("RoomID")) { - if (gameObject9.GetComponent().id.ToUpper() == array[1].ToUpper()) + if (gameObject7.GetComponent().id.ToUpper() == array[1].ToUpper()) { - gameObject8 = gameObject9; + gameObject6 = gameObject7; } } - string a6 = "offline"; - if (gameObject8 != null) + string a4 = "offline"; + if (gameObject6 != null) { - foreach (GameObject gameObject10 in GameObject.FindGameObjectsWithTag("Player")) + foreach (GameObject gameObject8 in GameObject.FindGameObjectsWithTag("Player")) { - if (gameObject10.GetComponent().isLocalPlayer) + if (gameObject8.GetComponent().isLocalPlayer) { - if (array[1].ToUpper() == "RANGE" && !gameObject10.GetComponent().isOnRange) + if (array[1].ToUpper() == "RANGE" && !gameObject8.GetComponent().isOnRange) { - a6 = "range"; + a4 = "range"; } else { - a6 = "none"; - gameObject10.transform.position = gameObject8.transform.position; + a4 = "none"; + gameObject8.transform.position = gameObject6.transform.position; } } } - if (a6 == "range") + if (a4 == "range") { this.AddLog("Shooting range is disabled!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } - else if (a6 == "offline") + else if (a4 == "offline") { this.AddLog("You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } @@ -518,23 +659,23 @@ public string TypeCommand(string cmd) } else if (cmd == "RANGE") { - string a7 = "offline"; - foreach (GameObject gameObject11 in GameObject.FindGameObjectsWithTag("Player")) + string a5 = "offline"; + foreach (GameObject gameObject9 in GameObject.FindGameObjectsWithTag("Player")) { - if (gameObject11.GetComponent().isLocalPlayer) + if (gameObject9.GetComponent().isLocalPlayer) { - a7 = "online"; - ShootingRange component11 = gameObject11.GetComponent(); - if (component11 != null) + a5 = "online"; + ShootingRange component4 = gameObject9.GetComponent(); + if (component4 != null) { - a7 = "none"; - component11.isOnRange = true; + a5 = "none"; + component4.isOnRange = true; } } } - if (a7 == "offline" || a7 == "online") + if (a5 == "offline" || a5 == "online") { - this.AddLog((!(a7 == "offline")) ? "Player range script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + this.AddLog((!(a5 == "offline")) ? "Player range script couldn't be find!" : "You cannot use that command if you are not playing on any server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } else { @@ -544,15 +685,15 @@ public string TypeCommand(string cmd) else if (cmd == "ROUNDRESTART") { bool flag2 = false; - GameObject[] array5 = GameObject.FindGameObjectsWithTag("Player"); - for (int l = 0; l < array5.Length; l++) + GameObject[] array3 = GameObject.FindGameObjectsWithTag("Player"); + for (int k = 0; k < array3.Length; k++) { - PlayerStats component12 = array5[l].GetComponent(); - if (component12.isLocalPlayer && component12.isServer) + PlayerStats component5 = array3[k].GetComponent(); + if (component5.isLocalPlayer && component5.isServer) { flag2 = true; this.AddLog("The round is about to restart! Please wait..", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - component12.Roundrestart(); + component5.Roundrestart(); } } if (!flag2) @@ -568,14 +709,14 @@ public string TypeCommand(string cmd) } else { - string text3 = array[1]; - if (text3 != null) + string text2 = array[1]; + if (text2 != null) { - if (!(text3 == "RELOAD") && !(text3 == "R") && !(text3 == "RLD")) + if (!(text2 == "RELOAD") && !(text2 == "R") && !(text2 == "RLD")) { - if (!(text3 == "PATH")) + if (!(text2 == "PATH")) { - if (text3 == "VALUE") + if (text2 == "VALUE") { if (array.Length < 3) { @@ -595,6 +736,7 @@ public string TypeCommand(string cmd) } else if (ConfigFile.singleton.ReloadConfig()) { + ((CustomNetworkManager) NetworkManager.singleton).UpdateMotd(0); this.AddLog("Configuration file successfully reloaded. New settings will be applied on your server in next round.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); } else @@ -617,22 +759,22 @@ public string TypeCommand(string cmd) while (enumerator2.MoveNext()) { NetworkConnection networkConnection = enumerator2.Current; - string text4 = string.Empty; - GameObject gameObject12 = Console.FindConnectedRoot(networkConnection); - if (gameObject12 != null) + string text3 = string.Empty; + GameObject gameObject10 = Console.FindConnectedRoot(networkConnection); + if (gameObject10 != null) { - text4 = gameObject12.GetComponent().myNick; + text3 = gameObject10.GetComponent().myNick; } - if (text4 == string.Empty) + if (text3 == string.Empty) { this.AddLog("Player :: " + networkConnection.address, new Color32(160, 128, 128, byte.MaxValue), true); } else { - this.AddLog("Player :: " + text4 + " :: " + networkConnection.address, new Color32(128, 160, 128, byte.MaxValue), true); + this.AddLog("Player :: " + text3 + " :: " + networkConnection.address, new Color32(128, 160, 128, byte.MaxValue), true); } } - goto IL_1AE6; + goto IL_1386; } } int duration = 0; @@ -641,8 +783,8 @@ public string TypeCommand(string cmd) bool flag3 = false; foreach (NetworkConnection networkConnection2 in NetworkServer.connections) { - GameObject gameObject13 = Console.FindConnectedRoot(networkConnection2); - if (networkConnection2.address.ToUpper().Contains(array[1]) || (gameObject13 != null && gameObject13.GetComponent().myNick.ToUpper().Contains(array[1]))) + GameObject gameObject11 = Console.FindConnectedRoot(networkConnection2); + if (networkConnection2.address.ToUpper().Contains(array[1]) || (gameObject11 != null && gameObject11.GetComponent().myNick.ToUpper().Contains(array[1]))) { flag3 = true; BanPlayer.BanConnection(networkConnection2, duration); @@ -679,8 +821,214 @@ public string TypeCommand(string cmd) { this.AddLog("Command " + cmd + " does not exist!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); } - IL_1AE6: + IL_1386: return this.response; } + + public void ProceedButton() + { + if (this.cmdField.text != string.Empty) + { + this.TypeCommand(this.cmdField.text); + } + this.cmdField.text = string.Empty; + EventSystem.current.SetSelectedGameObject(this.cmdField.gameObject); + } + + public void LateUpdate() + { + if (Input.GetKeyDown(KeyCode.Return)) + { + this.ProceedButton(); + } + if (Input.GetKeyDown(KeyCode.BackQuote)) + { + this.ToggleConsole(); + } + this.scrollup += Mathf.RoundToInt(Input.GetAxisRaw("Mouse ScrollWheel") * 10f); + if (this.logs.Count > 0) + { + this.scrollup = Mathf.Clamp(this.scrollup, 0, this.logs.Count - 1); + } + else + { + this.scrollup = 0; + } + if (this.previous_scrlup != this.scrollup) + { + this.previous_scrlup = this.scrollup; + this.RefreshConsoleScreen(); + } + Scene activeScene = SceneManager.GetActiveScene(); + if (activeScene.name != this.loadedLevel) + { + this.loadedLevel = activeScene.name; + this.AddLog(string.Concat(new string[] + { + "Scene Manager: Loaded scene '", + activeScene.name, + "' [", + activeScene.path, + "]" + }), new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + this.RefreshConsoleScreen(); + } + if (this.allwaysRefreshing) + { + this.RefreshConsoleScreen(); + } + } + + public void ToggleConsole() + { + CursorManager.consoleOpen = !this.console.activeSelf; + this.cmdField.text = string.Empty; + this.console.SetActive(!this.console.activeSelf); + if (PlayerManager.singleton != null) + { + foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("Player")) + { + if (gameObject.GetComponent().isLocalPlayer) + { + FirstPersonController component = gameObject.GetComponent(); + if (component != null) + { + component.usingConsole = this.console.activeSelf; + } + } + } + } + if (this.console.activeSelf) + { + EventSystem.current.SetSelectedGameObject(this.cmdField.gameObject); + } + } + + public void QuitGame() + { + Application.Quit(); + } + + public void DumpGameObjStats() + { + GameObject[] array = UnityEngine.Object.FindObjectsOfType(); + Dictionary dictionary = new Dictionary(); + foreach (GameObject gameObject in array) + { + int num; + dictionary.TryGetValue(gameObject.name.Trim(), out num); + num++; + dictionary.Add(gameObject.name.Trim(), num); + ServerConsole.AddLog(gameObject.name.Trim() + " " + num); + } + string text = "C:\\dev\\unity-scene_stats.txt"; + ServerConsole.AddLog("Dumping scene stats to " + text + " ..."); + using (StreamWriter streamWriter = new StreamWriter(text, false)) + { + foreach (KeyValuePair keyValuePair in dictionary) + { + streamWriter.WriteLine("{0}={1}", keyValuePair.Key, keyValuePair.Value); + } + } + ServerConsole.AddLog("Scene dumped to " + text); + } + + public void GetStats(string parent, Component obj, Dictionary dictionary) + { + string key = parent + "_" + obj.GetType().Name; + int num = 0; + dictionary.TryGetValue(key, out num); + dictionary.Add(parent + obj.tag, num++); + } + + public void GetStats(string parent, GameObject obj, Dictionary dictionary, HashSet done) + { + if (done.Contains(obj.GetInstanceID())) + { + return; + } + string text = parent + "_" + obj.name; + int num = 0; + dictionary.TryGetValue(text, out num); + dictionary.Add(parent + obj.tag, num++); + done.Add(obj.GetInstanceID()); + foreach (Component component in base.gameObject.GetComponents()) + { + if (!(component == obj)) + { + this.GetStats(text, component, dictionary); + } + } + } + + public bool allwaysRefreshing; + + public List logs = new List(); + + public List values = new List(); + + public Console.CommandHint[] hints; + + public Text txt; + + public InputField cmdField; + + public GameObject console; + + public static Console singleton; + + public int scrollup; + + public int previous_scrlup; + + public string loadedLevel; + + public string response = string.Empty; + + [Serializable] + public class CommandHint + { + public CommandHint() + { + } + + public string name; + + public string shortDesc; + + [Multiline] + public string fullDesc; + } + + [Serializable] + public class Value + { + public Value(string k, string v) + { + this.key = k; + this.value = v; + } + + public string key; + + public string value; + } + + [Serializable] + public class Log + { + public Log(string t, Color32 c, bool b) + { + this.text = t; + this.color = c; + this.nospace = b; + } + + public string text; + + public Color32 color; + + public bool nospace; + } } } diff --git a/server_mod/Inventory.cs b/server_mod/Inventory.cs index 19d9e5e..c2bed93 100644 --- a/server_mod/Inventory.cs +++ b/server_mod/Inventory.cs @@ -4,10 +4,8 @@ using UnityEngine.Networking; using UnityEngine.UI; -// Token: 0x02000092 RID: 146 public partial class Inventory : NetworkBehaviour { - // Token: 0x06000348 RID: 840 RVA: 0x000181B8 File Offset: 0x000163B8 [Command(channel = 2)] public void CmdSetPickup(int dropedItemID, float dur, Vector3 pos, Quaternion camRot, Quaternion myRot) { @@ -24,8 +22,8 @@ public void CmdSetPickup(int dropedItemID, float dur, Vector3 pos, Quaternion ca ":", UnityEngine.Random.Range(0f, 1E+10f).ToString("0000000000") })); - this.netFreeSlots++; + this.smNetFreeSlots++; } - public int netFreeSlots; + public int smNetFreeSlots; } diff --git a/server_mod/RadioInitializator.cs b/server_mod/RadioInitializator.cs index 7644389..cb6c640 100644 --- a/server_mod/RadioInitializator.cs +++ b/server_mod/RadioInitializator.cs @@ -7,10 +7,8 @@ using UnityEngine.Networking; using UnityEngine.UI; -// Token: 0x020000AD RID: 173 public partial class RadioInitializator : NetworkBehaviour { - // Token: 0x0600045E RID: 1118 public void LateUpdate() { if (base.isLocalPlayer && !base.isServer) diff --git a/server_mod/ResolutionManager.cs b/server_mod/ResolutionManager.cs index 25bb5cc..6c594ea 100644 --- a/server_mod/ResolutionManager.cs +++ b/server_mod/ResolutionManager.cs @@ -1,12 +1,10 @@ -using System; +using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; -// Token: 0x02000052 RID: 82 public partial class ResolutionManager : MonoBehaviour { - // Token: 0x0600016E RID: 366 RVA: 0x00010114 File Offset: 0x0000E314 public static void RefreshScreen() { if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null) @@ -14,12 +12,13 @@ public static void RefreshScreen() return; } ResolutionManager.presets[ResolutionManager.preset].SetResolution(); - try - { - UnityEngine.Object.FindObjectOfType().txt.text = ResolutionManager.presets[ResolutionManager.preset].width + " × " + ResolutionManager.presets[ResolutionManager.preset].height; - } - catch - { - } - } + + try + { + UnityEngine.Object.FindObjectOfType().txt.text = ResolutionManager.presets[ResolutionManager.preset].width + " × " + ResolutionManager.presets[ResolutionManager.preset].height; + } + catch + { + } + } } diff --git a/server_mod/RoundSummary.cs b/server_mod/RoundSummary.cs index ef6fe0a..252c447 100644 --- a/server_mod/RoundSummary.cs +++ b/server_mod/RoundSummary.cs @@ -1,11 +1,43 @@ using System; +using GameConsole; +using TMPro; +using Unity; using UnityEngine; using UnityEngine.Networking; -// Token: 0x020000C0 RID: 192 -public partial class RoundSummary : NetworkBehaviour +public class RoundSummary : NetworkBehaviour { - // Token: 0x060004C3 RID: 1219 RVA: 0x0001A068 File Offset: 0x00018268 + private void Awake() + { + Radio.roundEnded = false; + } + + private void Start() + { + this.pm = PlayerManager.singleton; + this.ccm = base.GetComponent(); + base.InvokeRepeating("CheckForEnding", 12f, 3f); + } + + private void RoundRestart() + { + bool isOwner = false; + foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("Player")) + { + PlayerStats playerStats = gameObject.GetComponent(); + if (playerStats.isLocalPlayer && playerStats.isServer) + { + isOwner = true; + GameConsole.Console.singleton.AddLog("The round is about to restart! Please wait..", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + playerStats.Roundrestart(); + } + } + if (!isOwner) + { + GameConsole.Console.singleton.AddLog("You're not owner of this server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + public void CheckForEnding() { if (base.isLocalPlayer && base.isServer && !this.roundHasEnded) @@ -14,6 +46,7 @@ public void CheckForEnding() { return; } + this._ClassDs = 0; this._ChaosInsurgency = 0; this._MobileForces = 0; @@ -21,10 +54,11 @@ public void CheckForEnding() this._Scientists = 0; this._SCPs = 0; this._SCPsNozombies = 0; + GameObject[] players = this.pm.players; - foreach (GameObject gameObject in players) - { - CharacterClassManager component = gameObject.GetComponent(); + foreach (GameObject player in players) + { + CharacterClassManager component = player.GetComponent(); if (component.curClass >= 0) { Team team = component.klasy[component.curClass].team; @@ -58,24 +92,25 @@ public void CheckForEnding() } } } - int num = 0; + + int enemies = 0; if (this._ClassDs > 0) { - num++; + enemies++; } if (this._MobileForces > 0 || this._Scientists > 0) { - num++; + enemies++; } if (this._SCPs > 0) { - num++; + enemies++; } if (this._ChaosInsurgency > 0 && (this._MobileForces > 0 || this._Scientists > 0)) { - num = 3; + enemies = 3; } - if (num <= 1 && players.Length >= 2) + if (enemies <= 1 && players.Length >= 2) { this.roundHasEnded = true; } @@ -83,16 +118,251 @@ public void CheckForEnding() { this.roundHasEnded = false; } + this.summary.scp_alive = this._SCPs; this.summary.scp_nozombies = this._SCPsNozombies; if (this.roundHasEnded) { this.summary.classD_escaped += this._ClassDs; this.summary.scientists_escaped += this._Scientists; - int @int = ConfigFile.GetInt("auto_round_restart_time", 10); - this.CallCmdSetSummary(this.summary, @int); - base.Invoke("RoundRestart", (float)@int); + int roundRestartTime = ConfigFile.GetInt("auto_round_restart_time", 10); + this.CallCmdSetSummary(this.summary, roundRestartTime); + base.Invoke("RoundRestart", (float) roundRestartTime); } } } + + private void Update() + { + if (RoundSummary.host == null) + { + GameObject gameObject = GameObject.Find("Host"); + if (gameObject != null) + { + RoundSummary.host = gameObject.GetComponent(); + } + } + } + + private void UNetVersion() + { + } + + protected static void InvokeCmdCmdSetSummary(NetworkBehaviour obj, NetworkReader reader) + { + if (!NetworkServer.active) + { + Debug.LogError("Command CmdSetSummary called on client."); + return; + } + ((RoundSummary)roundSummary).CmdSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int)reader.ReadPackedUInt32()); + } + + [Command(channel = 15)] + private void CmdSetSummary(RoundSummary.Summary sum, int posttime) + { + this.CallRpcSetSummary(sum, posttime); + } + + [ClientRpc(channel = 15)] + public void RpcSetSummary(RoundSummary.Summary sum, int posttime) + { + Radio.roundEnded = true; + string roundSumText = string.Empty; + + roundSumText = string.Concat(new object[] + { + text2, + "", + sum.classD_escaped, + "/", + sum.classD_start, + " ", + TranslationReader.Get("Legancy_Interfaces", 3), + "\n" + }); + + roundSumText += string.Concat(new object[] + { + text2, + "", + sum.scientists_escaped, + "/", + sum.scientists_start, + " ", + TranslationReader.Get("Legancy_Interfaces", 4), + "\n" + }); + + roundSumText += string.Concat(new object[] + { + text2, + "", + sum.scp_frags, + " ", + TranslationReader.Get("Legancy_Interfaces", 5), + "\n" + }); + + roundSumText += string.Concat(new object[] + { + text2, + "", + Mathf.Clamp(sum.scp_start - sum.scp_alive, 0, sum.scp_start), + "/", + sum.scp_start, + " ", + TranslationReader.Get("Legancy_Interfaces", 6), + "\n" + }); + + roundSumText += string.Concat(new string[] + { + text2, + TranslationReader.Get("Legancy_Interfaces", 7), + ": ", + (!sum.warheadDetonated) ? TranslationReader.Get("Legancy_Interfaces", 9) : TranslationReader.Get("Legancy_Interfaces", 8), + "\n\n" + }); + + roundSumText += TranslationReader.Get("Legancy_Interfaces", 10).Replace("[time]", posttime.ToString()); + + GameObject gameObject = UserMainInterface.singleton.summary; + gameObject.SetActive(true); + TextMeshProUGUI component = GameObject.FindGameObjectWithTag("Summary").GetComponent(); + component.text = roundSumText; + } + + private void UNetVersion() + { + } + + protected static void InvokeCmdCmdSetSummary(NetworkBehaviour roundSum, NetworkReader reader) + { + if (!NetworkServer.active) + { + Debug.LogError("Command CmdSetSummary called on client."); + return; + } + ((RoundSummary) roundSum).CmdSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int) reader.ReadPackedUInt32()); + } + + public void CallCmdSetSummary(RoundSummary.Summary sum, int posttime) + { + if (!NetworkClient.active) + { + Debug.LogError("Command function CmdSetSummary called on server."); + return; + } + if (base.isServer) + { + this.CmdSetSummary(sum, posttime); + return; + } + NetworkWriter networkWriter = new NetworkWriter(); + networkWriter.Write(0); + networkWriter.Write((short) ((ushort) 5)); + networkWriter.WritePackedUInt32((uint) RoundSummary.kCmdCmdSetSummary); + networkWriter.Write(base.GetComponent().netId); + GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); + networkWriter.WritePackedUInt32((uint) posttime); + base.SendCommandInternal(networkWriter, 15, "CmdSetSummary"); + } + + protected static void InvokeRpcRpcSetSummary(NetworkBehaviour roundSum, NetworkReader reader) + { + if (!NetworkClient.active) + { + Debug.LogError("RPC RpcSetSummary called on server."); + return; + } + ((RoundSummary) roundSum).RpcSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int) reader.ReadPackedUInt32()); + } + + public void CallRpcSetSummary(RoundSummary.Summary sum, int posttime) + { + if (!NetworkServer.active) + { + Debug.LogError("RPC Function RpcSetSummary called on client."); + return; + } + NetworkWriter networkWriter = new NetworkWriter(); + networkWriter.Write(0); + networkWriter.Write((short) ((ushort) 2)); + networkWriter.WritePackedUInt32((uint) RoundSummary.kRpcRpcSetSummary); + networkWriter.Write(base.GetComponent().netId); + GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); + networkWriter.WritePackedUInt32((uint) posttime); + this.SendRPCInternal(networkWriter, 15, "RpcSetSummary"); + } + + static RoundSummary() + { + NetworkBehaviour.RegisterCommandDelegate(typeof(RoundSummary), RoundSummary.kCmdCmdSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeCmdCmdSetSummary)); + RoundSummary.kRpcRpcSetSummary = -1626633486; + NetworkBehaviour.RegisterRpcDelegate(typeof(RoundSummary), RoundSummary.kRpcRpcSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeRpcRpcSetSummary)); + NetworkCRC.RegisterBehaviour("RoundSummary", 0); + } + + public override bool OnSerialize(NetworkWriter writer, bool forceAll) + { + bool result; + return result; + } + + public override void OnDeserialize(NetworkReader reader, bool initialState) + { + } + + public bool debugMode; + + private bool roundHasEnded; + + private PlayerManager pm; + + private CharacterClassManager ccm; + + public static RoundSummary host; + + public RoundSummary.Summary summary; + + private int _ClassDs; + + private int _ChaosInsurgency; + + private int _MobileForces; + + private int _Spectators; + + private int _Scientists; + + private int _SCPs; + + private int _SCPsNozombies; + + private static int kCmdCmdSetSummary = 509590172; + + private static int kRpcRpcSetSummary; + + [Serializable] + public class Summary + { + public int classD_escaped; + + public int classD_start; + + public int scientists_escaped; + + public int scientists_start; + + public int scp_frags; + + public int scp_start; + + public int scp_alive; + + public int scp_nozombies; + + public bool warheadDetonated; + } } diff --git a/server_mod/Scp914_Controller.cs b/server_mod/Scp914_Controller.cs index 94ad00a..524fb4b 100644 --- a/server_mod/Scp914_Controller.cs +++ b/server_mod/Scp914_Controller.cs @@ -4,24 +4,23 @@ using UnityEngine; using UnityEngine.Networking; -// Token: 0x020000C9 RID: 201 + public partial class Scp914_Controller : NetworkBehaviour { - // Token: 0x0600058B RID: 1419 - [Command(channel = 2)] - public void CmdSetupPickup(string label, int result, Vector3 pos) - { - GameObject gameObject = GameObject.Find(label); - if (gameObject != null) - { - Pickup pickup = gameObject.GetComponent(); - Pickup pickupParent = gameObject.GetComponentInParent(); - if (pickup != null && pickupParent != null) - { - pickup.SetDurability(this.avItems[result].durability); - pickupParent.SetID(result); - pickupParent.SetPosition(pos); - } - } - } + [Command(channel = 2)] + public void CmdSetupPickup(string label, int result, Vector3 pos) + { + GameObject gameObject = GameObject.Find(label); + if (gameObject != null) + { + Pickup pickup = gameObject.GetComponent(); + Pickup parentPickup = gameObject.GetComponentInParent(); + if (pickup != null && parentPickup != null) + { + pickup.SetDurability(this.avItems[result].durability); + parentPickup.SetID(result); + parentPickup.SetPosition(pos); + } + } + } } diff --git a/server_mod/Searching.cs b/server_mod/Searching.cs index e7ccc64..0a72c66 100644 --- a/server_mod/Searching.cs +++ b/server_mod/Searching.cs @@ -19,7 +19,7 @@ public void CmdPickupItem(GameObject t, GameObject taker) component.PickupItem(); if (component2 != null) { - component2.netFreeSlots--; + component2.smNetFreeSlots--; } } Locker component3 = t.GetComponent(); @@ -29,7 +29,7 @@ public void CmdPickupItem(GameObject t, GameObject taker) component3.SetTaken(true); if (component2 != null) { - component2.netFreeSlots--; + component2.smNetFreeSlots--; } } this.CallRpcPickupItem(taker, id, (!(t.GetComponent() == null)) ? component.durability : -1f); diff --git a/server_mod/ServerConsole.cs b/server_mod/ServerConsole.cs index 5baf6c5..420f4b4 100644 --- a/server_mod/ServerConsole.cs +++ b/server_mod/ServerConsole.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Diagnostics; using UnityEngine; @@ -44,12 +44,14 @@ public IEnumerator RefreshSession() ServerConsole.AddLog("Could not update the session - " + www.error + www.text + "LOGTYPE-8"); } yield return new WaitForSeconds(5f - (Time.realtimeSinceStartup - timeBefore)); - form = null; - www = null; - } + + form = null; + www = null; + } yield break; } + public string smParseName(string name, int players) { CustomNetworkManager customNetworkManager = (CustomNetworkManager)CustomNetworkManager.singleton; From 6b524352b9b53bffb990f4f67789beb8cc07db95 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 19:58:49 -0500 Subject: [PATCH 14/27] Updated README.md --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b844b50..7b04a99 100644 --- a/README.md +++ b/README.md @@ -101,25 +101,29 @@ Example: - max_players (default 20, max amount of players per server) - no_scp079_first (default true, computer will never be the first scp in a game) - nuke_disable_cooldown stop the nuke from being spammed, will stop the nuke arm switch from being disabled until this has elapsed. Default = 0 +- 173_door_starting_cooldown time (in seconds) before SCP-173's door can be opened - SCP106_cleanup use this to stop ragdolls spawning in the pocket dimension [currently items still spawn] - SCP049_HP use this to set the starting HP for the class. Default = 1200 - SCP049-2_HP use this to set the starting HP for the class. Default = 400 - SCP079_HP use this to set the starting HP for the class. Default = 100 +- SCP096_HP use this to set the starting HP for the class. Default = 2000 - SCP106_HP use this to set the starting HP for the class. Default = 700 - SCP173_HP use this to set the starting HP for the class. Default = 2000 - SCP457_HP use this to set the starting HP for the class. Default = 700 - CLASSD_HP use this to set the starting HP for the class. Default = 100 -- NTFSCIENTIST_HP use this to set the starting HP for the class. Default = 100 +- NTFSCIENTIST_HP use this to set the starting HP for the class. Default = 120 - SCIENTIST_HP use this to set the starting HP for the class. Default = 100 - CI_HP use this to set the starting HP for the class. Default = 120 - NTFL_HP use this to set the starting HP for the class. Default = 120 - NTFC_HP use this to set the starting HP for the class. Default = 150 - NTFG_HP use this to set the starting HP for the class. Default = 100 - SCP049_DISABLE disable this scp, default: no -- SCP079_DISABLE disable this scp, default: no +- SCP079_DISABLE disable this scp, default: yes +- SCP096_DISABLE disable this scp, default: yes - SCP106_DISABLE disable this scp, default: no - SCP173_DISABLE disable this scp, default: no -- SCP457_DISABLE disable this scp, default: no +- SCP457_DISABLE disable this scp, default: yes +- FORCE_DISABLE_ENABLE overrides game's default ban value with chosen values (USE OF THIS IS NOT RECOMMENDED) ## Place any suggestions/problems in issues! From 7698f54aff1fc27cc3368473758c3cc6527ded0e Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:02:21 -0500 Subject: [PATCH 15/27] Modified config_template.txt --- config_template.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/config_template.txt b/config_template.txt index 270f540..4216cdb 100644 --- a/config_template.txt +++ b/config_template.txt @@ -9,7 +9,7 @@ map_seed = -1; (-1 = random) intercom_cooldown = 120; intercom_max_speech_time = 20; auto_round_restart_time = 10; -friendly_fire = true; +friendly_fire = false; /////////////////////////////////// @@ -26,14 +26,16 @@ NO_SCP079_FIRST = true; SCP049_HP = 1200; SCP049-2_HP = 400; SCP079_HP = 100; +SCP096_HP = 2000; SCP106_HP = 700; -SCP457_HP = 700; SCP173_HP = 2000; -max_players = 30; - +SCP457_HP = 700; +max_players = 25; // server_name can stuff up the cfg reader depending on its contents, so keep it down the bottom. server_ip = auto; -administrator_password = pwd; -server_name = servername; - +server_name = [nick]'s game; +ban_database_folder = [appdata]/SCP Secret Laboratory/Bans; +administrator_password = none; +port_queue = 7777,7778,7779,7780,7781,7782,7783,7784; +serverinfo_pastebin_id = 7wV681fT; \ No newline at end of file From bdb37fcf1807126366013569154156636132f5d7 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:14:15 -0500 Subject: [PATCH 16/27] Fixed variable naming issue in Console.cs --- server_mod/GameConsole/Console.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server_mod/GameConsole/Console.cs b/server_mod/GameConsole/Console.cs index c99cd63..ebc7b9c 100644 --- a/server_mod/GameConsole/Console.cs +++ b/server_mod/GameConsole/Console.cs @@ -233,7 +233,7 @@ public string TypeCommand(string cmd) Locker locker = UnityEngine.Object.FindObjectOfType(); if (locker != null) { - if (component3.netFreeSlots > 0) + if (component3.smNetFreeSlots > 0) { int[] ids = locker.ids; locker.ids = new int[] @@ -255,7 +255,7 @@ public string TypeCommand(string cmd) { this.AddLog("Failed to add ITEM#" + num2.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); component3.CallCmdSetPickup(num2, -4.65664672E+11f, component3.transform.position, component3.transform.rotation, component3.transform.localRotation); - component3.netFreeSlots--; + component3.smNetFreeSlots--; } } a2 = "none"; @@ -319,7 +319,7 @@ public string TypeCommand(string cmd) Locker locker2 = UnityEngine.Object.FindObjectOfType(); if (locker2 != null) { - if (component7.netFreeSlots > 0) + if (component7.smNetFreeSlots > 0) { int[] ids2 = locker2.ids; locker2.ids = new int[] @@ -341,7 +341,7 @@ public string TypeCommand(string cmd) { this.AddLog("Failed to add ITEM#" + num3.ToString("000") + " - There are no lockers, silently dropping instead...", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); component7.CallCmdSetPickup(num3, -4.65664672E+11f, component7.transform.position, component7.transform.rotation, component7.transform.localRotation); - component7.netFreeSlots--; + component7.smNetFreeSlots--; } } a3 = "none"; From 04569648d84e264b5774b4dfd2227b410d147d18 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:19:58 -0500 Subject: [PATCH 17/27] Add missing import --- server_mod/CustomNetworkManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/server_mod/CustomNetworkManager.cs b/server_mod/CustomNetworkManager.cs index ff5fa8d..0942ea6 100644 --- a/server_mod/CustomNetworkManager.cs +++ b/server_mod/CustomNetworkManager.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.IO; +using Dissonance.Integrations.UNet_HLAPI; using GameConsole; using Steamworks; using TMPro; From c0b1319075dac1d56f0b9a029483d03e0f56a5d3 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:27:42 -0500 Subject: [PATCH 18/27] Remove old code reference --- server_mod/GameConsole/Console.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/server_mod/GameConsole/Console.cs b/server_mod/GameConsole/Console.cs index ebc7b9c..7612bcd 100644 --- a/server_mod/GameConsole/Console.cs +++ b/server_mod/GameConsole/Console.cs @@ -736,7 +736,6 @@ public string TypeCommand(string cmd) } else if (ConfigFile.singleton.ReloadConfig()) { - ((CustomNetworkManager) NetworkManager.singleton).UpdateMotd(0); this.AddLog("Configuration file successfully reloaded. New settings will be applied on your server in next round.", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); } else From 0e77be67ee7f97c6c75e52d9b6eae5551555db14 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:31:48 -0500 Subject: [PATCH 19/27] Add updated warhead code --- server_mod/AlphaWarheadDetonationController.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server_mod/AlphaWarheadDetonationController.cs b/server_mod/AlphaWarheadDetonationController.cs index 934ee2a..29e863d 100644 --- a/server_mod/AlphaWarheadDetonationController.cs +++ b/server_mod/AlphaWarheadDetonationController.cs @@ -146,10 +146,13 @@ private void ExplodePlayers() * } */ - GameObject[] players = PlayerManager.singleton.players; - for (int i = 0; i < players.Length; i++) + GameObject[] array = GameObject.FindGameObjectsWithTag("LiftTarget"); + foreach (GameObject player in PlayerManager.singleton.players) { - players[i].GetComponent().Explode(); + foreach (GameObject lift in array) + { + player.GetComponent().Explode(Vector3.Distance(lift.transform.position, player.transform.position) < 3.5f); + } } } From 41570843f2d95e1810bb9ee3e0b6effe713f4751 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:34:34 -0500 Subject: [PATCH 20/27] Fix minor issue with CharacterClassManager --- server_mod/CharacterClassManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index c064f26..ce53aad 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -105,7 +105,7 @@ private void Start() } // While the team queue is shorter than max player count, add more NTF to spawn in - while (this.classTeamQueue.Length < CustomNetworkManager.singleton.maxConnections) + while (this.classTeamQueue.Count < CustomNetworkManager.singleton.maxConnections) { this.classTeamQueue.Add((Team) 4); } From 44171e4be456bcbbb9796a68bf9c3cbcf2b5866c Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:38:19 -0500 Subject: [PATCH 21/27] Fixed other minor issue --- server_mod/CharacterClassManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index ce53aad..27535f0 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -150,7 +150,7 @@ private void Start() ": ", this.klasy[classID].fullName, " - ", - this.klasy[classID].curClass.maxHP, + this.klasy[classID].maxHP, "HP" })); } From 411c35679689b879b86006b900140dfddccff830 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:48:03 -0500 Subject: [PATCH 22/27] Removed useless comments --- server_mod/PlayerInteract.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/server_mod/PlayerInteract.cs b/server_mod/PlayerInteract.cs index 7b27bda..46ee4d3 100644 --- a/server_mod/PlayerInteract.cs +++ b/server_mod/PlayerInteract.cs @@ -4,10 +4,8 @@ using UnityEngine; using UnityEngine.Networking; -// Token: 0x020000A0 RID: 160 public partial class PlayerInteract : NetworkBehaviour { - // Token: 0x060003DA RID: 986 RVA: 0x00004A0D File Offset: 0x00002C0D [Command(channel = 4)] public void CmdUse294(string label) { From b4866a334ee5cf9a051514ddce0dc1118820d6a4 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:57:40 -0500 Subject: [PATCH 23/27] Fixed text compilation and formatting --- server_mod/RoundSummary.cs | 507 ++++++++++++++++++------------------- 1 file changed, 244 insertions(+), 263 deletions(-) diff --git a/server_mod/RoundSummary.cs b/server_mod/RoundSummary.cs index 252c447..784c26c 100644 --- a/server_mod/RoundSummary.cs +++ b/server_mod/RoundSummary.cs @@ -7,130 +7,130 @@ public class RoundSummary : NetworkBehaviour { - private void Awake() - { - Radio.roundEnded = false; - } - - private void Start() - { - this.pm = PlayerManager.singleton; - this.ccm = base.GetComponent(); - base.InvokeRepeating("CheckForEnding", 12f, 3f); - } - - private void RoundRestart() - { - bool isOwner = false; - foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("Player")) - { - PlayerStats playerStats = gameObject.GetComponent(); - if (playerStats.isLocalPlayer && playerStats.isServer) - { - isOwner = true; - GameConsole.Console.singleton.AddLog("The round is about to restart! Please wait..", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); - playerStats.Roundrestart(); - } - } - if (!isOwner) - { - GameConsole.Console.singleton.AddLog("You're not owner of this server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); - } - } - - public void CheckForEnding() - { - if (base.isLocalPlayer && base.isServer && !this.roundHasEnded) - { - if (!this.ccm.roundStarted) - { - return; - } - - this._ClassDs = 0; - this._ChaosInsurgency = 0; - this._MobileForces = 0; - this._Spectators = 0; - this._Scientists = 0; - this._SCPs = 0; - this._SCPsNozombies = 0; - - GameObject[] players = this.pm.players; + private void Awake() + { + Radio.roundEnded = false; + } + + private void Start() + { + this.pm = PlayerManager.singleton; + this.ccm = base.GetComponent(); + base.InvokeRepeating("CheckForEnding", 12f, 3f); + } + + private void RoundRestart() + { + bool isOwner = false; + foreach (GameObject gameObject in GameObject.FindGameObjectsWithTag("Player")) + { + PlayerStats playerStats = gameObject.GetComponent(); + if (playerStats.isLocalPlayer && playerStats.isServer) + { + isOwner = true; + GameConsole.Console.singleton.AddLog("The round is about to restart! Please wait..", new Color32(0, byte.MaxValue, 0, byte.MaxValue), false); + playerStats.Roundrestart(); + } + } + if (!isOwner) + { + GameConsole.Console.singleton.AddLog("You're not owner of this server!", new Color32(byte.MaxValue, 180, 0, byte.MaxValue), false); + } + } + + public void CheckForEnding() + { + if (base.isLocalPlayer && base.isServer && !this.roundHasEnded) + { + if (!this.ccm.roundStarted) + { + return; + } + + this._ClassDs = 0; + this._ChaosInsurgency = 0; + this._MobileForces = 0; + this._Spectators = 0; + this._Scientists = 0; + this._SCPs = 0; + this._SCPsNozombies = 0; + + GameObject[] players = this.pm.players; foreach (GameObject player in players) { - CharacterClassManager component = player.GetComponent(); - if (component.curClass >= 0) - { - Team team = component.klasy[component.curClass].team; - if (team == Team.CDP) - { - this._ClassDs++; - } - else if (team == Team.CHI) - { - this._ChaosInsurgency++; - } - else if (team == Team.MTF) - { - this._MobileForces++; - } - else if (team == Team.RIP) - { - this._Spectators++; - } - else if (team == Team.RSC) - { - this._Scientists++; - } - else if (team == Team.SCP) - { - this._SCPs++; - if (component.curClass != 10) - { - this._SCPsNozombies++; - } - } - } - } - - int enemies = 0; - if (this._ClassDs > 0) - { - enemies++; - } - if (this._MobileForces > 0 || this._Scientists > 0) - { - enemies++; - } - if (this._SCPs > 0) - { - enemies++; - } - if (this._ChaosInsurgency > 0 && (this._MobileForces > 0 || this._Scientists > 0)) - { - enemies = 3; - } - if (enemies <= 1 && players.Length >= 2) - { - this.roundHasEnded = true; - } - if (this.debugMode) - { - this.roundHasEnded = false; - } - - this.summary.scp_alive = this._SCPs; - this.summary.scp_nozombies = this._SCPsNozombies; - if (this.roundHasEnded) - { - this.summary.classD_escaped += this._ClassDs; - this.summary.scientists_escaped += this._Scientists; - int roundRestartTime = ConfigFile.GetInt("auto_round_restart_time", 10); - this.CallCmdSetSummary(this.summary, roundRestartTime); - base.Invoke("RoundRestart", (float) roundRestartTime); - } - } - } + CharacterClassManager component = player.GetComponent(); + if (component.curClass >= 0) + { + Team team = component.klasy[component.curClass].team; + if (team == Team.CDP) + { + this._ClassDs++; + } + else if (team == Team.CHI) + { + this._ChaosInsurgency++; + } + else if (team == Team.MTF) + { + this._MobileForces++; + } + else if (team == Team.RIP) + { + this._Spectators++; + } + else if (team == Team.RSC) + { + this._Scientists++; + } + else if (team == Team.SCP) + { + this._SCPs++; + if (component.curClass != 10) + { + this._SCPsNozombies++; + } + } + } + } + + int enemies = 0; + if (this._ClassDs > 0) + { + enemies++; + } + if (this._MobileForces > 0 || this._Scientists > 0) + { + enemies++; + } + if (this._SCPs > 0) + { + enemies++; + } + if (this._ChaosInsurgency > 0 && (this._MobileForces > 0 || this._Scientists > 0)) + { + enemies = 3; + } + if (enemies <= 1 && players.Length >= 2) + { + this.roundHasEnded = true; + } + if (this.debugMode) + { + this.roundHasEnded = false; + } + + this.summary.scp_alive = this._SCPs; + this.summary.scp_nozombies = this._SCPsNozombies; + if (this.roundHasEnded) + { + this.summary.classD_escaped += this._ClassDs; + this.summary.scientists_escaped += this._Scientists; + int roundRestartTime = ConfigFile.GetInt("auto_round_restart_time", 10); + this.CallCmdSetSummary(this.summary, roundRestartTime); + base.Invoke("RoundRestart", (float)roundRestartTime); + } + } + } private void Update() { @@ -159,10 +159,10 @@ protected static void InvokeCmdCmdSetSummary(NetworkBehaviour obj, NetworkReader } [Command(channel = 15)] - private void CmdSetSummary(RoundSummary.Summary sum, int posttime) - { - this.CallRpcSetSummary(sum, posttime); - } + private void CmdSetSummary(RoundSummary.Summary sum, int posttime) + { + this.CallRpcSetSummary(sum, posttime); + } [ClientRpc(channel = 15)] public void RpcSetSummary(RoundSummary.Summary sum, int posttime) @@ -172,7 +172,6 @@ public void RpcSetSummary(RoundSummary.Summary sum, int posttime) roundSumText = string.Concat(new object[] { - text2, "", sum.classD_escaped, "/", @@ -184,7 +183,6 @@ public void RpcSetSummary(RoundSummary.Summary sum, int posttime) roundSumText += string.Concat(new object[] { - text2, "", sum.scientists_escaped, "/", @@ -196,7 +194,6 @@ public void RpcSetSummary(RoundSummary.Summary sum, int posttime) roundSumText += string.Concat(new object[] { - text2, "", sum.scp_frags, " ", @@ -206,7 +203,6 @@ public void RpcSetSummary(RoundSummary.Summary sum, int posttime) roundSumText += string.Concat(new object[] { - text2, "", Mathf.Clamp(sum.scp_start - sum.scp_alive, 0, sum.scp_start), "/", @@ -218,7 +214,6 @@ public void RpcSetSummary(RoundSummary.Summary sum, int posttime) roundSumText += string.Concat(new string[] { - text2, TranslationReader.Get("Legancy_Interfaces", 7), ": ", (!sum.warheadDetonated) ? TranslationReader.Get("Legancy_Interfaces", 9) : TranslationReader.Get("Legancy_Interfaces", 8), @@ -233,136 +228,122 @@ public void RpcSetSummary(RoundSummary.Summary sum, int posttime) component.text = roundSumText; } - private void UNetVersion() - { - } - - protected static void InvokeCmdCmdSetSummary(NetworkBehaviour roundSum, NetworkReader reader) - { - if (!NetworkServer.active) - { - Debug.LogError("Command CmdSetSummary called on client."); - return; - } - ((RoundSummary) roundSum).CmdSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int) reader.ReadPackedUInt32()); - } - - public void CallCmdSetSummary(RoundSummary.Summary sum, int posttime) - { - if (!NetworkClient.active) - { - Debug.LogError("Command function CmdSetSummary called on server."); - return; - } - if (base.isServer) - { - this.CmdSetSummary(sum, posttime); - return; - } - NetworkWriter networkWriter = new NetworkWriter(); - networkWriter.Write(0); - networkWriter.Write((short) ((ushort) 5)); - networkWriter.WritePackedUInt32((uint) RoundSummary.kCmdCmdSetSummary); - networkWriter.Write(base.GetComponent().netId); - GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); - networkWriter.WritePackedUInt32((uint) posttime); - base.SendCommandInternal(networkWriter, 15, "CmdSetSummary"); - } - - protected static void InvokeRpcRpcSetSummary(NetworkBehaviour roundSum, NetworkReader reader) - { - if (!NetworkClient.active) - { - Debug.LogError("RPC RpcSetSummary called on server."); - return; - } - ((RoundSummary) roundSum).RpcSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int) reader.ReadPackedUInt32()); - } - - public void CallRpcSetSummary(RoundSummary.Summary sum, int posttime) - { - if (!NetworkServer.active) - { - Debug.LogError("RPC Function RpcSetSummary called on client."); - return; - } - NetworkWriter networkWriter = new NetworkWriter(); - networkWriter.Write(0); - networkWriter.Write((short) ((ushort) 2)); - networkWriter.WritePackedUInt32((uint) RoundSummary.kRpcRpcSetSummary); - networkWriter.Write(base.GetComponent().netId); - GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); - networkWriter.WritePackedUInt32((uint) posttime); - this.SendRPCInternal(networkWriter, 15, "RpcSetSummary"); - } - - static RoundSummary() - { - NetworkBehaviour.RegisterCommandDelegate(typeof(RoundSummary), RoundSummary.kCmdCmdSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeCmdCmdSetSummary)); - RoundSummary.kRpcRpcSetSummary = -1626633486; - NetworkBehaviour.RegisterRpcDelegate(typeof(RoundSummary), RoundSummary.kRpcRpcSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeRpcRpcSetSummary)); - NetworkCRC.RegisterBehaviour("RoundSummary", 0); - } - - public override bool OnSerialize(NetworkWriter writer, bool forceAll) - { - bool result; - return result; - } - - public override void OnDeserialize(NetworkReader reader, bool initialState) - { - } - - public bool debugMode; - - private bool roundHasEnded; - - private PlayerManager pm; - - private CharacterClassManager ccm; - - public static RoundSummary host; - - public RoundSummary.Summary summary; - - private int _ClassDs; - - private int _ChaosInsurgency; - - private int _MobileForces; - - private int _Spectators; - - private int _Scientists; - - private int _SCPs; - - private int _SCPsNozombies; - - private static int kCmdCmdSetSummary = 509590172; - - private static int kRpcRpcSetSummary; - - [Serializable] - public class Summary - { - public int classD_escaped; - - public int classD_start; - - public int scientists_escaped; - - public int scientists_start; - - public int scp_frags; - - public int scp_start; - - public int scp_alive; - - public int scp_nozombies; - - public bool warheadDetonated; - } + public void CallCmdSetSummary(RoundSummary.Summary sum, int posttime) + { + if (!NetworkClient.active) + { + Debug.LogError("Command function CmdSetSummary called on server."); + return; + } + if (base.isServer) + { + this.CmdSetSummary(sum, posttime); + return; + } + NetworkWriter networkWriter = new NetworkWriter(); + networkWriter.Write(0); + networkWriter.Write((short)((ushort)5)); + networkWriter.WritePackedUInt32((uint)RoundSummary.kCmdCmdSetSummary); + networkWriter.Write(base.GetComponent().netId); + GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); + networkWriter.WritePackedUInt32((uint)posttime); + base.SendCommandInternal(networkWriter, 15, "CmdSetSummary"); + } + + protected static void InvokeRpcRpcSetSummary(NetworkBehaviour roundSum, NetworkReader reader) + { + if (!NetworkClient.active) + { + Debug.LogError("RPC RpcSetSummary called on server."); + return; + } + ((RoundSummary)roundSum).RpcSetSummary(GeneratedNetworkCode._ReadSummary_RoundSummary(reader), (int)reader.ReadPackedUInt32()); + } + + public void CallRpcSetSummary(RoundSummary.Summary sum, int posttime) + { + if (!NetworkServer.active) + { + Debug.LogError("RPC Function RpcSetSummary called on client."); + return; + } + NetworkWriter networkWriter = new NetworkWriter(); + networkWriter.Write(0); + networkWriter.Write((short)((ushort)2)); + networkWriter.WritePackedUInt32((uint)RoundSummary.kRpcRpcSetSummary); + networkWriter.Write(base.GetComponent().netId); + GeneratedNetworkCode._WriteSummary_RoundSummary(networkWriter, sum); + networkWriter.WritePackedUInt32((uint)posttime); + this.SendRPCInternal(networkWriter, 15, "RpcSetSummary"); + } + + static RoundSummary() + { + NetworkBehaviour.RegisterCommandDelegate(typeof(RoundSummary), RoundSummary.kCmdCmdSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeCmdCmdSetSummary)); + RoundSummary.kRpcRpcSetSummary = -1626633486; + NetworkBehaviour.RegisterRpcDelegate(typeof(RoundSummary), RoundSummary.kRpcRpcSetSummary, new NetworkBehaviour.CmdDelegate(RoundSummary.InvokeRpcRpcSetSummary)); + NetworkCRC.RegisterBehaviour("RoundSummary", 0); + } + + public override bool OnSerialize(NetworkWriter writer, bool forceAll) + { + bool result; + return result; + } + + public override void OnDeserialize(NetworkReader reader, bool initialState) + { + } + + public bool debugMode; + + private bool roundHasEnded; + + private PlayerManager pm; + + private CharacterClassManager ccm; + + public static RoundSummary host; + + public RoundSummary.Summary summary; + + private int _ClassDs; + + private int _ChaosInsurgency; + + private int _MobileForces; + + private int _Spectators; + + private int _Scientists; + + private int _SCPs; + + private int _SCPsNozombies; + + private static int kCmdCmdSetSummary = 509590172; + + private static int kRpcRpcSetSummary; + + [Serializable] + public class Summary + { + public int classD_escaped; + + public int classD_start; + + public int scientists_escaped; + + public int scientists_start; + + public int scp_frags; + + public int scp_start; + + public int scp_alive; + + public int scp_nozombies; + + public bool warheadDetonated; + } } From 66d329830ab550a43fe7f7c24b30b9b6af292742 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 20:59:39 -0500 Subject: [PATCH 24/27] Fixed variable naming --- server_mod/RoundSummary.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_mod/RoundSummary.cs b/server_mod/RoundSummary.cs index 784c26c..6135059 100644 --- a/server_mod/RoundSummary.cs +++ b/server_mod/RoundSummary.cs @@ -148,7 +148,7 @@ private void UNetVersion() { } - protected static void InvokeCmdCmdSetSummary(NetworkBehaviour obj, NetworkReader reader) + protected static void InvokeCmdCmdSetSummary(NetworkBehaviour roundSummary, NetworkReader reader) { if (!NetworkServer.active) { From 7ab5765a73dda59da84f2517d7d504e2a13834a6 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 21:05:34 -0500 Subject: [PATCH 25/27] Removed garabge comments --- server_mod/Searching.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/server_mod/Searching.cs b/server_mod/Searching.cs index 0a72c66..dbe96cf 100644 --- a/server_mod/Searching.cs +++ b/server_mod/Searching.cs @@ -3,10 +3,8 @@ using UnityEngine.Networking; using UnityEngine.UI; -// Token: 0x020000D7 RID: 215 public partial class Searching : NetworkBehaviour { - // Token: 0x060005E6 RID: 1510 RVA: 0x000236B0 File Offset: 0x000218B0 [Command(channel = 2)] public void CmdPickupItem(GameObject t, GameObject taker) { From a556aba04e7587a9fca0217aaf0d8900f2dbe115 Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Thu, 22 Feb 2018 22:20:26 -0500 Subject: [PATCH 26/27] Fix wait time being extended too long --- server_mod/CharacterClassManager.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/server_mod/CharacterClassManager.cs b/server_mod/CharacterClassManager.cs index 27535f0..84889c4 100644 --- a/server_mod/CharacterClassManager.cs +++ b/server_mod/CharacterClassManager.cs @@ -217,19 +217,13 @@ private IEnumerator Init() } /* - * Don't know why this isn't just adding five, like so - * - * timeLeft += 5; + * Brings wait time to the nearest number divisible by 5 */ else if (timeLeft % 5 > 0) { timeLeft = timeLeft / 5 * 5 + 5; } - else - { - timeLeft += 5; - } } if (timeLeft > 0) @@ -592,6 +586,11 @@ public void SetRandomRoles() // SCP-096 this.klasy[9].banClass = this.smForceSCPBans ? this.smBan096 : (this.smBan096 ? true : this.klasy[9].banClass); + // Debug thing for if the classes are banned + if (false) + { + ServerConsole.AddLog(); + } /* * Unreleased SCP, not implemented yet From 55346871a93ae89322d110694095145b6c38dcfe Mon Sep 17 00:00:00 2001 From: Dankrushen Date: Fri, 23 Feb 2018 01:46:05 -0500 Subject: [PATCH 27/27] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 7b04a99..883a50b 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,12 @@ Example: - SCP173_DISABLE disable this scp, default: no - SCP457_DISABLE disable this scp, default: yes - FORCE_DISABLE_ENABLE overrides game's default ban value with chosen values (USE OF THIS IS NOT RECOMMENDED) +- SCP049_AMOUNT max amount of this scp that can be spawned in randomly, default: 1 +- SCP079_AMOUNT max amount of this scp that can be spawned in randomly, default: 1 +- SCP096_AMOUNT max amount of this scp that can be spawned in randomly, default: 1 +- SCP106_AMOUNT max amount of this scp that can be spawned in randomly, default: 1 +- SCP173_AMOUNT max amount of this scp that can be spawned in randomly, default: 1 +- SCP457_AMOUNT max amount of this scp that can be spawned in randomly, default: 1 ## Place any suggestions/problems in issues!