Phaser Multiplayer Card Game

I saw tutorial for multiplayer card game based on socket io.
I want to create server side logic like dealing cards, getting new ones.
But if i use socket io or colyseus framework (better option) i cant hide cards from other player because they will both get drawn cards(because they will receive message on ).
My question is can i somehow only send data to specific client or hide date from other clients. They all have same method for receiving data and is not good for client one to see cards of client two :slight_smile:

Having the card deal logic on the server, I don’t understand why you have to send all the cards to all the players. The best thing would be to send each player their own cards.
If you are forced to send all the information to all players, the only thing I can think of is that:

  • each client generates a symmetric password that only he knows and sends it to the server
  • the server encrypts each card for each client with the corresponding password
1 Like

Sorry i want to specific client get his cards.
So i dint want general emit that will all clients receive.
Is possible when we deal cards to send each user his cards?
In colyseus i can see onChange or broadcast but nothing to send data to specific user

I have no experience with colyseus, but I see this in the doc to send messages to a client: https://docs.colyseus.io/server/client

client.send ("powerup", {kind: "ammo"});
1 Like