Non-Local User Connection Issues (Port is Open)

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

charris456
Posts: 16
Joined: 03 Feb 2012, 02:08

Non-Local User Connection Issues (Port is Open)

Postby charris456 » 21 Feb 2012, 04:54

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?
charris456
Posts: 16
Joined: 03 Feb 2012, 02:08

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

Postby charris456 » 24 Feb 2012, 02:16

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 :).
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

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

Postby appels » 24 Feb 2012, 07:07

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.

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 2 guests