Beispiel #1
0
    /// <summary>
    /// Sets the player's finished turn (in the ROOM properties)
    /// </summary>
    /// <param name="player">Player Reference</param>
    /// <param name="turn">Turn Index</param>
    public static void SetFinishedTurn(this PhotonPlayer player, int turn)
    {
        PUNRoom room = PhotonNetwork.room;

        if (room == null || room.CustomProperties == null)
        {
            return;
        }

        string    propKey          = FinishedTurnPropKey + player.ID;
        Hashtable finishedTurnProp = new Hashtable();

        finishedTurnProp[propKey] = turn;

        room.SetCustomProperties(finishedTurnProp);
    }
Beispiel #2
0
    /// <summary>
    /// Sets the turn.
    /// </summary>
    /// <param name="room">Room reference</param>
    /// <param name="turn">Turn index</param>
    /// <param name="setStartTime">If set to <c>true</c> set start time.</param>
    public static void SetTurn(this PUNRoom room, int turn, bool setStartTime = false)
    {
        if (room == null || room.CustomProperties == null)
        {
            return;
        }

        Hashtable turnProps = new Hashtable();

        turnProps[TurnPropKey] = turn;
        if (setStartTime)
        {
            turnProps[TurnStartPropKey] = PhotonNetwork.ServerTimestamp;
        }

        room.SetCustomProperties(turnProps);
    }