Error in using version 5.0.2.0.


When using the opJoinOrCreateRoom function, the parameter roomProperties data could not be verified in the joinOrCreateRoomReturn function after updating the setCustomRoomProperties using the RoomOptions parameter.

Hashtable props;

props.put(L"m", mMap);

props.put(L"c", CurrentChannel);

RoomOptions RoomOpt(true, true, 16);

RoomOpt.setCustomRoomProperties(props);

m_pClient->opJoinOrCreateRoom(RoomName, RoomOpt);


if(roomProperties.contains("m") )

I can't find it.

using Photon-Windows-Sdk_v5-0-2-0

Best Answer

  • Kaiserludi
    Kaiserludi admin
    Accepted Answer

    Hi @mammossix.


    On default to avoid unnecessary traffic room properties are only visible to clients that are inside the room, as most properties don't actually need to be visible outside of the room.

    If certain room properties should also be visible outside of a room for example because they are used for matchmaking, then they needs to be explicitly added to the list of room properties that are visible in the lobby.


    So your example code needs to be modified to look like this to be able to find rooms that have a property with the key L"m":

    Hashtable props;
    props.put(L"m", mMap);
    props.put(L"c", CurrentChannel);
    JVector<JString> propList;
    propList.addElement(L"m");
    RoomOptions RoomOpt(true, true, 16);
    RoomOpt.setCustomRoomProperties(props).setPropsListedInLobby(propList);
    m_pClient->opJoinOrCreateRoom(RoomName, RoomOpt);
    


Answers

  • Kaiserludi
    Kaiserludi admin
    Accepted Answer

    Hi @mammossix.


    On default to avoid unnecessary traffic room properties are only visible to clients that are inside the room, as most properties don't actually need to be visible outside of the room.

    If certain room properties should also be visible outside of a room for example because they are used for matchmaking, then they needs to be explicitly added to the list of room properties that are visible in the lobby.


    So your example code needs to be modified to look like this to be able to find rooms that have a property with the key L"m":

    Hashtable props;
    props.put(L"m", mMap);
    props.put(L"c", CurrentChannel);
    JVector<JString> propList;
    propList.addElement(L"m");
    RoomOptions RoomOpt(true, true, 16);
    RoomOpt.setCustomRoomProperties(props).setPropsListedInLobby(propList);
    m_pClient->opJoinOrCreateRoom(RoomName, RoomOpt);
    


  • Thank you sir.

    It was very helpful in solving the problem.