[Solved] Crashing upon joining room

Options
Xeno360
edited June 2012 in Photon Server
Hey guys. Hopefully someone here can help me!

When I have a client join a room that some one has created, the client freezes up and crashes. This happens only with outside connections (Clients that are not running on the same network the self hosted server is running on)

If I connect to rooms with a client that is on the same network as the server all works fine and nothing freezes.

This really has me stumped. All firewalls are off and ports 5055 - 5057 are forwarded. Please give me any information on a step I may have missed or if something like this has happened before. Below is code im using to Connect and create.

	void OnLevelWasLoaded(){
		if(creating){
			Hashtable properties = new Hashtable();
			properties["Map"] = arenaName;
			string[] send = new string[1];
			send[0] = "Map";
			PhotonNetwork.CreateRoom("Pirate Ship "+Random.Range(0,99999),true,true,20,properties,send);
		}
		else if(joining){
			PhotonNetwork.JoinRoom(roomToJoin);	
		}
		if(creating||joining){
			this.enabled=false;
			net.GatherJoinTabs();
			
		}
	}




Game freezes right after level loads.

Thanks

Comments

  • dreamora
    Options
    is that for a webplayer or not? for webplayer TCP 843 must be forwarded too for socket policy server
  • Xeno360
    Options
    Yep that port is forwarded as well.

    it crashes in webplayer and editor on multiple peoples PCs. It also crashes when trying to create a room from a pc that the server is not hosted on.


    Connecting works fine, anything to do with joining or creating room is a fail. :(
  • dreamora
    Options
    Did you ensure to configure the GameServer1 and GameServer2 correctly in their folders within deploy? If you do not connect from localhost you must configure their public ip, as you can either connect from localhost only or from anywhere outside the machine only (in this case you must replace localhost with the machines public ip too locally)
  • Xeno360
    Options
    Ugh! I just want this to work.

    I guess it was that, When I updated the server I forgot to flip them back to the public IP.

    I changed them to the proper IP, now I cant even connect locally. It will connect but when creating server I get..
    createGame failed, client stays on masterserver: OperationResponse 227: ReturnCode: 32762 (Failed to get server instance.). Parameters: {}.
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:716)
    NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:847)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:79)
    
    

    So frustrating :(
  • dreamora
    Options
    you can no longer connect with 127.0.0.1 and localhost when you switch them to public.
    you have to use the same ip as everyone else and need a router that can handle that 'redirecting' within the LAN as going to the internet and back will not work (any halfway modern one should handle that fine)
  • Xeno360
    Options
    Thnx for the help I figured it out, had to leave the value for "MasterIPAdress" to my local ip and public to my public ip, I had them both as public. All works well now and can be connected from outside connections thnx.

    Changing those settings should be covered somewhere in the PDF that comes with the unity package! I had this problem a while back, just forgot what the solution was :P.
  • dreamora
    Options
    the configuration has a fat comment on not toying with the master ip or at least it used to have ;)
  • Tobias
    Options
    Glad you found it!
    I'm moving this topic to Server board. I hope you don't mind if I rename it with [Solved] prefix?