Page 1 of 1

Non-Local User Connection Issues (Port is Open)

Posted: 21 Feb 2012, 04:54
by charris456
I have ran into another problem that I can't figure out.

I can connect to the server locally just fine. I have configured the smartfox server to add the appropriate IP's. I have updated the IP in the connection script in Unity. I have double checked through a port check tool that my router is allowing external connections (I even see the connection pop up in the server console). However, remote players cannot connect to the server.

It's as if Unity is not allowing them, but it's a standalone version so, there should be no policy issues there. I do not see an incoming connection in the server console, so it makes me think it's something in Unity that I'm not doing right.

Here's where I make the connection:

Code: Select all

   void Start () {
      Application.runInBackground = true;
      
      sfs = new SmartFox();
      sfs.ThreadSafeMode = true;
      
      sfs.AddEventListener(SFSEvent.CONNECTION, OnConnection);
      sfs.AddEventListener(SFSEvent.LOGIN, OnLogin);
      sfs.AddEventListener(SFSEvent.EXTENSION_RESPONSE, ExtResponse);
      sfs.AddEventListener(SFSEvent.USER_ENTER_ROOM, UserEnteredRoom);
      sfs.AddEventListener(SFSEvent.USER_VARIABLES_UPDATE, UserVarsUpdate);
      sfs.AddEventListener(SFSEvent.ROOM_JOIN, OnJoinRoom);
      
      sfs.Connect(serverIP, 9933);
      status = "Connecting to Server.";
   }


Any ideas?

Re: Non-Local User Connection Issues (Port is Open)

Posted: 24 Feb 2012, 02:16
by charris456
This issue was actually caused by the Unity Editor. I had set the serverIP variable to public, and when I was first testing it was set to 127.0.0.1. When we tested it remotely, I changed the serverIP variable in the script, but not in the editor. For some reason the editor was overwriting it with 127.0.0.1.

Everything works perfectly now :).

Re: Non-Local User Connection Issues (Port is Open)

Posted: 24 Feb 2012, 07:07
by appels
Yep, the editor variables have precedence over the ones in the script.
Once you make them public you have to change them in the editor.