Exemplo n.º 1
0
    protected ExitGames.Client.Photon.Hashtable GetExpectedRoomProperties(Connecting.GameType gameType, int betAmount)
    {
        var expectedRoomProps = new ExitGames.Client.Photon.Hashtable();

        expectedRoomProps.Add(BET_AMOUNT_PROP, betAmount);
        expectedRoomProps.Add(GAME_TYPE_PROP, gameType);
        return(expectedRoomProps);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Gets the room options needed for the game properties.
    /// </summary>
    /// <param name="aType"></param>
    /// <param name="aMaxPlayers"></param>
    /// <returns></returns>
    protected RoomOptions _getRoomOptionsForGameType(byte aMaxPlayers, int betCount, Connecting.GameType gameType)
    {
        var roomOptions = new RoomOptions();

        roomOptions.CheckUserOnJoin = true;        // no duplicate users allowed
        roomOptions.IsOpen          = true;        // ready for all comers
        roomOptions.IsVisible       = true;        // Private games can only be joined by knowing table names.
        roomOptions.MaxPlayers      = aMaxPlayers; // max. players allowed
        roomOptions.PublishUserId   = true;        // we allow everyone to see other player's user ids
        roomOptions.PlayerTtl       = 60 * 1000;   // player slots are reserved and kept alive for this duration
        roomOptions.EmptyRoomTtl    = 60 * 1000;   // empty rooms are kept alive for this duration
        // set custom properties
        roomOptions.CustomRoomProperties = new ExitGames.Client.Photon.Hashtable();
        roomOptions.CustomRoomProperties.Add(BET_AMOUNT_PROP, betCount);
        roomOptions.CustomRoomProperties.Add(GAME_TYPE_PROP, gameType);
        // set lobby properties
        roomOptions.CustomRoomPropertiesForLobby = new string[]
        {
            GAME_TYPE_PROP,
            BET_AMOUNT_PROP
        };
        return(roomOptions);
    }