Unable to Create Room [SOLVED]

Hello. We're using Unity 3.5.2f2, PUN v1.14 and Photon Server v3-0-24-3243-RC9 on a Windows Server 2008 R2 Standard machine. We've configured the required CONFIG files and can connect to the server fine, but have been unable to create a room after many, many attempts. Log files show no errors, in fact they note success, but there are lines that speak of disconnections. I've search this forum and Google and have seen that the order of operations has the client disconnecting from the master server then connecting to the game server (if I'm understanding correctly). We get all that except the connecting to the game server part.

Our code, debug messages, MSMaster.log, GSGame1.log and GSGame2.log follow in hopes they will help shed some light on what's going on and help us get past room creation. We hope to be able to use Photon Server for a Unity product we're developing.

Thanks in advance for any and all assistance, and apologies for the long post.

Code on a GameObject with a Photon View also attached:
using UnityEngine;
using System.Collections;

public class MyPhotonStuff : Photon.MonoBehaviour
{
	public Texture2D bg;
	public GUISkin uiSkin;
	
	string infoText;
	string connText;
	ConnectionState connState;
	string connGood;
	string roomName;
	
	RoomInfo[] roomData;
	int numberOfRooms;
	
	void Awake()
	{
		Application.runInBackground = true; //without this Photon will loose connection if not focussed
		infoText = "No messges yet.";
		roomName = "Enter a name for the room you will create";
		connState = PhotonNetwork.connectionState;
		connText = PhotonNetwork.connectionState.ToString();
	}
	
	void Update()
	{
		roomData = PhotonNetwork.GetRoomList();
		numberOfRooms = PhotonNetwork.GetRoomList().Length;
		
		connGood = "Connected = " + PhotonNetwork.connected.ToString() + ", Number of rooms: "+ numberOfRooms;
		
		if (connState != PhotonNetwork.connectionState)
		{
			connState = PhotonNetwork.connectionState;
			connText += "\n" + PhotonNetwork.connectionState.ToString();
			Debug.Log("PhotonNetwork.connectionState message: " + PhotonNetwork.connectionState.ToString());
		}
		
		foreach (Room aRoomsData in roomData)
		{
			connGood +=  "\n - " + aRoomsData.name;
		}
	}

	void OnGUI()
	{
		GUI.skin = uiSkin;
		
		GUI.DrawTexture(new Rect(0, 0, 512, 512), bg);
		
		//////// Buttons
		if (!PhotonNetwork.connected)
		{
			if (GUI.Button(new Rect(8, 8, 128, 32), "Connect"))
			{
				PhotonNetwork.ConnectUsingSettings("Test_1_v1.0");
				
				Debug.Log("User interaction message: Connect button clicked");
			}
		}
		else
		{
			if (GUI.Button(new Rect(8, 8, 128, 32), "Disconnect"))
			{
				PhotonNetwork.Disconnect();
				
				Debug.Log("User interaction message: Disconnect button clicked");
			}
		}
		
		if (GUI.Button(new Rect(148, 8, 128, 32), "Create Room"))
		{
			PhotonNetwork.CreateRoom("MonkeyLover");
			
			Debug.Log("User interaction message: Create Room button clicked");
		}
		
		if (GUI.Button(new Rect(280, 8, 128, 32), "Leave Room"))
		{
			PhotonNetwork.LeaveRoom();
			
			Debug.Log("User interaction message: Leave Room button clicked");
		}
		
		//////// Labels
		GUI.Label(new Rect(164, 64, 1024, 1024), connGood);
		GUI.Label(new Rect(164, 128, 1024, 1024), connText);
		GUI.Label(new Rect(8, 64, 1024, 512), infoText);
	}
	
	#region Begin Photon Callbacks
	void OnConnectedToPhoton()
	{
		infoText += "\nConnected.";
		Debug.Log("Photon callback message: OnConnectedToPhoton() called");
	}
	
	void OnFailedToConnectToPhoton()
	{
		infoText += "\nConnection failed.";
		Debug.Log("Photon callback message: OnFailedToConnectToPhoton() called");
	}
	
	void OnDisconnectedFromPhoton()
	{
		infoText += "\nConnection lost.";
		Debug.Log("Photon callback message: OnDisconnectedFromPhoton() called");
	}
	
	void OnCreatedRoom()
	{
		infoText += "\nRoom created.";
		Debug.Log("Photon callback message: OnCreatedRoom() called");
	}
	
	void OnPhotonCreateGameFailed()
	{
		infoText += "\nRoom creation failed.";
		Debug.Log("Photon callback message: OnPhotonCreateGameFailed() called");
	}	
	#endregion
}

Debug messages:

