예제 #1
0
 private void On_NETWORK_NewNetworkIDConnected(BEHandle <ENetworkID> handle)
 {
     if (BEventManager.Instance.LocalNetworkID == ENetworkID.HOST)
     {
         EControllerID newControllerID = BUtils.GetControllerIDFrom(handle.Arg1);
         if (IS_NOT_NONE(newControllerID) &&
             InputManager.Instance.IsControllerConnected(newControllerID) == false)
         {
             StartCoroutine(JoinConnectedPlayerCoroutine(handle, newControllerID));
         }
     }
 }
예제 #2
0
        private void On_NETWORK_NetworkIDDisconnected(BEHandle <ENetworkID> handle)
        {
            if (BEventManager.Instance.LocalNetworkID == ENetworkID.HOST)
            {
                EControllerID controllerID = BUtils.GetControllerIDFrom(handle.Arg1);
                if (IS_NOT_NONE(controllerID) &&
                    IS_TRUE(InputManager.Instance.IsControllerConnected(controllerID)) &&
                    IS_KEY_CONTAINED(partyMap, controllerID))
                {
                    EPlayerID playerID = partyMap[controllerID];
                    if (IS_NOT_NONE(playerID))
                    {
                        partyMap.Remove(controllerID);

                        // Disconnect Controller (-> Remove from party)
                        InputManager.Instance.DisconnectController(controllerID);

                        BEventsCollection.NETWORK_PlayerLeft.Invoke(new BEHandle <EPlayerID, EControllerID>(playerID, controllerID), BEventReplicationType.TO_ALL_OTHERS, true);
                    }
                }
            }
        }