using SRMultiplayer.Networking; using SRMultiplayer.Packets; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; namespace SRMultiplayer { public static class Globals { //setup global objects for refrence usage public static int Version; public static UserData UserData; public static GameObject BeatrixModel; public static RuntimeAnimatorController BeatrixController; public static Dictionary Players = new Dictionary(); public static string Username; public static string ServerCode; public static byte LocalID; public static NetworkPlayer LocalPlayer; public static bool HandlePacket; public static Guid PartyID; public static bool IsClient { get { return NetworkClient.Instance.Status == NetworkClient.ConnectionStatus.Connected; } } public static bool IsServer { get { return NetworkServer.Instance.Status == NetworkServer.ServerStatus.Running; } } public static bool IsMultiplayer { get { return IsClient || IsServer; } } public static bool GameLoaded; public static bool ClientLoaded; public static bool DisableAchievements; public static string CurrentGameName; public static PauseState PauseState; public static Dictionary Audios = new Dictionary(); public static Dictionary Actors = new Dictionary(); public static Dictionary Regions = new Dictionary(); public static Dictionary LandPlots = new Dictionary(); public static Dictionary FXPrefabs = new Dictionary(); public static Dictionary AccessDoors = new Dictionary(); public static Dictionary Gordos = new Dictionary(); public static Dictionary SpawnResources = new Dictionary(); public static Dictionary PuzzleSlots = new Dictionary(); public static Dictionary Switches = new Dictionary(); public static Dictionary GadgetSites = new Dictionary(); public static Dictionary Spawners = new Dictionary(); public static Dictionary TreasurePods = new Dictionary(); public static Dictionary ExchangeAcceptors = new Dictionary(); public static Dictionary FireColumns = new Dictionary(); public static Dictionary Kookadobas = new Dictionary(); public static Dictionary Nutcrackers = new Dictionary(); public static Dictionary RaceTriggers = new Dictionary(); public static List LemonTrees = new List(); public static Dictionary PacketSize = new Dictionary(); /// /// get list of current installed mods /// Excluding supporting files /// public static List Mods { get { List mods = new List(); var assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (var assembly in assemblies) { if (!assembly.GetName().Name.Contains("Unity") && !assembly.GetName().Name.Contains("InControl") && !assembly.GetName().Name.Contains("DOTween") && !assembly.GetName().Name.Contains("mscorlib") && !assembly.GetName().Name.Contains("System") && !assembly.GetName().Name.Contains("Assembly-CSharp") && !assembly.GetName().Name.Contains("Logger") && !assembly.GetName().Name.Contains("Mono.") && !assembly.GetName().Name.Contains("Harmony") && !assembly.GetName().Name.Equals("SRML") && !assembly.GetName().Name.Equals("SRML.Editor") && !assembly.GetName().Name.Equals("Newtonsoft.Json") && !assembly.GetName().Name.Equals("INIFileParser") && !assembly.GetName().Name.Equals("SRMultiplayer") && !assembly.GetName().Name.Contains("Microsoft.") && !assembly.GetName().Name.Equals("SRMP") && !assembly.GetName().Name.Equals("XGamingRuntime") && !assembly.GetName().Name.Contains("MonoMod.Utils.") && !Globals.UserData.IgnoredMods.Contains(assembly.GetName().Name)) { mods.Add(assembly.GetName().Name); } } return mods; } } } }