Jump to content


Photo

Extension: 39js (Socket.io)


  • Please log in to reply
67 replies to this topic

#21 Manuel777

Manuel777

    InvaderGames

  • GMC Member
  • 2847 posts
  • Version:GM:Studio

Posted 28 September 2011 - 11:20 AM

Would be great if you finish this.. i didnt even know socket.io existed, and it looks liike a really nice bunch of codes ;)
  • 0

#22 Armisticdoom

Armisticdoom

    GMC Member

  • New Member
  • 73 posts

Posted 28 September 2011 - 03:57 PM

**** OMG THANK YOU MAN GOTTA SEE IF THIS WORKS
  • 0

#23 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2607 posts
  • Version:GM:Studio

Posted 28 September 2011 - 03:58 PM

It does work. however, the server right now is (must be?) a java file....Hope this will be changed though, but I think I read that he (the creator of this) is trying it atm.
  • 0

#24 Armisticdoom

Armisticdoom

    GMC Member

  • New Member
  • 73 posts

Posted 28 September 2011 - 04:33 PM

hmm still needs a lot more data types
  • 0

#25 Barling

Barling

    GMC Member

  • New Member
  • 122 posts

Posted 28 September 2011 - 06:27 PM

Are we able to connect this to any server?
I mean wouldn't we be able to connect it to a GM server running 39dll?
  • 0

#26 pedrosorio

pedrosorio

    GMC Member

  • GMC Member
  • 971 posts

Posted 28 September 2011 - 08:35 PM

It does work. however, the server right now is (must be?) a java file....Hope this will be changed though, but I think I read that he (the creator of this) is trying it atm.


Javascript
  • 0

#27 True Valhalla

True Valhalla

    ಠ_ಠ

  • Retired Staff
  • 4879 posts
  • Version:GM:Studio

Posted 28 September 2011 - 10:18 PM

To run the server, will a typical web server suffice or do you need a proper server like a VPS? I suspect a VPS? The main reason I'm edging towards PHP for my game is it's not real time and I'd like to use a web server rather than my VPS to host.
  • 0

#28 TGMG

TGMG

    G-java creator

  • New Member
  • 706 posts
  • Version:GM8

Posted 29 September 2011 - 12:47 AM

You can't directly connect to a GM server running 39dll as socket.io uses websockets and doesn't allow raw tcp connections. However i'm looking into 2 options to make this possible. 1) modifying the 39dll to use websockify which translates websockets to normal socket traffic 2) rewriting 39dll as a websocket server.
Which both would require you to use a custom dll rather than plain 39dll, option 1 would potentially allow both players from gmhtml5 and normal gm to connect to the same server, whereas number 2 wouldn't (well unless they also connected over websockets).

Currently you have to rewrite your server into javascript and run on node.js, currently i'm writing code to allow gmhtml5 servers to run in node.js, so no rewrite is required.

But I do realise that node.JS isn't ideal for everyone and will also look into a php websocket server (which will require you to write all the server code in php). But it is worth mentioning the only advantage of this is it allows you to write in php, you can't just upload to a shared hosting service and expect it to work.

Its also worth mentioning that there are Java, Go, Perl, Ruby, Erlang and Python versions of socket.io which you can already use to write servers for your gmhtml5 games.

Edited by TGMG, 29 September 2011 - 12:55 AM.

  • 0

#29 Dangerous_Dave

Dangerous_Dave

    GMC Member

  • Global Moderators
  • 9276 posts
  • Version:Unknown

Posted 29 September 2011 - 03:35 AM

The main reason I'm edging towards PHP for my game is it's not real time and I'd like to use a web server rather than my VPS to host.

If the game isn't real time, then the latency of an HTTP connection would probably not be noticeable. If it's turn based, then it should be fine. If it requires seeing anything in real time, like seeing other players moving around, then it would be less suitable (but can be faked in some situations).
  • 0

#30 Armisticdoom

Armisticdoom

    GMC Member

  • New Member
  • 73 posts

Posted 01 October 2011 - 04:09 PM

It would be nice if tcpaccept returned a value less than 0 if the connection failed, like 39dll.
  • 0

#31 dvdtv

dvdtv

    GMC Member

  • New Member
  • 7 posts

Posted 01 October 2011 - 06:06 PM

This look realy nice but i have got a problem. When i run the server.bat i see 1 line of text.
That line gives me online the place were de file stand. Then I start the proj_39jsexample en is start to play.
I changed the port to my port but that doesn't mean because I use localhost. Then I start the game
and I tried to show a message when I recieve a message but I dont recieve message from te server.

I hope you understand What I mean but my englisch isn't very well. Normaly I post on de dutch forum for game maker.

Greets,
or met vriendelijke groeten,
Dennis
  • 0

#32 FiLkAtA

