public void method_1 <HCEoy9wNNO7AaklTMAN>(Action <HCEoy9wNNO7AaklTMAN> action_0) where HCEoy9wNNO7AaklTMAN : class, GInterface0 { CommandDispatcher.< > c__DisplayClass2_0 <HCEoy9wNNO7AaklTMAN> CS$ < > 8__locals1 = new CommandDispatcher.< > c__DisplayClass2_0 <HCEoy9wNNO7AaklTMAN>(); CS$ < > 8__locals1.action = action_0; short id = ((HCEoy9wNNO7AaklTMAN)((object)GClass85.smethod_0(typeof(HCEoy9wNNO7AaklTMAN)))).Id; this.Handlers.AddOrUpdate(id, CS$ < > 8__locals1.action, new Func <short, MulticastDelegate, MulticastDelegate>(CS$ < > 8__locals1.method_0)); }
public void method_1 <ifYv2WTXfR5ZmbSgZ0K>(Action <ifYv2WTXfR5ZmbSgZ0K> action_0) where ifYv2WTXfR5ZmbSgZ0K : class, GInterface0 { CommandDispatcher.< > c__DisplayClass2_0 <ifYv2WTXfR5ZmbSgZ0K> CS$ < > 8__locals1 = new CommandDispatcher.< > c__DisplayClass2_0 <ifYv2WTXfR5ZmbSgZ0K>(); CS$ < > 8__locals1.action = action_0; short id = ((ifYv2WTXfR5ZmbSgZ0K)((object)GClass85.smethod_0(typeof(ifYv2WTXfR5ZmbSgZ0K)))).Id; this.Handlers.AddOrUpdate(id, CS$ < > 8__locals1.action, new Func <short, MulticastDelegate, MulticastDelegate>(CS$ < > 8__locals1.method_0)); }
public void Off <T>(Action <T> action) where T : class, GInterface0 { short id = ((T)((object)GClass85.smethod_0(typeof(T)))).Id; MulticastDelegate multicastDelegate; if (this.Handlers.TryGetValue(id, out multicastDelegate)) { this.Handlers.TryUpdate(id, (MulticastDelegate)Delegate.RemoveAll(multicastDelegate, action), multicastDelegate); } }
public static GInterface0 smethod_2(int int_0) { Type type_; if (!GClass86.dictionary_0.TryGetValue(int_0, out type_)) { return(null); } return((GInterface0)GClass85.smethod_0(type_)); }
public static bool smethod_0(Type type_0, out int int_0) { int_0 = 0; GInterface0 ginterface = GClass85.smethod_0(type_0) as GInterface0; if (ginterface != null) { int_0 = (int)ginterface.Id; return(true); } return(false); }
static GClass86() { Class13.NP5bWyNzLwONS(); GClass86.dictionary_0 = new Dictionary <int, Type>(); foreach (Type type in typeof(GClass86).Assembly.GetTypes()) { if (typeof(GInterface0).IsAssignableFrom(type)) { GInterface0 ginterface = GClass85.smethod_0(type) as GInterface0; if (ginterface != null) { GClass86.dictionary_0[(int)ginterface.Id] = type; } } } }
public static void smethod_2() { if (GClass82.bool_0) { return; } GClass82.bool_0 = true; GClass82.smethod_1(new Dictionary <int, LinkedList <GClass82.GClass83> >()); Logger logger = LogManager.GetLogger("Base-Net-Handlers"); logger.Info("Discovering packet handlers..."); int num = 0; foreach (Type type in typeof(GClass82).Assembly.GetTypes()) { if (typeof(GInterface4).IsAssignableFrom(type)) { GInterface4 ginterface = GClass85.smethod_0(type) as GInterface4; if (ginterface != null) { foreach (MethodInfo methodInfo in type.GetMethods(BindingFlags.Instance | BindingFlags.Public)) { ParameterInfo parameterInfo = methodInfo.GetParameters().SingleOrDefault <ParameterInfo>(); int num2; if (parameterInfo != null && typeof(GInterface0).IsAssignableFrom(parameterInfo.ParameterType) && GClass86.smethod_0(parameterInfo.ParameterType, out num2)) { IDictionary <int, LinkedList <GClass82.GClass83> > d = GClass82.dictionary_0; int key = num2; GClass82.GClass83 gclass = new GClass82.GClass83(); gclass.method_3(ginterface); gclass.method_1(DelegateHelper.ConstructDelegateCallVoid(methodInfo, type)); d.Append(key, gclass); num++; } } } } } logger.Info("Found {count} packet handlers", num); }