diff --git a/Assets/Scripts/InteractionEngine/CommunicationEvents.cs b/Assets/Scripts/InteractionEngine/CommunicationEvents.cs index f0f8233eb72f70ecd6691c8602d4e7dee1abf906..4b1a79c54b8d3c629d07a05385132bebc6bf049f 100644 --- a/Assets/Scripts/InteractionEngine/CommunicationEvents.cs +++ b/Assets/Scripts/InteractionEngine/CommunicationEvents.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; @@ -69,10 +70,10 @@ public enum ServerSlot /// </summary> public enum ServerStatus {// The numbers are due to legacy code, specifically ServerRunningA values - offline =0, - online =2, - checking=1, - NoNetworkAddress=3 + offline = 0, + online = 2, + checking = 1, + NoNetworkAddress = 3 } /// <summary> @@ -136,20 +137,23 @@ public IEnumerator UpdateServerStatus(bool skipIfAlreadyChecked = false) } } - + /// <summary> - /// Gather the <see cref="ServerSlotData"/> of all <see cref="ServerSlot"/> in one place, so one can iterate over all of them + /// Gather the <see cref="ServerSlotData"/> of all <see cref="ServerSlot"/> in one place, so one can iterate over all of them.<br/> + /// <remarks><list type="bullet"> + /// <item><seealso cref="LastIP"/>, <seealso cref="SelecIP"/> and alike offer more compact access to the domains.</item> + /// <item>Accessing other data in this Dict is kind of ugly, but I cannot think of a much better way to implement it, as it shoud be iteratable and indexable.</item> + /// </list> </remarks> /// </summary> public static Dictionary<ServerSlot, ServerSlotData> ServerSlots = new() { - {ServerSlot.last, new ServerSlotData("")}, - {ServerSlot.newIP, new ServerSlotData("") }, - {ServerSlot.slot1, new ServerSlotData("- if you can read this") }, - {ServerSlot.slot2, new ServerSlotData("- NetworkConfig") }, - {ServerSlot.slot3, new ServerSlotData("- GO TO -> 'Options'") }, - {ServerSlot.slot4, new ServerSlotData("- -> 'Reset Options'") }, - {ServerSlot.slot5, new ServerSlotData("- -> PRESS: 'Reset Configurations'") }, - {ServerSlot.selecIP, new ServerSlotData("") } + { ServerSlot.last, new ServerSlotData("") }, + { ServerSlot.newIP, new ServerSlotData("") }, + { ServerSlot.slot1, new ServerSlotData("- if you can read this") }, + { ServerSlot.slot2, new ServerSlotData("- NetworkConfig") }, + { ServerSlot.slot3, new ServerSlotData("- GO TO -> 'Options'") }, + { ServerSlot.slot4, new ServerSlotData("- -> 'Reset Options'") }, + { ServerSlot.slot5, new ServerSlotData("- -> PRESS: 'Reset Configurations'") }, { ServerSlot.selecIP, new ServerSlotData("") }, { ServerSlot.localServer, new ServerSlotData(ServerAddressLocal) } }; @@ -171,10 +175,12 @@ public static IEnumerator UpdateAllServers() //Enum.GetNames(typeof(KnownServers)).Length; //Number of known Server slots, to be able to add more later /* - * will be loaded from other config file - * ,and I am not going to refactor all of this as well, so just an indirection + * will be loaded from other config file, + * and I am not going to refactor all of this as well, so just an indirection. + * + * LastIP and SelecIP are likely useful shortcuts to the most relevant parts of 'ServerSlots' above, anyway. * - * Also those are domain names (+ port) not IPs + * (Also those are domain names (+ port) not IPs) */ public static string LastIP { get => ServerSlots[ServerSlot.last].domain; set => ServerSlots[ServerSlot.last].domain = value; } public static string NewIP { get => ServerSlots[ServerSlot.newIP].domain; set => ServerSlots[ServerSlot.newIP].domain = value; } @@ -192,13 +198,13 @@ public static IEnumerator UpdateAllServers() /// There are so many references to this abomination that I will leave it here and just update it, to be consistent with /// <see cref="ServerSlots"/>. /// </summary> - public static int[] ServerRunningA = new int[10] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + public static int[] ServerRunningA = new int[10] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; //other, lastIP, newIP, IP1, IP2, IP3, selecIP, IP4, IP5,...} //0: offline, 1: Checking, 2: online, 3: NoNetworkAddress; //------ - + public static bool autoOSrecognition = true; public static OperationSystem Opsys = OperationSystem.Windows; //Scripts @@ -207,7 +213,7 @@ public enum OperationSystem { Windows = 0, Android = 1, - iOS =2, + iOS = 2, WindowsStoreApps = 3, } public static bool CursorVisDefault = true; //Script. @@ -248,7 +254,7 @@ public static string Get_DataPath() return Opsys switch { OperationSystem.Android => Path.Combine(Application.persistentDataPath, "DataPath_writeable"), - OperationSystem.Windows or _ => Application.dataPath, + OperationSystem.Windows or _ => Application.dataPath, }; } diff --git a/Assets/Scripts/UI/NetwMenu/WaitingForLocalMMT.cs b/Assets/Scripts/UI/NetwMenu/WaitingForLocalMMT.cs index 4ad57bf52313e2a99c117ccaa596180752ea5f4d..0cea37ab41aaeacd1fd04bcd63379c5d003c20e5 100644 --- a/Assets/Scripts/UI/NetwMenu/WaitingForLocalMMT.cs +++ b/Assets/Scripts/UI/NetwMenu/WaitingForLocalMMT.cs @@ -6,22 +6,6 @@ public class WaitingForLocalMMT : MonoBehaviour { - - - - private void Start() - { - //StartCoroutine(ServerRoutine()); - - } - - private void Update() - { - - - - - } private void OnEnable() { StartCoroutine(ServerRoutine());