title: Most seen newbie mistakes in multiplayer/online game programming?
body: <p>What kind of newbie mistakes you've seen and what are the cures?</p>
  
  <p>One which occurs again and again is client is not checked any way against server.</p>
  
  <p>For example:</p>
  
  <ul>
  <li>User decompiles flash game source or listens to network traffic and sees where high score data is going and sends bogus high scores there not even playing the game.</li>
  <li>User uses trainer and gets item which may even not appear in current level. This sent to server like "client X got item Y" and server just accepts that.</li>
  </ul>
  
  <p>The simple cure is of course handling gaming client only as API to the server. Then user can use trainers and other memory manipulations as much they like but server just says you can't do it. Think server as a database where you can query things with game rules on top of it.</p>
  
  <p>For example</p>
  
  <ul>
  <li>Client: starts game </li>
  <li>Client: connects to server</li>
  <li>Client: queries amount of available money from server</li>
  <li>User: enables trainer which sets money to infinite </li>
  <li>Client: server.buyItem('very expensive')</li>
  <li>Server: Checks gamestate (user can buy things now). Checks player[0].money -> no bonus.</li>
  <li>Client: server.buyItem('can get this')</li>
  <li>Server: Checks gamestate (user can buy things now). Checks player[0].money, ok. player[0].items.add('can get this') which will reduce it's cost from player[0].money. Then inform client send(player[0], 'items', 'can get this'); send(player[0], 'money', player[0].money).</li>
  </ul>
  
  <p>The other way is to record client's movements and send that to highscore server where server plays it. Of course this can lead to that that record is very big.</p>