Multi-user Environment in Unity3

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

lampshade
Posts: 18
Joined: 04 Dec 2010, 19:14

Multi-user Environment in Unity3

Postby lampshade » 11 Mar 2011, 03:15

Greetings,

I am wondering how to acheive two PC's connecting to a server. I tried the tutorial here:

http://virtualautonomy.com/blog/index.p ... eat?page=5

but I was only able to connect the same pc twice, by running another instance of the demo web player.

To reiterate, I am very interested in attempting to acheive two PCs that can independently connect to the smart fox server.
lampshade
Posts: 18
Joined: 04 Dec 2010, 19:14

Postby lampshade » 11 Mar 2011, 04:56

I neglected to mention that I have the 2$ project file located here:

http://virtualautonomy.com/blog/index.p ... eat?page=5


My steps:
-----------

1) modified the config.xml file and chose the Server IP as: 127.0.0.1 (on both PC's)

2) clicked the start executable to run the smart fox server (on both PCs)

3) I am logged in successfully on two different machines with user names A(PC1) and B(PC2).


But I cannot see or chat with the other player. Is there something missing that I need to add to the config.xml file? Do I need a socket server? I am running the SFS 1.6.6
lampshade
Posts: 18
Joined: 04 Dec 2010, 19:14

Postby lampshade » 11 Mar 2011, 06:24

Do I look up where:

Card:Software loopback interface 1

is defined in and then change it from"127.0.0.1" to that of MY own IP address? I'm confused..

This is because I tried changing the IP address to something different than, "127.0.0.1" (like my own). So I did, and now, when I click the start execuatable to start the server, it crashes and I am prompted to [Press any key continue].
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 11 Mar 2011, 07:31

Personally I find that $2 project a total rip-off. You could have gotten the same code for free in the examples I provided here. He more or less just replaced the art from the island demo with boxes afaik.

Anyways - 127.0.0.1 is a loopback interface for a local machine. Its not a "real" IP address and you can never connect to that from anywhere except you local machine.

So put in the real IP and try again

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
lampshade
Posts: 18
Joined: 04 Dec 2010, 19:14

Postby lampshade » 11 Mar 2011, 10:04

thanks for the repy. What is the "real IP"?

And i've tried to download the smartfox pro 1.6.6 three times and I still can't get it to run..I followed the bergzergacrade tutorial where the host dwnloaded and demonstrated Linux usuage (I took a class back in the day on UNIX and I recognized it which was nice).

I guess what I am asking is, do I need to start SFSPro 1.6.6 and provide the "real IP" in the confix.xml and config.template files and then use/verify/confirm it....where could I find the "real IP" so that I may get started?

Thanks in advance.
User avatar
Bax
Site Admin
Posts: 4489
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 11 Mar 2011, 10:34

First of all, this is not the SFS 1 forum, so I'm moving this whole discussion to the right forum.

In order to get the IP of your server, run one of the following commands:
Windows -> Open a prompt/command window and type: ipconfig
Linux/Unix -> Open a terminal window and type: ifconfig
Paolo Bax
The SmartFoxServer Team
lampshade
Posts: 18
Joined: 04 Dec 2010, 19:14

Postby lampshade » 11 Mar 2011, 21:34

Thanks for the reply,

Yes, I have windows and typed in ipconfig in the command prompt and then was presented with my "real IP" (opposed to the address that http://www.whatismyip.com/ reads as). I changed the config.xml file and the config.template file to match my "real IP" (the one that I found when typing ipconfig in the console).

However, it seems that I cannot connect when inputing my "real IP". I get a "I/O Error: Connection refused" when attempting to connect to my "real IP" (the one that is present in both the config.xml and config_template.xml) before game.

Here is what I did:
---------------------

I opened up the console and typed: ipconfig
Found my "real IP"
Modified (replaced the '*') the config.xml and config_template.xml <ServerIP>*</ServerIP> to that of my "real IP".
Clicked the Start Executable to start the server.
Server is ready
Ran the game
attempted to connect and then Connection was refused.


Thanks again in advance.
lampshade
Posts: 18
Joined: 04 Dec 2010, 19:14

Postby lampshade » 12 Mar 2011, 00:39

Solved! Thanks everyone including bax and ThomasLund for your help! :) I will post if I have any more trouble, and thanks again!
Last edited by lampshade on 15 Mar 2011, 04:06, edited 1 time in total.
User avatar
Bax
Site Admin
Posts: 4489
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 13 Mar 2011, 10:35

Please also post the solution! It can help other users.
Paolo Bax
The SmartFoxServer Team
lampshade
Posts: 18
Joined: 04 Dec 2010, 19:14

Postby lampshade » 15 Mar 2011, 04:02

Definitely; for Windows OS:

1) Type in ipconfig in the console
2) Find the config.xml and config_template.xml files
3) Change the asterik in <ServerIP>*</ServerIP> to the ip found in step 1 if it reads otherwise.
4) Run the server on the PC of your choice
5) Connect to the server using the ip found in ipconfig on a different PC; this makes you the localPlayer.
6) Connect to the server using a different PC; this makes you the remote player
7) Customize away!


Maybe someone could translate (or even reduce the steps) to mac or linux even? :p
zante
Posts: 7
Joined: 13 Nov 2009, 19:02

Postby zante » 26 Jul 2011, 12:41

ThomasLund wrote:Personally I find that $2 project a total rip-off. You could have gotten the same code for free in the examples I provided here. He more or less just replaced the art from the island demo with boxes afaik.
/Thomas


I don't charge that much for it and at least I see some sort of return for writing so much!

Plus there's the added revenue I bring the software for making it usable. ;]

Pay me to do it and I'll make Smartfox famous. Otherwise my interest is purely casual.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 11 guests