Subversion Repositories Games.Chess Giants

Rev

Rev 177 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 177 Rev 185
Line 93... Line 93...
93
      field_start = wcsstr (announcement_start, L": "); // reach the first colon+space, that's where the announcement starts
93
      field_start = wcsstr (announcement_start, L": "); // reach the first colon+space, that's where the announcement starts
94
      if (field_start != NULL)
94
      if (field_start != NULL)
95
      {
95
      {
96
         field_start += 2; // skip colon and space
96
         field_start += 2; // skip colon and space
97
         ReadSpannedLine (announcement_text, WCHAR_SIZEOF (announcement_text), field_start); // now format the announcement text well
97
         ReadSpannedLine (announcement_text, WCHAR_SIZEOF (announcement_text), field_start); // now format the announcement text well
98
         Scene_AddAnnouncement (&the_scene, announcement_text); // and put it in place
98
         Scene_AddCCAnnouncement (&the_scene, LOCALIZE (L"ImportantMessage"), announcement_text); // and put it in place
99
      }
99
      }
100
   }
100
   }
101
 
101
 
102
   // now erase the announcement from the recvbuffer, so that it cannot be misinterpreted by further parsing
102
   // now erase the announcement from the recvbuffer, so that it cannot be misinterpreted by further parsing
103
   ERASE_FROM_TO (announcement_start, announcement_end);
103
   ERASE_FROM_TO (announcement_start, announcement_end);
Line 1440... Line 1440...
1440
         Debug_Log (L"===Server tells us that black [resigns|forfeits|loses adjudication]: white wins!===\n");
1440
         Debug_Log (L"===Server tells us that black [resigns|forfeits|loses adjudication]: white wins!===\n");
1441
         the_board.game_state = STATE_WHITEWIN_RESIGNORFORFEIT; // remember game state
1441
         the_board.game_state = STATE_WHITEWIN_RESIGNORFORFEIT; // remember game state
1442
      }
1442
      }
1443
 
1443
 
1444
      // if white player is human, play the victory sound, else, play defeat sound at the center of the board
1444
      // if white player is human, play the victory sound, else, play defeat sound at the center of the board
1445
      Audio_PlaySound (the_board.players[COLOR_WHITE].type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f);
1445
      Audio_PlaySoundAtCenter (the_board.players[COLOR_WHITE].type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
1446
   }
1446
   }
1447
 
1447
 
1448
   // else do the black win ?
1448
   // else do the black win ?
1449
   else if (wcsstr (field_start, L"} 0-1") != NULL)
1449
   else if (wcsstr (field_start, L"} 0-1") != NULL)
1450
   {
1450
   {
Line 1461... Line 1461...
1461
         Debug_Log (L"===Server tells us that white [resigns|forfeits|loses adjudication]: black wins!===\n");
1461
         Debug_Log (L"===Server tells us that white [resigns|forfeits|loses adjudication]: black wins!===\n");
1462
         the_board.game_state = STATE_BLACKWIN_RESIGNORFORFEIT; // remember game state
1462
         the_board.game_state = STATE_BLACKWIN_RESIGNORFORFEIT; // remember game state
1463
      }
1463
      }
1464
 
1464
 
1465
      // if black player is human, play the victory sound, else, play defeat sound at the center of the board
1465
      // if black player is human, play the victory sound, else, play defeat sound at the center of the board
1466
      Audio_PlaySound (the_board.players[COLOR_BLACK].type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f);
1466
      Audio_PlaySoundAtCenter (the_board.players[COLOR_BLACK].type == PLAYER_HUMAN ? SOUNDTYPE_VICTORY : SOUNDTYPE_DEFEAT);
1467
   }
1467
   }
1468
 
1468
 
1469
   // else is it a draw ?
1469
   // else is it a draw ?
1470
   else if (wcsstr (field_start, L"} 1/2-1/2") != NULL)
1470
   else if (wcsstr (field_start, L"} 1/2-1/2") != NULL)
1471
   {
1471
   {
Line 1489... Line 1489...
1489
         Debug_Log (L"===Server tells us it's a draw for another reason: game is a draw===\n");
1489
         Debug_Log (L"===Server tells us it's a draw for another reason: game is a draw===\n");
1490
         the_board.game_state = STATE_DRAW_OTHER; // remember game state
1490
         the_board.game_state = STATE_DRAW_OTHER; // remember game state
1491
      }
1491
      }
1492
 
1492
 
1493
      // play a defeat sound at the center of the board
1493
      // play a defeat sound at the center of the board
1494
      Audio_PlaySound (SOUNDTYPE_DEFEAT, 0.0f, 0.0f, 0.04f);
1494
      Audio_PlaySoundAtCenter (SOUNDTYPE_DEFEAT);
1495
   }
1495
   }
1496
 
1496
 
1497
   // else is it an adjournment ?
1497
   // else is it an adjournment ?
1498
   else if (wcsstr (field_start, L"} *") != NULL)
1498
   else if (wcsstr (field_start, L"} *") != NULL)
1499
   {
1499
   {