Body: <p>I'm looking for advice on how to implement online chess move validation using a winboard chess engine. I am creating a mobile battle chess game in Unity 2020.3. Right now I have the possible moves for each player, castle rights, check status, etc being generated by an <a href="https://www.chessprogramming.org/NoraGrace" rel="nofollow noreferrer">open source C# chess engine</a>.  I chose this engine because it's written in C# and the code could be directly included in my Unity Project. I successfully wrote my own code that connects this chess engine to a 3D battle chess game.</p>
  <p><strong>How the game works</strong> (<a href="https://youtu.be/Hd-LO8a4Ut0" rel="nofollow noreferrer">video preview</a>):</p>
  <ol>
  <li>A piece is selected by the player clicking it with their mouse or tapping the screen.</li>
  <li>The possible moves for the current board are calculated by the chess engine.</li>
  <li>I use the possible move indexes to show possible move highlights.</li>
  <li>When a player makes one of these possible moves,  the move is applied on the chess engine.</li>
  <li>It becomes the other player's turn.</li>
  </ol>
  <p><em>I have some custom code to run player animations, based on the kind of move (ex. an attack animation runs when a piece is captured). I also show have screens that show when it's time for a promotion, a player is in check, or the game is over.</em></p>
  <p>I'd like to somehow make the process of calculating possible moves and applying moves to be done on a server.  My goal is to protect from players sending illegal moves to the board and breaking the game.</p>
  <p>How would you recommend I approach this problem? This is the last thing I need to turn this game into an enjoyable online experience. I just lack the crucial skill of understanding how to make this game online.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-24T22:05:49.767Z
Comments.Text: Welcome to our community! Thank you for making the effort of asking this question but I don't think it's within the scope of our site. It doesn't look like a chess-related problem at all
Comments.UserDisplayName: David
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-05-25T19:34:47.677Z
Comments.Text: What do you mean by validation? If you mean cheat detection, this is probably on-topic. If you mean legal move detection, it's a coding problem (and seems a trivial one: just generate the legal moves and check the proposed move is in that set...)
Comments.UserDisplayName: Mobeus Zoom
Tags: <engines><rules><software><cheating><windows>
Title: How to validate chess moves with a server? Winboard and Unity 2020.3
ThreadText: # How to validate chess moves with a server? Winboard and Unity 2020.3
  
  (Asked by: username_0 on 2021-05-23)
  
  I'm looking for advice on how to implement online chess move validation using a winboard chess engine. I am creating a mobile battle chess game in Unity 2020.3. Right now I have the possible moves for each player, castle rights, check status, etc being generated by an [open source C# chess engine](https://www.chessprogramming.org/NoraGrace).  I chose this engine because it's written in C# and the code could be directly included in my Unity Project. I successfully wrote my own code that connects this chess engine to a 3D battle chess game.
  
  **How the game works** ([video preview](https://youtu.be/Hd-LO8a4Ut0)):
  
  1. A piece is selected by the player clicking it with their mouse or tapping the screen.
  2. The possible moves for the current board are calculated by the chess engine.
  3. I use the possible move indexes to show possible move highlights.
  4. When a player makes one of these possible moves, the move is applied on the chess engine.
  5. It becomes the other player's turn.
  
  *I have some custom code to run player animations, based on the kind of move (ex. an attack animation runs when a piece is captured). I also show have screens that show when it's time for a promotion, a player is in check, or the game is over.*
  
  I'd like to somehow make the process of calculating possible moves and applying moves to be done on a server. My goal is to protect from players sending illegal moves to the board and breaking the game.
  
  How would you recommend I approach this problem? This is the last thing I need to turn this game into an enjoyable online experience. I just lack the crucial skill of understanding how to make this game online.
  
  **Tags:** engines, rules, software, cheating, windows
  
  > **Comments:**
  > **username_1**: Welcome to our community! Thank you for making the effort of asking this question but I don't think it's within the scope of our site. It doesn't look like a chess-related problem at all  
  > **username_2**: What do you mean by validation? If you mean cheat detection, this is probably on-topic. If you mean legal move detection, it's a coding problem (and seems a trivial one: just generate the legal moves and check the proposed move is in that set...)  
  
  ---
  
  ## 0 answers
  
  