コード例 #1
0
    // Only supposed to be called from ServerLobby to set info for connections
    public void SaveGameInfo(List <PersistentPlayerInfo> playerList)
    {
        persistencePlayerInfo = new List <PersistentPlayerInfo>();

        for (int i = 0; i < playerList.Count; ++i)
        {
            PersistentPlayerInfo info = new PersistentPlayerInfo();
            info.name       = playerList[i].name;
            info.playerID   = playerList[i].playerID;
            info.playerType = playerList[i].playerType;
            info.team       = playerList[i].team;

            persistencePlayerInfo.Add(info);
        }
    }
コード例 #2
0
    public void Init(ClientConnectionsComponent connHolder, PersistentPlayerInfo playerInfo)
    {
        connectionsComponent = connHolder;
        clientGameSend       = GetComponent <ClientGameSend>();

        m_PlayerInfo = playerInfo;

        if (m_PlayerInfo.playerType == LobbyUtils.PLAYER_TYPE.SHOOTER)
        {
            clientGameSend.SendDataWhenReady((byte)GAME_CLIENT_REQUESTS.CREATE_ENTITY_WITH_OWNERSHIP);
            clientGameSend.SendDataWhenReady((byte)CREATE_ENTITY_TYPES.FPS_PLAYER);
        }
        else
        {
            Instantiate(Match3PlayerObj);
        }
    }
コード例 #3
0
    public PersistentPlayerInfo Clone()
    {
        PersistentPlayerInfo other = new PersistentPlayerInfo();

        other.team    = team;
        other.isReady = isReady;

        if (name != null)
        {
            other.name = System.String.Copy(name);
        }
        else
        {
            other.name = null;
        }

        other.playerType = playerType;
        other.playerID   = playerID;

        return(other);
    }
コード例 #4
0
 public void SetDeltaToZero()
 {
     previousState = Clone();
 }
コード例 #5
0
 public PersistentPlayerInfo()
 {
     previousState = null;
 }
コード例 #6
0
 public void SavePlayerInfo(PersistentPlayerInfo playerinfo)
 {
     m_PlayerInfo = playerinfo;
 }