JohnTube mod


Last Active
Registered, Moderator
  • Re: Having troubles handling pre-game room disconnections with TTL (to reconnect in-game)

    Hi @xblade724,

    It's not supported out of the box yet.
    Try this code (not tested yet):
    using Hashtable = ExitGames.Client.Photon.Hashtable;
    // [...]
    public static bool UpdateTTLs(int playerTTL, int emptyRoomTTL)
            Hashtable hash = new Hashtable(2);
            hash.Add(ParameterCode.PlayerTTL, playerTTL);
            hash.Add(ParameterCode.EmptyRoomTTL, emptyRoomTTL);
            return PhotonNetwork.networkingPeer.OpSetPropertiesOfRoom(hash);
  • Re: OnUpdatedFriendList => No UserId?

    Hi @xblade724,

    Thank you for reporting this!
    Yes indeed the Name is the UserId in fact it is not returned by server but cached on client from the list you provide in FindFriends.

    Any reason it's called Name instead of UserId?
    "Historical" reasons! "UserId" is a concept we now enforce (it is a must, even if you do not explicitly set one the server does this for you) and is relatively new in Photon. "NickName"/"Nickname" should be the new naming for the old "UserName"/"Username" or "PlayerName"/"Playername" or "Name".
    We will change this in future versions ("Name" to "UserId").
  • Re: PhotonNetwork.GetRoomsList() Not working (autojoinlobby is on, waited for onJoinedLobby)

    Hi @xblade724,

    Rooms list is ready after calls to PUN callback OnReceivedRoomListUpdate(). You can get the rooms list inside that callback.
    Also I assume these rooms are in default lobby or in a lobby with default type.
  • Re: Room Properties update too slow for lobby.

    OK I see.

    The default "GetGameList" WebRPC returns only lobby properties (room properties visible to the lobby).
    The room state exposed by Photon includes only a "read only" lobby properties.
    All room properties are either on their binary form or inside the debug info.

    I think you are already know that but maybe you are not saving the room state or room properties only until a room has been 'closed' once, i.e. in 'GameClose', Type="Save". So you should save an initial version of the room properties in 'GameCreate' and update that copy in 'GameProperties' every time.
    In 'GetGameList' you should be able to return room properties even before the room is not closed yet (still alive).
    Also 'EmptyRoomTTL' is probably why sometimes you wait for up to 5 minutes.
    You can set it to 0.
  • Re: Room Properties update too slow for lobby.

    As you can see here in '' we save an empty room state when the room is first created.
    So a player who just left the the room will not be able to see any room property until the room state is saved when the room is closed after 'EmptyRoomTTL' (this is why you get 'null' room properties for some rooms in 'GetGameList' response).

    So I think that line should be replaced with:
    db.set_game_state(jsonRequest['GameId'], json.dumps({'CustomProperties': jsonRequest['CreateOptions']['CustomProperties']}))
    I need to test this myself.

    Do I need to call an OpWebRPC() to force the state to update as well?
    No you do not need to. If you are using Webhooks 1.2 you need to set HttpForward webflag in OpSetCustomRoomProperties to trigger the 'GameProperties' callback.

    I tried setting EmptyRoomTTL to 0 and nobody can join the game once the first player leaves (set inactive)
    If you use webhooks 1.2 set AsyncJoin to true. Read more about it here.