Search code examples
javaserverclientpoker

Client server java holdem game


Hi I'm making a simple poker texas holdem with client-server functionality. My problem is that I'm sending whole list of players to client (with info like bet amount, who has dealer button, what cards they have etc.).

In game I print only cards that belong to specific player. Should I even send cards of other players?

I don't print them but client still has info about them, so it may be some security issue. I'm new to implementing client-server and I'm not sure if sending info someone shouldn't have is acceptable. If I can't send those card then I would have to send response to each player individually, right now I'm sending it to all of them at once, it's gonna completely change my implementation so I don't want to rush into this. Thanks in advance.


Solution

  • If you don't have any need for other player's cards on the client side then you definitely should not send them. Besides the various issues around being able to access that information in your browser, it's just extra network traffic. You should definitely be sending a response directly to each client, that way you remove the risk of cheating and you only send what each client actually needs which means less traffic.