js-game-server icon indicating copy to clipboard operation
js-game-server copied to clipboard

Write the shims.server

Open aurium opened this issue 11 years ago • 2 comments

That must to work sooner as possible!

aurium avatar Aug 13 '14 02:08 aurium

I think we have a problem here.

All games should be able to run without the sandbox... The current design makes things really complicated. Last year, every server-side game had to serve its files using http and fs.

Here is a snippet from last year winning entry:

var fs = require('fs');
var app = require('http').createServer(handler),
    io = require('socket.io').listen(app);

function handler(req, res) {
  fs.readFile(/* ... */);
  /* ... */
}

So, should we serve game files or let games do it? If we serve the files then the game will not be runnable in standalone...

ooflorent avatar Aug 13 '14 08:08 ooflorent

Well, we can consider this year the environment is not node itself, but this sandbox.

I believe the sandbox-io may be called by require('socket.io') inside the sandbox, also the same to the http and any shimed module... but that was not planned before. :-/

Can you implement it too on the sandboxer? So the sandbox and real node will not be so different.

aurium avatar Aug 13 '14 12:08 aurium