Page 7 of 9

Can't connect to server

Posted: 12 Mar 2011, 00:02
by hanger102
Hi,

Trying to run the demo with RC2 but I can't connect to the server. But the demo projects work. Here are the errors.

Code: Select all

[SFS DEBUG] TCPSocketLayer: General exception on connection: Unable to connect, as no valid crossdomain policy was found   at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0 
  at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0 
and

Code: Select all

On Connection callback got: False (error : <General exception on connection: Unable to connect, as no valid crossdomain policy was found   at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0 
  at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0 >)
UnityEngine.Debug:Log(Object)
LobbyGUI:OnConnection(BaseEvent) (at Assets/Lobby/Scripts/LobbyGUI.cs:99)
Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent)
Sfs2X.SmartFox:ProcessEvents()
LobbyGUI:FixedUpdate() (at Assets/Lobby/Scripts/LobbyGUI.cs:87)
Thanks.

Posted: 12 Mar 2011, 01:33
by appels
Unable to connect, as no valid crossdomain policy was found
Since 3.0 you need to use policy validation in the webplayer.

Posted: 12 Mar 2011, 04:59
by hanger102
Sorry I'm still learning, but where do I put the crossdomain.xml file and is this all that needs to but in it?

Code: Select all

<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>

I tired putting this in the root of where I built the web file but that didn't work.

Posted: 12 Mar 2011, 09:55
by ThomasLund

Posted: 13 Mar 2011, 20:20
by Scarpelius
Hello,

I've been installed sfsx2 on a Debian distro and tested FPS demo. It runs smooth if i publish the game as windows executable, but if i publish it for web, i cannot even login in lobby room. Now i am sure i have seen some reference about this particular problem, somewhere in the site, but i am not able to find it anymore.

I have placed the game along with the other examples.

Can someone please point me in the right direction with this?

Posted: 13 Mar 2011, 22:21
by appels
read the post before yours from Thomas

Posted: 13 Mar 2011, 22:22
by ThomasLund
The sticky note that I refer to right above you post has the info you need is my guess

Posted: 13 Mar 2011, 23:38
by Scarpelius
Yes, it does the trick :)
I've added
Security.PrefetchSocketPolicy(serverIP, serverPort);

in the Start function of lobby script and is working.

Now i have to figure out how to make it work for peoples outside my private network. I mean if i use for default server 192.168.... ip of server inside my network, then people from internet will get the error of not getting the policy file. If i use my real IP for default, then i cannot connect. But this is another problem and is not related to sfs.

Anyway, great piece of code. I hope my game will be finished some days to be able to buy it and use it full :)

Posted: 14 Mar 2011, 08:41
by ThomasLund
You simply use NAT on your firewall to expose the port to the outside. And that should be more or less it

/Thomas

Posted: 15 Mar 2011, 13:10
by Scarpelius
Quick question, related to the demo: what IDE to use to open SFS2XFPSextension project? Being a complete noob of using java development tools i've tried with Eclipse and NetBeans, but none seems to recognize it.
I would like to use that project to learn my ways in java and expand the project to add more functionality to the authoritative server.

Posted: 15 Mar 2011, 14:22
by ThomasLund
I used IntelliJ IDEA for it. But any of the IDEs can be used with very little configuration if you know how to do develop java apps.

Posted: 15 Mar 2011, 19:24
by Scarpelius
Ok thanks :)

Posted: 11 Apr 2011, 18:54
by tpenn
In going through the extension code recently, I noticed something that seemed wrong. The server sends transform updates to the clients like so:

Code: Select all

this.send("transform", data, userList);
Wouldn't that send via TCP? Should it not be:

Code: Select all

this.send("transform", data, userList, true);
My understanding is that transforms were supposed sent in the demo UDP with everything else TCP, but it doesn't look to me like it works that way.

Posted: 08 May 2011, 21:35
by Elstur
ThomasLund wrote:There is a FPS document available as download where you got the code that should explain the installation.

Try to take a look and if you still have issues, then ask away!

/Thomas
I was wondering if you could point this document out? It's not linked from this thread and I'm completely new to smartfox. I have SFX2 downloaded, and this demo downloaded, however, I have no idea how to go about connecting the server side code of this extension to the server itself. I'm coming over from Photon, and this step doesn't exist there.

I did look around to try and find instructions on how to do that, but, I guess I really don't know what I'm looking for.

Thanks!

-- Edit --
Alright, Here's what I've done and where I think I'm stuck at.
Windows 7 64 bit
Downlaoded SFS2X rc1a.
Installed
Setup UDP connections to port 9933 via localhost:8080 admin tool
Set port forwarding on router
Took care of any firewall/AV issues.

Downloaded this FPS Demo from this site. Loaded the demo client info into the latest version of unity. What do I do with the server part of it and how do I access the server-side code for my own implementations? From what I've seen around it appears to be coded (server side) in Java?

I want to do this as a standalone windows app. And I'm afraid I know nothing about SF configuration at this time.

Posted: 11 May 2011, 06:57
by Bax
Elstur, we really recommend that you read at least the introductory documents to SFS2X, to understand the architecture (this link). Or you will be lost at each step. About the white paper on the FPS you asked for, it is linked at the bottom of the SFS2X download page.