- Timestamp:
- Jan 25, 2014, 6:50:46 PM (11 years ago)
- Branches:
- master
- Children:
- 1e250bf, 5c7f28d
- Parents:
- 1ee0ffa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/server.cpp
r1ee0ffa r9ee50ce 44 44 // from used to be const. Removed that so I could take a reference 45 45 // and use it to send messages 46 void processMessage(const NETWORK_MSG& clientMsg, struct sockaddr_in& from, MessageProcessor& msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, unsigned int& unusedPlayerId );46 void processMessage(const NETWORK_MSG& clientMsg, struct sockaddr_in& from, MessageProcessor& msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, unsigned int& unusedPlayerId, ofstream& outputLog); 47 47 48 48 void updateUnusedPlayerId(unsigned int& id, map<unsigned int, Player*>& mapPlayers); … … 231 231 if (msgProcessor.receiveMessage(&clientMsg, &from) >= 0) 232 232 { 233 processMessage(clientMsg, from, msgProcessor, mapPlayers, mapGames, unusedPlayerId );233 processMessage(clientMsg, from, msgProcessor, mapPlayers, mapGames, unusedPlayerId, outputLog); 234 234 235 235 cout << "Finished processing the message" << endl; … … 256 256 } 257 257 258 void processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, unsigned int& unusedPlayerId )258 void processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, unsigned int& unusedPlayerId, ofstream& outputLog) 259 259 { 260 260 NETWORK_MSG serverMsg; … … 759 759 default: 760 760 { 761 // probably want to log the error rather than sending a chat message, 762 // especially since chat isn't currently visible on all screens 763 764 serverMsg.type = MSG_TYPE_CHAT; 765 strcpy(serverMsg.buffer, "Server error occured. Report this please."); 761 outputLog << "Received unknown message of type " << clientMsg.type << endl; 766 762 767 763 break;
Note:
See TracChangeset
for help on using the changeset viewer.