简体   繁体   中英

Socket io Multiple Game Rooms

I'm working on a multiplayer chess website with different rooms and connecting two players, all through Socket IO and Node JS something similar to http://www.retichess.com/play/NjUwMS41ODM1SERrSEVt/30/0 . As for now it looks like this http://www.group7port2.azurewebsites.net

The problem i'm having is not understanding how to establish the connection between both players as they do on RetiChess and their URL Generation.

Where should I start looking at? Thanks!

If you read through Socket.IO documentation, you'll learn more about the Room concept. There is never such a thing as direct player connection. There is always the server in between.

Sharing an URL allows a player to join another player's room and that's it!

Your job is to be able to send data from one player to the other, while they are in the same socket.IO room!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM