I'm currently creating a simultaneous turn based card game in which two players play cards in three lanes to determine who wins points in these lanes.
I've been struggling this past week trying to think of a good way to handle my game board on the nodejs server. The problem I'm having is that the game board consists of 3 lanes and 5 rows in a 2D array (I.E. indexs 0,0 to 2,4). When Player A plays a card to 0,0 on their screen it goes to 0,0 on the server, the problem then comes Player B plays a card in 0,0 locally but it translates to 2,4 on the server.
My question is, is there a better server game board pattern that enables a cleaner structure than to specifically make a playerA and B on my server and have a playerId tied to every call to know whether or not to invert the co-ordinates? If there is no better way, is it better to do the conversion on the client or server side? I.E. after matchmaking will the server tell each client if they are playerA or B or will the server just keep track of it?
Also, less important, but if in the future I wanted to add new gamemodes that support x number more players how will this pattern scale upwards?