can't connect to smartfoxserver

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

ronin
Posts: 10
Joined: 21 Nov 2008, 22:41

can't connect to smartfoxserver

Postby ronin » 21 Nov 2008, 23:05

Hi guys,
I've download the api for Unity3D from this page here.

http://www.smartfoxserver.com/labs/API/

Now, when I try to build and run the example (SmartFoxLobby) provided from that download I get the an error saying:
"I/O Error: http://HOSTNAME:PORT/bluebox/httpbox.do"

Bluebox is working. I can see a message saying that bluebox has been successfully installed. I can also connect to smartfoxserver via Unity3D program itself but not from a browser.

So, to sum it up. I get an error only when I run "SmartFoxLobby" from the browser and not when I hit play inside Unity3D.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 24 Nov 2008, 08:55

Hi ronin,
the BlueBox support is not finalized yet in beta2. You can however fully take advantage of socket connections. Make sure that your client test application connects to the same port number used by SmartFoxServer (9339 is the default)

HTTP tunnelling support will be out in the next release of the API

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 24 Nov 2008, 18:43

Just got to make sure - you did remove your hostname and port, so that the error message included the correct ip+port - right?

As Marco said, the http tunneling is not fully running yet in beta 2. Will get cracking on that really soon.
ronin
Posts: 10
Joined: 21 Nov 2008, 22:41

Postby ronin » 25 Nov 2008, 17:34

"Just got to make sure - you did remove your hostname and port, so that the error message included the correct ip+port - right?"

Thanks for the reply guys.

Thomas, my ip is showing in the error message but the server port is 8080 even though I entered 9339. I guess this is because it's trying to use BlueBox port.

I'm thinking of going the AS3, unity and SFS route. What I'm trying to do is authenticate users in a shared 3D environment using AS3/flash to SFS. Please let me know if this is possible.

I will also look into socket connection.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 25 Nov 2008, 19:59

The way the API works, it first tries to make a socket connection to the server on port (whatever you entered - usually 9339).

If that fails, then it will try the same host but on port 8080.

If that also fails, then you would get that error (I think).

So make sure that you actually have a SFS server running on your address on either port 9339 or port 8080 and that it can be reached from your client. Good way to test that is to try to telnet to the ip and port.

Fire up a terminal (if you are on a Mac or Unix) and write

telnet HOSTNAME 9339
telnet HOSTNAME 8080

or even better the IP of the host, so you get around DNS issues.

If it gives you a connection refused, then server is not running or a firewall is blocking both ports.

If there is a connection, then something else is wrong. It should definitely work nicely out of the box on sockets, and failover should also work (a little).

The combo of Flash and Unity on the client side _is_ possible - communication through the javascript dom tree or something. I have seen it done a few times, but not tried it myself. I would investigate how to do that over on the Unity forums. It does beg the question on what you are trying to do. Is your initial SFS connection done in flash, and then you show the Unity game window?

(Just trying to understand what you are trying to do ) :)
ronin
Posts: 10
Joined: 21 Nov 2008, 22:41

Postby ronin » 25 Nov 2008, 23:36

ThomasLund wrote:
It does beg the question on what you are trying to do. Is your initial SFS connection done in flash, and then you show the Unity game window?

(Just trying to understand what you are trying to do ) :)


Yes, that is exactly my intention.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 26 Nov 2008, 07:44

Oh - good question then on how to do that with SFS. The backend connection is a TCP socket connection that you cannot "delegate" between Flash and Unity. You would most likely have to re-connect and re-login (transparently) inside your game.

Depends naturally on what you are doing. If your game is not using SFS at all with a Flash based lobby around it, then you would not need it obviously.

I would have to turn to Marco for some help on what happens when 2 client APIs on the same machine start 2 connections with the same username - and are logged in at the same time.

As I said - for the flash <-> unity part you should try to go to the forums on unity3d.com (if not already there) and ask about that part.
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 27 Nov 2008, 09:07

I would have to turn to Marco for some help on what happens when 2 client APIs on the same machine start 2 connections with the same username - and are logged in at the same time.

This cannot be done, at least not under the same Zone.
If you use a mixed approach where there's both a Flash client and Unity client you should use two different Zones.
Zones don't allow duplicate names.
Lapo

--

gotoAndPlay()

...addicted to flash games
ronin
Posts: 10
Joined: 21 Nov 2008, 22:41

Postby ronin » 01 Dec 2008, 20:35

Lapo wrote:
I would have to turn to Marco for some help on what happens when 2 client APIs on the same machine start 2 connections with the same username - and are logged in at the same time.

This cannot be done, at least not under the same Zone.
If you use a mixed approach where there's both a Flash client and Unity client you should use two different Zones.
Zones don't allow duplicate names.


It does make sense that it can't be done. Thanks.
ronin
Posts: 10
Joined: 21 Nov 2008, 22:41

Postby ronin » 01 Dec 2008, 20:57

Thomas,
To answer your question of what exactly am I trying to do. Here's a mini model of my desired program.

Let's say for example that I'm trying to make a chat program in unity. There's one chat box where all the users in the room can see each others' chats and there's another box for listing who is currently in this room. In addition, I would like to add a "click me" button somewhere on the chat room window. So far, everything is inside the unity player itself.

I now want to add a text field below the unity player so that when I hit the "click me" button the text field will say "<user name>". The important feature that I would like is that when any of the user clicks that button, the result will be shown in all browsers of the users in that room. So if you and I are in that room and I click the button, you will see my name in the text field.

There is one main criterion that this program should meet.
    It must be BlueBox compatible.


Is it possible to do this in SFS as the back end and Unity3D as the front end? If so, please help guide me onto the right path.
ronin
Posts: 10
Joined: 21 Nov 2008, 22:41

Postby ronin » 02 Dec 2008, 19:09

I guess no http tunneling for the unity .NET API.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 02 Dec 2008, 22:08

Hi ronin

There is http tunnelling - just not tooooootally done yet. But almost :-D

Gimme a few more days of testing, and I will also ship you a dll for testing in your end.

Best
Thomas

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 39 guests