Beispiel #1
0
        private CallSite TryGetCallSite(MethodInfo method, object arg)
        {
            MySynchronizedTypeInfo typeInfo = _typeTableGetter.Invoke(MyMultiplayer.ReplicationLayer).Get(arg.GetType());

            if (!_methodInfoLookupGetter.Invoke(typeInfo.EventTable).TryGetValue(method, out CallSite result))
            {
                throw new MissingMemberException("Provided event target not found!");
            }
            return(result);
        }
        public static void RegisterPostfix(Type type, ref MySynchronizedTypeInfo __result, ref Dictionary <Type, MySynchronizedTypeInfo> ___m_typeLookup)
        {
            if (type != InventoryReplicableType)
            {
                return;
            }
            var info = AccessTools.Field(typeof(MySynchronizedTypeInfo), "Type");

            info.SetValue(__result, typeof(InventoryReplicable));
            ___m_typeLookup.Add(typeof(InventoryReplicable), __result);
        }