Beispiel #1
0
    void RPCSetNameOnServer(NetworkPlayer player, string nickname)
    {
        Player added = game.players.GetPlayer(player);

        added.Name = nickname;
        networkView.RPC("RPCPlayerJoined", RPCMode.All, player, nickname);
        foreach (Player playerContainer in game.players)
        {
            if (playerContainer.owner != Network.player)
            {
                networkView.RPC("RPCSetPlayersMoney", playerContainer.owner, player, added.MoneyInString());
            }
            else
            {
                RPCSetPlayersMoney(player, added.MoneyInString());
            }
            networkView.RPC("RPCPlayerJoined", player, playerContainer.owner, playerContainer.Name);
            networkView.RPC("RPCSetPlayersMoney", player, playerContainer.owner, playerContainer.MoneyInString());
        }
        if (game.players.Count == 2 && Network.isServer)
        {
            ui.ActivateNewGameButton();
        }
    }