User interaction message: Connect button clicked
PhotonNetwork.connectionState message: Connecting
PhotonNetwork.connectionState message: InitializingApplication
Photon callback message: OnConnectedToPhoton() called
PhotonNetwork.connectionState message: Connected
this custom props {} (this one is from PhotonNetwork.cs, not our stuff)
User interaction message: Create Room button clicked
PhotonNetwork.connectionState message: Disconnecting
Photon callback message: OnDisconnectedFromPhoton() called
PhotonNetwork.connectionState message: Disconnected


MSMaster.log

2012-05-31 10:36:40,387 [32] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - UpdateGameServer - from LoadLevel Lowest to Normal, PeerCount 3
2012-05-31 10:36:40,387 [32] DEBUG Photon.LoadBalancing.LoadBalancer`1 [(null)] - updated current min load to 2
2012-05-31 10:36:54,380 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication [(null)] - Received init request from game server
2012-05-31 10:36:54,380 [18] INFO Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - game server connection from ###.###.###.###:60838 established (id=72)
2012-05-31 10:36:54,380 [34] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - OnOperationRequest: pid=72, op=1
2012-05-31 10:36:54,380 [34] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - Received register request: Address=###.###.###.###, UdpPort=5056, TcpPort=4531, WebSocketPort=0, State=Normal
2012-05-31 10:36:54,380 [34] DEBUG Photon.LoadBalancing.LoadBalancer`1 [(null)] - new min server is GameServer(45de48e2-634e-4806-ab99-7b2c23df6354) at ###.###.###.###:4531/###.###.###.###:5056 with load 0 - old one had load
2012-05-31 10:36:54,380 [27] INFO Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - OnDisconnect: game server connection closed (connectionId=71, serverId=7d4fb0c1-6b9c-4630-af52-8fc09e294323, reason=ManagedDisconnect)
2012-05-31 10:36:55,394 [28] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - UpdateGameServer - from LoadLevel Lowest to Normal, PeerCount 7
2012-05-31 10:36:55,394 [28] DEBUG Photon.LoadBalancing.LoadBalancer`1 [(null)] - updated current min load to 2
2012-05-31 10:36:58,468 [17] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication [(null)] - Received init request - game client was proxied: False (Type: ENetPeer)
2012-05-31 10:36:58,468 [17] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication [(null)] - Received init request from game client on leader node
2012-05-31 10:36:58,686 [35] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - OnOperationRequest: pid=7, op=230
2012-05-31 10:36:58,748 [15] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - OnOperationRequest: pid=7, op=229
2012-05-31 10:37:04,520 [25] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - OnOperationRequest: pid=7, op=227
2012-05-31 10:37:04,520 [25] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState [(null)] - Added peer: gameId=MonkeyLover, userId=, joiningPeers=1
2012-05-31 10:37:04,583 [27] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - Disconnect: pid=7: reason=ClientDisconnect, detail=
2012-05-31 10:37:09,388 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication [(null)] - Received init request from game server
2012-05-31 10:37:09,388 [18] INFO Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - game server connection from ###.###.###.###:60839 established (id=73)
2012-05-31 10:37:09,388 [28] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - OnOperationRequest: pid=73, op=1
2012-05-31 10:37:09,388 [28] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - Received register request: Address=###.###.###.###, UdpPort=5056, TcpPort=4531, WebSocketPort=0, State=Normal
2012-05-31 10:37:09,388 [28] DEBUG Photon.LoadBalancing.LoadBalancer`1 [(null)] - new min server is GameServer(7d4fb0c1-6b9c-4630-af52-8fc09e294323) at ###.###.###.###:4531/###.###.###.###:5056 with load 0 - old one had load
2012-05-31 10:37:09,388 [28] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameList [(null)] - RemoveGameState:id=MonkeyLover, peers=0, max=0, open=True, visible=True, peersJoining=1
2012-05-31 10:37:09,388 [25] INFO Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - OnDisconnect: game server connection closed (connectionId=72, serverId=45de48e2-634e-4806-ab99-7b2c23df6354, reason=ManagedDisconnect)
2012-05-31 10:37:10,402 [28] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - UpdateGameServer - from LoadLevel Lowest to Normal, PeerCount 3
2012-05-31 10:37:10,402 [28] DEBUG Photon.LoadBalancing.LoadBalancer`1 [(null)] - updated current min load to 2
2012-05-31 10:37:24,395 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication [(null)] - Received init request from game server
2012-05-31 10:37:24,395 [18] INFO Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - game server connection from ###.###.###.###:60840 established (id=74)
2012-05-31 10:37:24,395 [31] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - OnOperationRequest: pid=74, op=1
2012-05-31 10:37:24,395 [31] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - Received register request: Address=###.###.###.###, UdpPort=5056, TcpPort=4531, WebSocketPort=0, State=Normal
2012-05-31 10:37:24,395 [31] DEBUG Photon.LoadBalancing.LoadBalancer`1 [(null)] - new min server is GameServer(45de48e2-634e-4806-ab99-7b2c23df6354) at ###.###.###.###:4531/###.###.###.###:5056 with load 0 - old one had load
2012-05-31 10:37:24,395 [28] INFO Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - OnDisconnect: game server connection closed (connectionId=73, serverId=7d4fb0c1-6b9c-4630-af52-8fc09e294323, reason=ManagedDisconnect)
2012-05-31 10:37:25,409 [28] DEBUG Photon.LoadBalancing.MasterServer.GameServer.IncomingGameServerPeer [(null)] - UpdateGameServer - from LoadLevel Lowest to Normal, PeerCount 7
2012-05-31 10:37:25,409 [28] DEBUG Photon.LoadBalancing.LoadBalancer`1 [(null)] - updated current min load to 2


GSGame1.log

2012-05-31 10:36:54,380 [34] INFO Photon.LoadBalancing.GameServer.GameApplication [(null)] - Reconnecting to master at ###.###.###.###:4520, serverId=45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:36:54,380 [17] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master at ###.###.###.###:4520 established (id=74), serverId=45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:36:54,380 [34] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Registering game server with address ###.###.###.###, TCP 4531, UDP 5056, WebSocket 0, ServerID 45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:36:54,380 [27] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Successfully registered at master server: serverId=45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:37:09,388 [25] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master closed (id=74, reason=ClientDisconnect, detail=), serverId=45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:37:24,395 [31] INFO Photon.LoadBalancing.GameServer.GameApplication [(null)] - Reconnecting to master at ###.###.###.###:4520, serverId=45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:37:24,395 [17] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master at ###.###.###.###:4520 established (id=76), serverId=45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:37:24,395 [31] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Registering game server with address ###.###.###.###, TCP 4531, UDP 5056, WebSocket 0, ServerID 45de48e2-634e-4806-ab99-7b2c23df6354
2012-05-31 10:37:24,395 [28] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Successfully registered at master server: serverId=45de48e2-634e-4806-ab99-7b2c23df6354


GSGame2.log

2012-05-31 10:36:54,380 [27] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master closed (id=73, reason=ClientDisconnect, detail=), serverId=7d4fb0c1-6b9c-4630-af52-8fc09e294323
2012-05-31 10:37:09,388 [28] INFO Photon.LoadBalancing.GameServer.GameApplication [(null)] - Reconnecting to master at ###.###.###.###:4520, serverId=7d4fb0c1-6b9c-4630-af52-8fc09e294323
2012-05-31 10:37:09,388 [17] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master at ###.###.###.###:4520 established (id=75), serverId=7d4fb0c1-6b9c-4630-af52-8fc09e294323
2012-05-31 10:37:09,388 [28] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Registering game server with address ###.###.###.###, TCP 4531, UDP 5056, WebSocket 0, ServerID 7d4fb0c1-6b9c-4630-af52-8fc09e294323
2012-05-31 10:37:09,388 [28] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Successfully registered at master server: serverId=7d4fb0c1-6b9c-4630-af52-8fc09e294323
2012-05-31 10:37:24,395 [28] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master closed (id=75, reason=ClientDisconnect, detail=), serverId=7d4fb0c1-6b9c-4630-af52-8fc09e294323

Comments

  • It might be a configuration issue. You hide the IP, so maybe you changed it from 127.0.0.1. Make sure you did as described here:
    viewtopic.php?f=17&t=1102&p=5470&hilit=LoadBalancing.dll.config#p5470

    Also, make sure that the game server's firewall(s) are configured correctly, too. The game server, by default, uses different ports than the master.
    Most often, this is the cause for problems. In that case, no connect is possible to that machine. You can check by using the IP:Port as "master address" to try a connect. Check the client lib's console output.

    If you changed the ports (from default values), you have to adjust the ports in the policy application's policy files, too.

    And: You are right. The master will provide a game server address and room name on create and the client will disconnect from it to connect to that game server. Maybe this fails.
  • Qapla'!
    Tobias wrote:
    Also, make sure that the game server's firewall(s) are configured correctly, too.

    Yep, that did it. We added a rule using "Windows Firewall with Advanced Settings" to explicitly allow UDP access to ports 5055, 5056, 5057, 4520, 4530, 4531, 4532 and 9090. I know some of those are actually used for TCP, but we included them just to cover all our bases. NOTE: We originally set the rule up for port 5055 last week which we had to do to connect to the server at all. Editing the rule to add the other ports had no effect. We had to delete and re-create the rule to get it to work, Windows thing not a Photon thing but I'm passing it on in case someone else runs into the issue.
  • Editing the rule to add the other ports had no effect. We had to delete and re-create the rule to get it to work, Windows thing not a Photon thing but I'm passing it on in case someone else runs into the issue.
    Thanks for that info. Probably helpful if someone gets stuck and there's no real reason for that.
    Glad you made it.
Sign In or Register to comment.