示例#1
0
        private static void GoldGatConnect(On.RoR2.Networking.GameNetworkManager.orig_OnClientConnect orig, RoR2.Networking.GameNetworkManager self, NetworkConnection conn)
        {
            var wasMultiplayer = GeneralHooks.IsMultiplayer();

            orig(self, conn);
            ToggleGoldGat(wasMultiplayer);
        }
 // UNCOMMENT THIS FOR MULTIPLAYER TESTING USING SEVERAL LOCAL GAME INSTANCES
 private void GameNetworkManager_OnClientConnect1(On.RoR2.Networking.GameNetworkManager.orig_OnClientConnect orig, RoR2.Networking.GameNetworkManager self, UnityEngine.Networking.NetworkConnection conn)
 {
     // Do nothing
 }
示例#3
0
 private static void RegisterClientPrefabsNStuff(On.RoR2.Networking.GameNetworkManager.orig_OnStartClient orig, RoR2.Networking.GameNetworkManager self, UnityEngine.Networking.NetworkClient newClient)
 {
     orig(self, newClient);
     foreach (HashStruct h in thingsToHash)
     {
         if (h.prefab.HasComponent <NetworkIdentity>())
         {
             h.prefab.GetComponent <NetworkIdentity>().SetFieldValue <NetworkHash128>("m_AssetId", nullHash);
         }
         ClientScene.RegisterPrefab(h.prefab, NetworkHash128.Parse(MakeHash(h.goName + h.callPath + h.callMember + h.callLine.ToString())));
     }
 }
示例#4
0
        private static void DisableOnDisconnect(On.RoR2.Networking.GameNetworkManager.orig_Disconnect orig, RoR2.Networking.GameNetworkManager self)
        {
            if (IsActivated)
            {
                if (_currentBody)
                {
                    _currentBody.GetComponent <KinematicCharacterMotor>().CollidableLayers = _collidableLayersCached;
                    _currentBody.characterMotor.SetUseGravity(!_currentBody.characterMotor.useGravity);
                }

                IsActivated = !IsActivated;
                UndoHooks();
                Log.Message(string.Format(Lang.NOCLIP_TOGGLE, IsActivated));
            }

            orig(self);
        }
 private void GameNetworkManager_OnServerDisconnect(On.RoR2.Networking.GameNetworkManager.orig_OnServerDisconnect orig, RoR2.Networking.GameNetworkManager self, NetworkConnection conn)
 {
     orig(self, conn);
     FetchPingControllers(out pingerController);
 }