Lobby connects to localhost instead of specified ip

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

Moderators: Lapo, Bax

User avatar
AndyMartin458
Posts: 55
Joined: 15 May 2012, 21:57

Lobby connects to localhost instead of specified ip

Postby AndyMartin458 » 15 May 2012, 22:06

I've been working to connect with my friend's computer which is on my same Wi-Fi network, and I have changed the serverName in LobbyGUI.cs to his ip. No matter how many ways I try to ensure that Unity not connect to my localhost, it always does. The service is running on his computer, but when I look at my sfsadmin, the CCU is increasing on my end. The 127.0.0.1 however is listed nowhere in my LobbyGUI.cs I am running the newest Sfs2X and the new examples folder that includes the object example.

Is there some other setting that must be specified to ensure that it will connect to the specified servername? Thanks ahead of time for your help.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: Lobby connects to localhost instead of specified ip

Postby ThomasLund » 17 May 2012, 15:05

You are most likely running into the same issue as some other people - you do not change the value in the inspector.

Unity always uses inspector values and not script values for public exposed variables.

Try to find the LobbyGUI component in the scene and change the server there! :-)

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
AndyMartin458
Posts: 55
Joined: 15 May 2012, 21:57

Re: Lobby connects to localhost instead of specified ip

Postby AndyMartin458 » 18 May 2012, 01:18

Unity always uses inspector values and not script values for public exposed variables.
Thanks Thomas. I didn't quite understand what you meant until I tinkered around a bit. But, you were correct. Even though it was the correct ip, it had to be visible in the inspector for Unity to actually use the new ip. I've attached a picture of how it looks in the Objects example for others to follow.

Andy
Attachments
ConnectionGUI.GIF
IP should be visible in the inspector
(116.23 KiB) Not downloaded yet

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 73 guests