how share a game? over lan or internet :s

Monkey Forums/Monkey Beginners/how share a game? over lan or internet :s

monoloc(Posted 2014) [#1]
i launch a game in html,
open mserver minimal monkey http server
example.
open in mi webrowser
http://localhost:49250/MonkeyGame.html

mi firewall is off
if i try to use in otre pc on mi lan
ej

http://192.168.0.34:49250/MonkeyGame.html

say me in the debug

MServer 0.3
MServer active and listening on port 50607
1> HTTP Server active and listening on port 49250
1:1> GET H:/monkey/MonkeyPro75d/bananas/alga/sprite.build/html5/MonkeyGame.html (200 OK)
1:1> GET H:/monkey/MonkeyPro75d/bananas/alga/sprite.build/html5/main.js (200 OK)
1:1> GET H:/monkey/MonkeyPro75d/bananas/alga/sprite.build/html5/data/mojo_font.png (200 OK)

1> ***** Warning! *****
1> Connection attempt by non-Local host!
1> Remote IP=-1062731653, RemotePort=35057
1> ***** Warning! *****
1> Connection attempt by non-Local host!
1> Remote IP=-1062731653, RemotePort=35058
1:3> BYE
1:2> BYE
1:5> BYE
1:1> BYE
1:4> BYE


questions, can i open these game in other browser other pc or tablet in mi lan?
how admit these connection?

f to open a port on my ruter to, redirect to a port if you could use
and allow those connections, as I can adjust that?
usually in my ruter, with the option of virtual server, and dns
I host servers and games
redirected to the IP on my network and port hosted
and it serves me right, anyone can connect

the monkey but I could not do that

not how to make someone
you can see my game, either locally, or online
I do not allow it and I always change the port.
thus I find no way to do that

can i set a static port ????, if i try reconect , see
35058,35059,35058 and other tandoms port.


is there any tutorial to do that :/??ยก?


MikeHart(Posted 2014) [#2]
That is correct, MServer does not support this like other tools. I am on OSX and there I use MAMP to start a local webserver and set its root directory to the build folder. Or I copy the build to another folder which I have setup up as the root for MAMP.


Midimaster(Posted 2014) [#3]
I use Xampp on PC to have a apache server. Monkey apps run perfect on it. Then it is also possible to do http-requests between monkey html5 apps and the apache server


monoloc(Posted 2014) [#4]
I could install the apache web server
and there I worked


nikoniko(Posted 2014) [#5]
monoloc wrote:
can i set a static port ????, if i try reconect , see
35058,35059,35058 and other tandoms port.


Anyone can fix it.
MServ source is included to paid version of Monkey-X, but it is required BlitzMax to build.


Paul - Taiphoz(Posted 2014) [#6]
If you do not want to go through the possible issues with installing Lamp/Wamp or Xamp then you should look at dropbox, throwing your app into a dropbox folder will let you run it from any where you want.

I could for example pop my game html5 into my Dropbox public folder and share the link to it, I could also drop in the android apk and using the dropbox app clicking on the apk will install it.


monoloc(Posted 2014) [#7]
in the end I could get,
I had to install the apache webserver.
configure the path of the game
and on. build \ html5 \ monkeygame.html copy it to index.html
to open my apache path and ready
I take good
for now I'm just trying sprites
but it's fun to share that with my friends
=)

http://zephirus.no-ip.biz:80


nikoniko(Posted 2014) [#8]
monoloc wrote:
http://zephirus.no-ip.biz:80


doesn't work


Derron(Posted 2014) [#9]
Apache (and therefor xampp and variants) have some config files you can adopt for your needs.

each "domain" you setup in apache (default it is the localhost-domain) can have virtual directories.

So if you call:
localhost/monkeyapps (or yourIP/monkeyapps) it could call something specific - or redirect to your
real "monkey projects folder".

As remembering "build/html5/monkeygame" is a tedious work - especially if you use dyndns and want to tell your friends about your projects - you could end up having some simple php script.
This script just traverses through your projects folders, generates a link for every found project and presents it in a nice list. So you just have to call "myIP/monkeygames" or however you call it and the list is freshly baked on your demand.

If you are doing more professional work you will surely build everything with subversion/github and hooks so you eg. have a "dev"-subdomain for local dev testing and when updating your code to a stable repo-branch it will automatically be available on your "live" domain.

As sometimes "Localhost" or "IPs" are problematic - you can use virtual hosts in apache: as the domain "example.com" is RFCed for such purposes - you can setup "mygame.example.com" to call a specific directory on your server/computer. Remember that this is only for testing purposes - and does not work for others without doing the same action as you have to do: open your "hosts" file (google for location of it) and add a "mygame.example.com 127.0.0.1" line. Another game could get an "myothergame.example.com" and so forth.

Conclusion: replacing mserver with a "more powerful" one could have some advantages - but for fast "code and go" it may be more than needed. If you do web-developing you will surely have nginx/apache/... installed on your dev computer (or in an virtual machine) so you might use an afternoon to setup a more pretty and powerful backend for your monkey-html5-development.

bye
Ron


GuShh(Posted 2014) [#10]
Or just have it automatically uploaded to an http server via ftp, upon compilation time. Certainly beats having to wrestle around ports and hosts specially on a poorly designed network, plus it's more reliable and you would only have to upload the changes, not all the files.


monoloc(Posted 2014) [#11]
yes, you're right with these things, later when I Realize something more cute
the'll have in mind.

It just was not running the service ipduc non-ip donot when there will be closed because they never turn off the pc xD, but now it works again.
I feel like doing a lot of projects with the monkey, which both run on android html5 as of now I'll see if I do simple things to be learning, but luckily was easy, the steps to configure the IP and port in the virtual server the ruter, and cfg the apache, and it worked fine.

I'll see if I can make a small tutorial later
for those who are absolute beginners like me :)