FiLkAtA

    GMC Member

  • GMC Member
  • 511 posts
  • Version:GM:Studio

Posted 12 October 2011 - 11:46 AM

I'm trying to understand this and I hope you guys will help me out. To learn how this works I want to host the example somewhere and play around with it. I know how to host a game made with GM HTML5 but I'm confused how to host this because of the javascript server. Do I have to host it seperately and which files go where? Thanks in advance.
  • 0

#33 Smarty

Smarty

    GMC Member

  • Retired Staff
  • 7213 posts
  • Version:GM:Studio

Posted 12 October 2011 - 12:20 PM

I'm not so sure it's useful, let alone efficient, to try and enforce a 39dll syntax here, for a number of reasons. First of all you currently have no way to interface with the original 39dll socket implementation. Second, server-side code written using 39dll needs a rewrite anyway because none of what people ever wrote was using Javascript in the first place.

But the most important difference is in how 39dll and websockets treat the message part. Where 39dll tries to save pennies by concatenating binary data, websockets can only send text. By nature this is far more verbose, so the message part becomes larger in websockets than in 39dll no matter what you do. But because 39dll users expect control on the byte level, you deal with this difference in 39js by making the buffer commands push data into a text array and pulling (shifting) it out of it again. There is no difference at all in the buffer adding functions. There is no longer a point to have different functions to add different sizes of data to the buffer. There is no longer any point in making the distinction.

Edited by Smarty, 12 October 2011 - 10:17 PM.

  • 0

#34 Jolie

Jolie

    GMC Member

  • New Member
  • 105 posts

Posted 12 October 2011 - 12:39 PM

Wow, this is amazing!
This really extends the possibilities of GM HTML5!
  • 0

#35 Schalk

Schalk

    GMC Member

  • GMC Member
  • 487 posts
  • Version:GM:HTML5

Posted 12 October 2011 - 09:42 PM

Thanks for sharing.

From what I understand, websockets are turned off in Opera and Firefox for security reasons, and the only browser which it currently works on is chrome.
  • 0

#36 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 266 posts

Posted 14 October 2011 - 03:58 PM

Wow. Simply: Wow!

This solves SO many problems!
I'll finally be able to:

Run the server program on a remote desktop
Run the server program in the background WITHOUT alarms messing up
RUN THE SERVER ON A LINUX MACHINE

Oh my god! Thank you soooo freaking much! This is REALLY awesome!
  • 0

#37 Fireball16

Fireball16

    Indie Developer

  • GMC Member
  • 1006 posts
  • Version:GM:Studio

Posted 15 October 2011 - 03:37 PM

I am just wondering, can you have a .exe with the .39dll and connect it to a html5 server using the 39js?

So can you host a server on a webpage and have exe's connect to it? :ninja:
  • 0

#38 blackhawkrobbo

blackhawkrobbo

    GMC Member

  • GMC Member
  • 266 posts

Posted 16 October 2011 - 03:50 PM

I am just wondering, can you have a .exe with the .39dll and connect it to a html5 server using the 39js?

So can you host a server on a webpage and have exe's connect to it? :ninja:


:whistle:

You can't directly connect to a GM server running 39dll as socket.io uses websockets and doesn't allow raw tcp connections. However i'm looking into 2 options to make this possible. 1) modifying the 39dll to use websockify which translates websockets to normal socket traffic 2) rewriting 39dll as a websocket server.
Which both would require you to use a custom dll rather than plain 39dll, option 1 would potentially allow both players from gmhtml5 and normal gm to connect to the same server, whereas number 2 wouldn't (well unless they also connected over websockets).

Currently you have to rewrite your server into javascript and run on node.js, currently i'm writing code to allow gmhtml5 servers to run in node.js, so no rewrite is required.

But I do realise that node.JS isn't ideal for everyone and will also look into a php websocket server (which will require you to write all the server code in php). But it is worth mentioning the only advantage of this is it allows you to write in php, you can't just upload to a shared hosting service and expect it to work.

Its also worth mentioning that there are Java, Go, Perl, Ruby, Erlang and Python versions of socket.io which you can already use to write servers for your gmhtml5 games.


  • 0

#39 Schalk

Schalk

    GMC Member

  • GMC Member
  • 487 posts
  • Version:GM:HTML5

Posted 17 October 2011 - 12:26 AM

"Chrome dev build 15.0.874.0 supports binary data and close reason and code."
  • 0

#40 Demion

Demion

    GMC Member

  • GMC Member
  • 46 posts

Posted 31 October 2011 - 11:38 AM

I think you can use websockify to "translate" websocket traffic to winsocket normal traffic. Only you need to port it to win32 and I think youll be able to use it with 39dll or selfmade server on real programming language. Now I personally working on it. If I made some progress I'll post here. Good luck.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users