Пример #1
0
    public override void OnStopClient()
    {
        //If We The Server Or Not Has Authority
        //Do not Subscribe If We Do not Have Authority
        if (isClientOnly)
        {
            ((RTSNetworkManager)NetworkManager.singleton).Players.Remove(this);
            ClientOnInfoUpdated?.Invoke();
        }
        else
        {
            ClientOnInfoUpdated?.Invoke();
            return;
        }

        if (!hasAuthority)
        {
            return;
        }

        Unit.AuthorityOnUnitSpawned   -= AuthorityHandleUnitSpawned;
        Unit.AuthorityOnUnitDeSpawned -= AuthorityHandleUnitDeSpawned;

        Building.AuthorityOnBuildingSpawned   -= AuthorityHandleBuildingSpawned;
        Building.AuthorityOnBuildingDeSpawned -= AuthorityHandleBuildingDeSpawned;
    }
Пример #2
0
 public override void OnStopClient()
 {
     if (!NetworkServer.active)
     {
         ((NetworkMan)NetworkManager.singleton).lobbyPlayers.Remove(this);
     }
     ClientOnInfoUpdated?.Invoke();
     base.OnStopClient();
 }
Пример #3
0
 public override void OnStopClient()
 {
     ClientOnInfoUpdated?.Invoke();
     if (!isClientOnly)
     {
         return;
     }
     ((SwitchNetworkManager)NetworkManager.singleton).Players.Remove(this);
 }
Пример #4
0
    public override void OnStopClient()
    {
        ClientOnInfoUpdated?.Invoke();

        if (!isClientOnly)
        {
            return;
        }

        ((RTSNetworkManager)NetworkManager.singleton).Players.Remove(this);

        if (!hasAuthority)
        {
            return;
        }

        Unit.AuthoryOnUnitSpawn             -= AuthoryHandleUnitSpawn;
        Unit.AuthoryOnUnitDespawn           -= AuthoryHandleUnitDespawn;
        Building.AuthorityOnBuildingSpawn   -= AuthorityHandleBuildingSpawn;
        Building.AuthorityOnBuildingDespawn -= AuthorityHandleBuildingDespawn;
    }
Пример #5
0
    public override void OnStopClient()
    {
        ClientOnInfoUpdated?.Invoke();

        if (!isClientOnly)
        {
            return;
        }

        ((MyNetworkManager)NetworkManager.singleton).Players.Remove(this);

        if (!hasAuthority)
        {
            return;
        }

        Unit.AuthorityOnUnitSpawned           -= AuthorityAddUnitToList;
        Unit.AuthorityOnUnitDespawned         -= AuthorityRemoveUnitFromList;
        Building.AuthorityOnBuildingSpawned   -= AuthorityAddBuildingToList;
        Building.AuthorityOnBuildingDespawned -= AuthorityRemoveBuildingFromList;
    }
Пример #6
0
 private void ClientHandleDisplayNameUpdated(string oldDisplayName, string newDisplayName)
 {
     ClientOnInfoUpdated?.Invoke();
 }