   initializeHardwarePeripherals();
   // 3 - Show the welcome message
   doWelcome();  
-  // 4 - Find other player
+  // 4 - Register the player in the server
+  registerPlayer();
+  // 5 - Find other player
   display.printText("Waiting for players...", 6, 1, GREEN);
-  String result = findPlayer();
-  start_turn = result[4];
-  rival_id = result.substring(0,4);
+  findPlayer();
 }
 
 void loop() {
   delay(200);
   boolean waitForMove = true;
   
-  if ((turn > 0) || (turn == 0 && start_turn=='0')){
+  if ((turn > 0) || (turn == 0 && start_turn=="0")){
     // ************************************************************************
     // ******** Player turn ***************************************************
     // ************************************************************************

// Rival board id
String rival_id = "0";
// Who starts playing: 0 the player, 1 the rival.
char start_turn = '2';

// Current turn
int turn = 0;

  doWelcome();  
  
  // Find other player
  findPlayer();
}


