News for hackers. Stuff that matters.

lukegt

Re:Thanks netgames.io for endless hours of fun on Sunday April 12, 2020 @05:32AM (#22847013)
I'm the creator of netgames.io, very glad to hear you've enjoyed yourself :). I'd be happy to share a few details, but it's far from a shining beacon of best practices.

At the moment it's a single node.js server using socket.io for communication between clients and the server. The server holds the game state completely in memory, which is updated in response to game state changes sent by each client. The single-threadedness of node.js serialises all these changes to form a globally consistent game state, which is pushed wholesale to clients whenever it changes. Clients are stateless (almost), rendering only what the game state dictates. There's no database or user accounts, everyone just has a UUID assigned to them.

I've seen a large increase in traffic due to the current pandemic (142k users over the last 28 days, about 40x the norm), which has put a lot of stress on my little AWS micro (sorry about the outages). I've made a lot of performance fixes but ultimately I'll have to make this scale across multiple servers if growth continues. Current plan is to start games on whatever server they land on (load-balanced), and have a master task which knows what games are being played on what servers for the purpose of game discovery and room code collisions.

Oh and because I was a thoroughly mislead individual when I first wrote it, it's largely written in CoffeeScript... slowly migrating to Typescript :)

Re:Play social games with friends over Zoom on Wednesday April 08, 2020 @07:03AM (#22811803)
Ah, must've been the lack of a trailing slash in the OP's link. Fixed now :)
Re:Play social games with friends over Zoom on Wednesday April 08, 2020 @06:58AM (#22811784)
What browser and OS are you using? The links are working in all the desktop browsers I have a hold of.
Re:I've Just Liberated My Modules on Wednesday March 23, 2016 @12:19AM (#11342132)
I like how npm even encourages you to create packages in place of the "liberated" ones when you try to visit their now missing pages:

https://www.npmjs.com/package/abril-fatface

  abril-fatface will be yours. Oh yes, abril-fatface will be yours.

  mkdir abril-fatface
  cd abril-fatface
  npm init
  # work your magic…
  npm publish