[[ NEW ]] FPS Demo!

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

hanger102
Posts: 2
Joined: 11 Mar 2011, 23:57

Can't connect to server

Postby hanger102 » 12 Mar 2011, 00:02

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.
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 12 Mar 2011, 01:33

Unable to connect, as no valid crossdomain policy was found


Since 3.0 you need to use policy validation in the webplayer.
hanger102
Posts: 2
Joined: 11 Mar 2011, 23:57

Postby hanger102 » 12 Mar 2011, 04:59

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.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 12 Mar 2011, 09:55

Explained in sticky here

viewtopic.php?t=8878
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
Scarpelius
Posts: 24
Joined: 12 Mar 2011, 11:33

Postby Scarpelius » 13 Mar 2011, 20:20

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?
appels
Posts: 464
Joined: 28 Jul 2010, 02:12
Contact:

Postby appels » 13 Mar 2011, 22:21

read the post before yours from Thomas
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 13 Mar 2011, 22:22

The sticky note that I refer to right above you post has the info you need is my guess
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
Scarpelius
Posts: 24
Joined: 12 Mar 2011, 11:33

Postby Scarpelius » 13 Mar 2011, 23:38

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 :)
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 14 Mar 2011, 08:41

You simply use NAT on your firewall to expose the port to the outside. And that should be more or less it

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
Scarpelius
Posts: 24
Joined: 12 Mar 2011, 11:33

Postby Scarpelius » 15 Mar 2011, 13:10

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.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 15 Mar 2011, 14:22

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.
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
Scarpelius
Posts: 24
Joined: 12 Mar 2011, 11:33

Postby Scarpelius » 15 Mar 2011, 19:24

Ok thanks :)
tpenn
Posts: 95
Joined: 03 Aug 2010, 18:48

Postby tpenn » 11 Apr 2011, 18:54

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.
Elstur
Posts: 1
Joined: 08 May 2011, 18:13

Postby Elstur » 08 May 2011, 21:35

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.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 11 May 2011, 06:57

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.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 43 guests