- Timestamp:
- Dec 21, 2013, 4:06:44 PM (11 years ago)
- Branches:
- master
- Children:
- 686589c
- Parents:
- b73bc28
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/server.cpp
rb73bc28 rd3efa1a 708 708 } 709 709 710 // send info about existing games to new player 711 map<string, Game*>::iterator itGames; 712 Game* g; 713 int numPlayers; 714 serverMsg.type = MSG_TYPE_GAME_INFO; 715 716 for (itGames = mapGames.begin(); itGames != mapGames.end(); itGames++) 717 { 718 g = itGames->second; 719 numPlayers = g->getNumPlayers(); 720 memcpy(serverMsg.buffer, &numPlayers, 4); 721 strcpy(serverMsg.buffer+4, g->getName().c_str()); 722 if ( msgProcessor.sendMessage(&serverMsg, sock, &from, &outputLog) < 0 ) 723 error("sendMessage"); 724 } 725 710 726 // send the current score 711 727 serverMsg.type = MSG_TYPE_SCORE;
Note:
See TracChangeset
for help on using the changeset viewer.