private static void AddCustomTypes() { Debug.Print("Searching Custom RPC Datas"); List <Type> typeList = new List <Type>(); foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { if (CustomRPCDataTypes.CheckAssemblyForCustomRPCData(assembly)) { foreach (Type type in assembly.GetTypes()) { if (typeof(ISerializableObject).IsAssignableFrom(type)) { typeList.Add(type); } } } } Debug.Print("Found " + (object)typeList.Count + " custom rpc datas"); foreach (Type type in typeList) { CustomRPCDataTypes.AddType(type); } }
static CustomRPCDataTypes() { CustomRPCDataTypes._typesOfIds = new Dictionary <byte, Type>(); CustomRPCDataTypes._idsOfTypes = new Dictionary <Type, byte>(); CustomRPCDataTypes.AddCustomTypes(); }