What is the best method to make NoobHub simple random matchmaking (2 players)?
I have tried with simple messaging and it works but it has problem when two players enters in the same time, it then creates two separate connections, one for each player instead of only one.
When there is small delay between players entering matchmaking screen, everything works OK.
Somebody help?
Comments
1) The client app subscribe to "public" channel
2) I have modified node.js file to create a room (rooms hash in Javascript) or connect to players in the same room when this first message is receive. The variable socket.connection_id is perfect to identify a connected player.
3) Every client receives a special message with the connectionId of each players.
4) Now every player knows the channel to publish messages.
https://github.com/huytd/node-js-game-server
It provides some room creation support but you should create your own cliente based on lua socket and Noobhub client.