Page 1 of 1

Login Problems

Posted: 28 May 2005, 15:47
by dan111
I know this is probably a stupid problem with an easy solution but I've tried everything and I cant get it to work. When I opened the Avatar Chat example on my computer it worked perfectly but when I published it to the internet it says that it has connected but when I try to use the 'Login' button nothing happens. I think it's something to do with the included files but I wasn't sure so I posted here. Any ideas?

Posted: 29 May 2005, 07:26
by Lapo
Hi,
it has to do with the flash player restrictions, not the included files.
To make a long story a short one, the flash player does not allow to connect to servers other than the one where the SWF file is published.

To learn how to avoid these problems read the SmartFoxServer documentation available here >> http://www.smartfoxserver.com/docs/

The chapter you need to read is 3.1

Hope it helps! :)

Posted: 29 May 2005, 09:54
by dan111
Thanks. I had already tried the System.security.loadPolicyFile but it didnt work so I'm going to try the other way.

Posted: 29 May 2005, 10:08
by Lapo
That feature works if your flash player is at least version 7.0.19 or better...

Posted: 29 May 2005, 10:38
by dan111
I've made a 'crossdomain.xml' file and added this code to the top of the actionscript on the 'Connect' frame of the AvatarChat:

Code: Select all

System.security["loadPolicyFile"]("xmlsocket://192.168.0.178:9339")
but it still won't log me in. I think I have the latest version of flash too.

Posted: 30 May 2005, 09:52
by Lapo
Hi,
check in the config file (config.xml) if you have this line:

Code: Select all

<AutoSendPolicyFile>true</AutoSendPolicyFile>
If not just add it in the <ServerSetup></ServerSetup> block.

Restart the server.
Now open a new console window and typt this line:

Code: Select all

telnet www.xxx.yyy.zzz 9339
where www.xxx.yyy.zzz is the server IP address.
You should receive a response similar to this:

Code: Select all

<cross-domain-policy><allow-access-from domain='*' to-ports='9339' /></cross-domain-policy>
Let me know if it works!

Posted: 31 May 2005, 19:01
by dan111
Thanks it's working now. I didnt have the

Code: Select all

<AutoSendPolicyFile>true</AutoSendPolicyFile> 
in my config file and I had the wrong path to my lib files. Thanks again.

Posted: 31 May 2005, 19:14
by Lapo
I am glad it works now! :)

AutoSendPolicyFile

Posted: 04 Jul 2005, 12:48
by BadDude
Is this feature supported in all version?

I downloaded the lite, and while it is working in localhost, if I try to connect to the server from under an other domain (i put the swf up to our local test server, which means the simpleChat.swf is under a different domain), it doesn't work. If I try the swf (and only the swf) from an other computer (which means the swf wont be under an other domain, just standalone), it is working.

The <AutoSendPolicyFile> set to true in the config, and if I try to telnet to the server, it is simply doesn't response. The telnet said i'm connected, but no policy response. If I dont load the System.security.loadPolicyFile("xmlsocket://" + ip + ":" + port), I can see the sandbox violation message in the debug player, if I put in it, the swf just wait for the connection, no error message.

I wrote a simple socketserver in c#, and I can telnet to it from remote (on the same port, same machine, like the samrtfox server), so theres no firewall block, nothing.

Do you have any idea whats wrong?

Thanks.

Posted: 04 Jul 2005, 13:09
by Lapo
Hi,
the Lite version does not support the auto-policy thing but you can put the crossdomain.xml file in the root fo your webserver and the problem is solved.

About telnetting the server that's ok, the server does not send any information upon connection so if you telnet the server and you get connected the server is definetely working