CustomRoomPropertiesForLobby created with Unity3D in DotNet

Hello,

I have an .net application showing a List of RoomInfos. The RoomInfos are coming from UnityApps which are creating Rooms with CustomRoomPropertiesForLobby.

The Problem i have is, that i cannot get CustomRoomProperties in my photon LoadBalancing Lobby without joining the room.

I read here about that UnityPhoton is not compatible with DotNet LoadBalancing and i understand that. After changing the version parameter i got it running to see the rooms from Unity. So my hope is that it would be possible with some changes to the photon source to see the CustomRoomProperties also.

thanks in advance for everyone who could provide infos to solve the problem.

Kind regards, StieMO

Comments

  • Hi @StieMO,

    Thank you for choosing Photon!

    I read here about that UnityPhoton is not compatible with DotNet LoadBalancing and i understand that
    This is not correct. Maybe you meant the special PUN AppVersion thing that you managed to solve, right?

    How are you creating rooms?
    Are you sure you are properly exposing the room properties to the lobby?
    You need to explicitly specify which room properties keys need to be visible from/to the lobby.
    LoadBalancing API is the same foundation for Photon Realtime or for PUN so there should be no difference in .Net SDK or Unity SDKs.
  • StieMOStieMO
    edited June 18
    Hi @JohnTube

    thank you for your answer.

    Here ist what i enter on my Unity Side creating the room. This is more test information to try what works and what not.
    
    RoomOptions roomOptions = new RoomOptions();
                        roomOptions.MaxPlayers = 10;
                        roomOptions.PublishUserId = true;
                        if (appIdentity != null)
                        {
                            roomOptions.CustomRoomPropertiesForLobby = new string[3];
                            roomOptions.CustomRoomPropertiesForLobby[0] = appIdentity.appNameInput;
                            roomOptions.CustomRoomPropertiesForLobby[1] = appIdentity.appIDInput;
                            roomOptions.CustomRoomPropertiesForLobby[2] = appIdentity.appVersionInput;
                            
                            roomOptions.CustomRoomProperties = new Hashtable();
                            roomOptions.CustomRoomProperties.Add("vrapp_name", appIdentity.appNameInput);
                            roomOptions.CustomRoomProperties.Add("vrapp_id", appIdentity.appIDInput);
                            roomOptions.CustomRoomProperties.Add("vrapp_version", appIdentity.appVersionInput);
                        }
    
                        PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, null);
    In my DotNet i tried this

    Code is from multiple classes, so it is not that easy to post.

    From my UpdateLoop. Recreated from the LoadBalancing Demo
    rooms = LSPhotonClientSingleton.I.Client.RoomInfoList;
    
    At this point my Unity App is running and has created a room and is waiting or playing with other user. In my DotNet i´m connected to the masterserver and observing the Lobby to show a list of running Rooms. I get the roomNames and PlayerCount from the rooms[i].roomInfo. But CustomProperties it is null, if i´m not joined the room. And CutomRoomPropertiesForLobby is not an existing parameter in DotNet.

    What i tried but never worked, because there are no keys in CustomProperties
    foreach (var item in rooms[key].CustomProperties.Keys)
    {
            Console.WriteLine(key2 + " value: " + rooms[key].CustomProperties[item]);
    }
    
    i hope that help a bit with the details.
  • StieMOStieMO
    edited June 19
    Tobias from Exit Games gave me the right tip.

    You have to put the CustomRoomProperties.Key into roomOptions.CustomRoomPropertiesForLobby to tell it which one to show in the lobby.
Sign In or Register to comment.