smartConnect not working on sfs 1.6

Submit all your BlueBox related questions or report a bug here!

Moderators: Lapo, Bax

amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

smartConnect not working on sfs 1.6

Postby amnesya » 17 Dec 2007, 23:31

I now connect this way after having updated to 1.6 on an application fully working on 1.5 version:

smartConnect = false;
nc.connect(ip, port);


then when the client is succesfully connected, I stop the server and when the client looses the connection I still see the output:

** Socket connection failed. Trying BlueBox **
[ Send ]: connect
Error opening URL "http://xxx.xx.xx.xxx:8080/BlueBox/HttpBox.do"
---> Status received: 404


shouldn't it NOT try to connect to bluebox ?

a part from the fact that bluebox does not work (could you please tell me why?) if I cannot disable bluebox I can't detect no more the client disconnection !!!

help please
Kicksome
Posts: 52
Joined: 01 Sep 2007, 02:25
Contact:

Postby Kicksome » 18 Dec 2007, 01:30

Don't you need

nc.smartConnect = false;
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Dec 2007, 06:50

smartConnect = false;
nc.connect(ip, port);

if nc is an instance of SmartFoxClient then you should use:

Code: Select all

nc.smartConnect = false

a part from the fact that bluebox does not work (could you please tell me why?)

Could you please describe the problem and report any errors?
Lapo
--
gotoAndPlay()
...addicted to flash games
amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

Postby amnesya » 18 Dec 2007, 08:41

thanks lapo !

I was keeping doin it without because that way I was reading it in the docs.

about the BB the issue is the following.... it Simply does not work and it stops over the message :


** Socket connection failed. Trying BlueBox **
[ Send ]: connect
Error opening URL "http://xxx.xx.xx.xxx:8080/BlueBox/HttpBox.do"
---> Status received: 404


now, the problem is that even if it was working, it seems like the BB tries to connect when the connection gets lost. I now well handle the client disconnection, sending the client a disconnection message and then back to login when the connection goes up again.

This way I cant detect a disconnection because BB gets trigged and keeps the client as if it was in !

thanks for the answer !

amnesya
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 18 Dec 2007, 09:09

Which API are you using? AS 2.0?
** Socket connection failed. Trying BlueBox **
[ Send ]: connect
Error opening URL "http://xxx.xx.xx.xxx:8080/BlueBox/HttpBox.do"


This can happen if:
1) BlueBox is not running on port 8080
2) Port 8080 is blocked by a firewall.

In case #2 you should try running the BB on port 80, which is the best choice.
Lapo

--

gotoAndPlay()

...addicted to flash games
amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

Postby amnesya » 18 Dec 2007, 09:53

AS 2

OK BLUEBOX is perfectly working !

----------------- BUT NOW ------------------

if I turn bluebox OFF

I have noticed that when my flash client closes connection (by unplugging the DSL cable or by restarting the server) and then the client reconnects, SFS 1.6 does not work properly.

When the client reconnects and performs secure login, it works no more. The client regularly sends the login message (like on 1.5) but the server answers no more (on 1.5 it did).

this problem gets solved if I reload the client (close swf and open it back again), but I need to handle disconnection inside the game without making the player refresh page.

I need to run the client so that when the connection is lost goes to a page "Attempting reconnection" and that when the connection is up again it goest to login page.

And it works, but trying to login again server answers no more !

if I turn bluebox ON

I have noticed that when my flash client closes connection (by unplugging the DSL cable or by restarting the server) I cannot detect disconnection clientside because on connection lost it tryes to connect to bluebox !!!

And obviously having no connection i get :Error opening URL "http://151.44.53.220:8080/BlueBox/HttpBox.do"

how can I intercept this kind of BB disconnection, so that I can show client side disconnection to the player ?

--------------------------------------


any idea for both the problems ?
no-one
Posts: 35
Joined: 01 Sep 2007, 16:42

Postby no-one » 18 Dec 2007, 20:56

i got the same problem when bluebox is on, normal connections fails to detect disconnects when, server restarts, your being kicked and when your banned.the only one it detects is its own client side disconnect.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 18 Dec 2007, 21:59

There seems to be a bug in the as2 api. We will update the SmartFoxServer package in the next hours. In the meanwhile you can patch the api by yourself: open the SmartFoxClient.as class and on line 4442 add the following instruction: this.preConnection = false
This should be enough. In case some more changes are required, we will post a message here.
Paolo Bax
The SmartFoxServer Team
amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

Postby amnesya » 18 Dec 2007, 23:25

SmartFoxClient.as already has that line, on 4441

4441 this.preConnection = false
4442 this.onConnection(false)
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 18 Dec 2007, 23:49

Sorry, this is where it should go:

Code: Select all

public function connectionEstablished(ok:Boolean):Void
{
     if (ok)
     {
          clearInterval( socketConnectionTimeoutThread )
          this.preConnection = false  // <------------------------------
         
          var header:Object = {t:"sys"}
          ...
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 19 Dec 2007, 06:41

Please note: the line number referred is 4421
Lapo

--

gotoAndPlay()

...addicted to flash games
amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

Postby amnesya » 19 Dec 2007, 12:19

ok fine, it works now.

I can detect disconnection perfectly like before.

I still got a problem when the client reconnects (in the same swf) after disconnection.

when connection is restarted (without closing swf and reopening it, but inside the same swf), any command like login:

sfs.login(zone, nick, md5),

does NOT work when connection gets established back again.

how can I fix this problem ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 19 Dec 2007, 18:36

topic was moved and the duplicate topic removed
We sent an email with the API update.
Lapo

--

gotoAndPlay()

...addicted to flash games
amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

Postby amnesya » 19 Dec 2007, 21:47

the api you sent me (thanks by the way) solves the problem of detecting the disconnection (I had already solved the problem before by adding the codeline on line 4421 as you told me)

But still got the other problem !!! could you please help me ?

all disconnection and reconnection handling is impossible this way (read post above to understand the problem)

thanks in advance

amn
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 20 Dec 2007, 05:46

We have tested many of the bundled examples and we don't have any problems at all with connecting and reconnecting within the same SWF instance. (we tested both disconnection and logout)

Maybe this is an issue specific to your application.

For example take the AdvancedChat:
- login with any name
- once inside click EXIT
- you'll get back to the start screen and you'll be able to login again

(we tried also by kicking the user from the admin)

Could you provide a code example that reproduces the issue?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “BlueBox”

Who is online

Users browsing this forum: No registered users and 11 guests