Changeset c941e07 in network-game for server/server.cpp


Ignore:
Timestamp:
Nov 11, 2014, 1:05:14 AM (10 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
48801af
Parents:
a9a1295
Message:

Only load the db settings once and actually use the loaded settings instead of the hard-coded ones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    ra9a1295 rc941e07  
    4343// from used to be const. Removed that so I could take a reference
    4444// and use it to send messages
    45 void processMessage(const NETWORK_MSG& clientMsg, struct sockaddr_in& from, MessageProcessor& msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, ofstream& outputLog);
     45void processMessage(const NETWORK_MSG& clientMsg, struct sockaddr_in& from, MessageProcessor& msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, DataAccess& da, ofstream& outputLog);
    4646
    4747Player *findPlayerByName(map<unsigned int, Player*> &m, string name);
     
    256256      if (msgProcessor.receiveMessage(&clientMsg, &from) >= 0)
    257257      {
    258          processMessage(clientMsg, from, msgProcessor, mapPlayers, mapGames, outputLog);
     258         processMessage(clientMsg, from, msgProcessor, mapPlayers, mapGames, da, outputLog);
    259259
    260260         cout << "Finished processing the message" << endl;
     
    281281}
    282282
    283 void processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, ofstream& outputLog)
     283void processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player*>& mapPlayers, map<string, Game*>& mapGames, DataAccess& da, ofstream& outputLog)
    284284{
    285285   NETWORK_MSG serverMsg;
    286    DataAccess da;
    287286
    288287   cout << "Inside processMessage" << endl;
Note: See TracChangeset for help on using the changeset viewer.