internal static bool Prefix(LG_Door_Sync __instance, pDoorState oldState, pDoorState newState, bool isDropinState) { if (CustomReplicatorManager.TryInvokeStateChange(__instance.gameObject.name, oldState, newState, isDropinState)) { return(false); //Skip the original code } return(true); }
private static void Post_TryGetReplicator(ref bool __result, Il2CppStructArray <byte> bytes, ref IReplicator id, ref int packetIndex) { var pIndex = bytes[2]; if (pIndex >= CustomReplicatorProvider.PACKET_OFFSET && Marshaller.SizeWithIDs == bytes.Length) //It's custom Replicator { //Read Replicator Index Buffer.BlockCopy(bytes, 0, SNet_Replication.m_ushortConverter, 0, 2); int replicatorIndex = SNet_Replication.m_ushortConverter[0]; packetIndex = pIndex; __result = CustomReplicatorManager.TryGetReplicator(replicatorIndex, out id); } }