Set interest group before joining room is an error? Was it an error before?

Options
Hi. Im back to photon after probably an year or something. I just merged the multiplayer branch into the main one.
First thing I did was download the new version (1.91), and now Im testing it.
Im getting an error at joining a room:
Operation failed: OperationResponse 248: ReturnCode: -2 (Unknown operation code). Parameters: {} Server: MasterServer

The thing is, I dont remember having any errors before, so I think this is a new thing, I might be wrong.

But I dont understand the logic behind the error either.
I cant set interest groups before joining the room? Why? I should..
Since Im able to set player data before joining a room, and it will sync to other players after I join one...Why isnt the same case with interest groups?
The fact that I cant just means theres a gap between joining and setting the interest group where the server might waste band sending me stuff I dont want.
Am I wrong here?

My app is a perfect example of that. Its a stream of race events (athletics 100m, 200m..), max of 8 players, the races keep going forever, but theres no waiting for max players, 3 players might be racing while 2 just enter the room and wait for the race to finish..I dont want to send racing players data to waiting players.

Maybe Im wrong about whats going on, but I think this worked before..Heres my code:
public void JoinEmptyRoom()
    {
        if ( PUNOlympian._instance.GetState() != PUNOlympian.OperationState.standby_in_lobby )
            return;

        _lastErrorCode = 0;

        PhotonNetwork.SetPlayerCustomProperties(
            new RoomHashtable() {
                { HASH_KEYS.szPLAYER_STATE, PlayerState.waiting }
            }
        );
        PhotonNetwork.SetInterestGroups(( byte ) PlayerState.playing, false); // commenting this stops the error // calling this on the joinedroom callback also works

        PUNOlympian._instance.JoinAnyRoomWithOption(ref _options, ref _callbacks);
    }

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited August 2018
    Options
    Hi @Suminsky,

    Thank you for choosing Photon!

    Changing interest groups works only when joined to a room on Game Server.
    That is why if you try to change them before joining the room you will get an error.
    Which is exactly what the error you have tells you: the ChangeGroups operation is unknown on the Master Server.

    The fact that I cant just means theres a gap between joining and setting the interest group where the server might waste band sending me stuff I dont want.
    Am I wrong here?
    Yes. By default, all players are ONLY subscribed to the default special group 0. No one can unsubscribe from it. So if you do not send events in the default group (0), the joining player will not receive anything before subscribing to the other groups.

    Read more about Interest Groups here.
    We should probably explicitly clarify that changing groups is possible only after joining rooms.


    Since Im able to set player data before joining a room, and it will sync to other players after I join one...Why isnt the same case with interest groups?
    You could, of course, add logic that allows caching interest groups before joining and setting them implicitly/automatically once joined, like we do for the local player's properties.