I want to start developing an MMO game in html5. I have been working with sfs for a long time, but only with the regular version and with flash. Going beyond html5 is a pretty big transition, but I try.
My problem is that I've been busy for two weeks running the SFSx2 example of simaple mmo game. I first tried the flash version and it ran the example. When I switched to the html5 version and tried to connect the system registered in the console "Sending request 'Handshake' to server" and then typed "ATTENTION You have been disconnected; reason is: unknown. "I tried to look for answers online and saw that wws / ws needed to be enabled but the server still doesn't connect to me. I really don't know what to do.
And I tried to read a guide in sfs2x docs, but it probably fits an older version of the software. According to what is written there is supposed to be an index in the main directory, and I don't have one. What can I do?
Please, I'd be happy to help. Thanks in advance!
MMO game HTML5
Re: MMO game HTML5
Hi,
in order to run HTML5 examples you need the following:
- make sure websocket is active on the server side (Admin Tool > Server Configurator > Web Server)
- download the examples from here: https://www.smartfoxserver.com/download#p=examples
- copy the examples under www/ROOT/
- point your browser to http://localhost:8080/<name-of-the-example-folder>
Try following these steps one by one and let us know if you encounter any issues.
Thanks
p.s. = the reason why you need to copy the examples in the webserver folder, rather than somewhere else, is that browsers no longer allow connections from HTML files loaded from the file system.
in order to run HTML5 examples you need the following:
- make sure websocket is active on the server side (Admin Tool > Server Configurator > Web Server)
- download the examples from here: https://www.smartfoxserver.com/download#p=examples
- copy the examples under www/ROOT/
- point your browser to http://localhost:8080/<name-of-the-example-folder>
Try following these steps one by one and let us know if you encounter any issues.
Thanks
p.s. = the reason why you need to copy the examples in the webserver folder, rather than somewhere else, is that browsers no longer allow connections from HTML files loaded from the file system.
Re: MMO game HTML5
Lapo wrote:Hi,
in order to run HTML5 examples you need the following:
- make sure websocket is active on the server side (Admin Tool > Server Configurator > Web Server)
- download the examples from here: https://www.smartfoxserver.com/download#p=examples
- copy the examples under www/ROOT/
- point your browser to http://localhost:8080/<name-of-the-example-folder>
Try following these steps one by one and let us know if you encounter any issues.
Thanks
p.s. = the reason why you need to copy the examples in the webserver folder, rather than somewhere else, is that browsers no longer allow connections from HTML files loaded from the file system.
It's still not working.
http://localhost:8080/SimpleMMOWorld/ doesn't work because I don't have an Index.html file in the SimpleMMOWorld file. But this is work for me:
http://localhost:8080/SimpleMMOWorld/deploy/client/
I can enter to this file but the server still not connecting to me.
what can I do?
Re: MMO game HTML5
Each example comes with it's own tutorial.
Please read the relative tutorial here:
http://docs2x.smartfoxserver.com/ExamplesJS/simple-mmo
Thanks
Please read the relative tutorial here:
http://docs2x.smartfoxserver.com/ExamplesJS/simple-mmo
Thanks
Re: MMO game HTML5
Lapo wrote:Each example comes with it's own tutorial.
Please read the relative tutorial here:
http://docs2x.smartfoxserver.com/ExamplesJS/simple-mmo
Thanks
I know but no example works for me, maybe the problem is in the server?
Re: MMO game HTML5
Without any errors, it's difficult to guess what it's going on.
Let's start with the simplest of examples, the "Connector":
http://docs2x.smartfoxserver.com/ExamplesJS/connector
Try running this one and following the tutorial. If it doesn't work please report exactly what error you're getting and also look for errors on the server side.
Let us know
Let's start with the simplest of examples, the "Connector":
http://docs2x.smartfoxserver.com/ExamplesJS/connector
Try running this one and following the tutorial. If it doesn't work please report exactly what error you're getting and also look for errors on the server side.
Let us know
Re: MMO game HTML5
Lapo wrote:Without any errors, it's difficult to guess what it's going on.
Let's start with the simplest of examples, the "Connector":
http://docs2x.smartfoxserver.com/ExamplesJS/connector
Try running this one and following the tutorial. If it doesn't work please report exactly what error you're getting and also look for errors on the server side.
Let us know
Same
How can I see the errors?
Re: MMO game HTML5
Check the server logs, either on screen (if you run the server by double clicking its icon under Windows/Mac) or directly in the log files under SFS2X/logs/smartfox.log
It looks like you have not activated the Websocket option in the server config.
Please double check under Admin Tool > Server Configurator > Web Server
Also is the server running on your local machine?
Thanks
It looks like you have not activated the Websocket option in the server config.
Please double check under Admin Tool > Server Configurator > Web Server
Also is the server running on your local machine?
Thanks
Re: MMO game HTML5
Lapo wrote:Check the server logs, either on screen (if you run the server by double clicking its icon under Windows/Mac) or directly in the log files under SFS2X/logs/smartfox.log
It looks like you have not activated the Websocket option in the server config.
Please double check under Admin Tool > Server Configurator > Web Server
Also is the server running on your local machine?
Thanks
that's what was printed to me in the log file:
03 Apr 2020 | 14:23:52,898 | INFO | http-nio-8080-exec-7 | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 21, Type: WEBSOCKET, Logged: No, IP: 0:0:0:0:0:0:0:1 } on Server port: 8080 <---> 63714
And I did active it:
Re: MMO game HTML5
The log fragment you posted shows that the connection was made. What happens after?
Can you show a more complete view of the logs where we can see what happens between connection and disconnection?
Thanks
Can you show a more complete view of the logs where we can see what happens between connection and disconnection?
Thanks
Re: MMO game HTML5
Josh8787 wrote:
How can I see the errors?
What if you check the "Show debug" checkbox?
I'd like to see what messages are printed on the screen.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: MMO game HTML5
Lapo wrote:The log fragment you posted shows that the connection was made. What happens after?
Can you show a more complete view of the logs where we can see what happens between connection and disconnection?
Thanks
What I posted is the only thing that show to me in the logs file when I'm trying to connect
Re: MMO game HTML5
It looks like something else is interfering with the connection, especially if from client side you get disconnected but there's no trace of any disconnection message in the server logs.
What OS are you using?
Are you running any firewalls (besides the default Windows or Mac fw)? Or maybe an antivirus which adds its own firewall? If so try to shut it down (only temporarily) to see if you can connect.
Thanks
What OS are you using?
Are you running any firewalls (besides the default Windows or Mac fw)? Or maybe an antivirus which adds its own firewall? If so try to shut it down (only temporarily) to see if you can connect.
Thanks
Who is online
Users browsing this forum: No registered users and 66 guests