🌐🔥 Network multiplayer and messaging for CoronaSDK, Moai, Gideros, LÖVE & Defold
Lua JavaScript PHP Batchfile Shell
Switch branches/tags
Nothing to show
Clone or download
tylerR94 and Overtorment Replacing deprecated buffer() with buffer.alloc()
This is a pretty simple change. buffer() has been deprecated, and the parameter being used already for buffer() in the original node.js file is fitting for the recommended command to use instead which is buffer.alloc().
Latest commit ae6c757 Jun 28, 2018
Permalink
Failed to load latest commit information.
client Added Defold version May 9, 2018
server Replacing deprecated buffer() with buffer.alloc() Jun 28, 2018
.gitignore Added Defold version May 9, 2018
README.md Update README.md May 21, 2018
run-tests.sh TST Nov 15, 2017

README.md

NoobHub

JavaScript Style Guide

OpenSource multiplayer and network messaging for CoronaSDK, Moai, Gideros, LÖVE & Defold

Battle-tested and production ready. Handling thousands of CCU (concurrent users), serving hundreds of thousands multiplayer games daily, routing hundreds of messages per second, with months of uptime.

  • Connections are routed through socket server with minimum latency, ideal for action games.
  • Simple interface. Publish/subscribe paradigm in action.
  • Server written on blazing fast Nodejs.
  • Zero dependency. Works out of the box, no NPM ecosystem required.
  • Socket connections, works great through any NAT (local area network), messages delivery is reliable and fast.
  • Low CPU and memory footprint

Repo includes server code (so you can use your own server) and CoronaSDK/Moai/Gideros/LÖVE client. More clients to come. You can test on my server, credentials are hardcoded in demo project!

Lua code may serve as an example of how LuaSocket library works.

How to use it

START SERVER

        $ nodejs node.js

INITIALIZE

        hub = noobhub.new({ server = "127.0.0.1"; port = 1337; });

SUBSCRIBE TO A CHANNEL AND RECEIVE CALLBACKS WHEN NEW JSON MESSAGES ARRIVE

        hub:subscribe({
          channel = "hello-world";
        	callback = function(message)

        		if(message.action == "ping")   then
        			print("Pong!")
        		end;

        	end;
        });

SAY SOMETHING TO EVERYBODY ON THE CHANNEL

        hub:publish({
            message = {
                action  =  "ping",
                timestamp = system.getTimer()
            }
        });

Clients

  • CoronaSDK
  • Gideros
  • Moai
  • LÖVE
  • Node.js
  • PHP (debug console only)

Tests

Simple acceptance test uses Nodejs client to test the server itself:

    $ ./run-tests.sh
    starting Noobhub server...
    NoobHub on :::1337
    running tests...
    tests ok

Getting ready for production use

If you expect more than 1000 concurrent connections, you should increase limits on your server (max open file descriptors, max TCP/IP connections) and optionally fine-tune your server's TCP/IP stack. To make sure server process stays alive you migh want to use tools such as forever.js or supervisord.

Authors

  • Igor Korsakov
  • Sergii Tsegelnyk

Licence

WTFPL

Official discussion thread