Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

LoadBalancing.Room..ctor throws NullReferenceException

$
0
0
Hi~ I reviewed ParticleDemo project using Photon realtime sdk on Unity 5.3.5f1.

First of all, one of clients created a room by CreateParticleDemoRoom function and another client tried to join that room by OpJoinRandomRoom function.

one client use this code,
case ClientState.ConnectedToMaster:
// when that's done, this demo asks the Master for any game. the result is handled below
// this.OpJoinRandomRoom(null, 0);
this.CreateParticleDemoRoom(DemoConstants.MapType.Forest, 16);
break;
another client like this :
case ClientState.ConnectedToMaster:
// when that's done, this demo asks the Master for any game. the result is handled below
this.OpJoinRandomRoom(null, 0);
//this.CreateParticleDemoRoom(DemoConstants.MapType.Forest, 16);
break;
My Intention is the first client make a room, and second client joined the room not using specific room name.
So, I called OpJoinRandomRoom() function on the second client.
But, When the second client found a room and tried to join, I got a NullReferenceException below.
NullReferenceException: Object reference not set to an instance of an object
ExitGames.Client.Photon.LoadBalancing.Room..ctor (System.String roomName, ExitGames.Client.Photon.LoadBalancing.RoomOptions options)
ExitGames.Client.DemoParticle.ParticleRoom..ctor (System.String roomName, ExitGames.Client.Photon.LoadBalancing.RoomOptions opt)
ExitGames.Client.DemoParticle.GameLogic.CreateRoom (System.String roomName, ExitGames.Client.Photon.LoadBalancing.RoomOptions opt) (at Assets/Photon/DemoCode/GameLogic.cs:242)
ExitGames.Client.Photon.LoadBalancing.LoadBalancingClient.GameEnteredOnGameServer (ExitGames.Client.Photon.OperationResponse operationResponse) (at Assets/PhotonLoadbalancingApi/LoadBalancingClient.cs:1707)
ExitGames.Client.Photon.LoadBalancing.LoadBalancingClient.OnOperationResponse (ExitGames.Client.Photon.OperationResponse operationResponse) (at Assets/PhotonLoadbalancingApi/LoadBalancingClient.cs:1959)
ExitGames.Client.DemoParticle.GameLogic.OnOperationResponse (ExitGames.Client.Photon.OperationResponse operationResponse) (at Assets/Photon/DemoCode/GameLogic.cs:424)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff)
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands ()
ExitGames.Client.DemoParticle.GameLogic.UpdateLoop () (at Assets/Photon/DemoCode/GameLogic.cs:252)
Logic.UpdateLocal () (at Assets/Scripts/Logic.cs:124)
DemoGUI.Update () (at Assets/Scripts/DemoGUI.cs:109)
I ran demo project from Photon sdk , I just changed one line for joining random room.
Please let me know what is a problem.


Viewing all articles
Browse latest Browse all 15755

Trending Articles