Changeset 233e736 in network-game


Ignore:
Timestamp:
Sep 27, 2013, 6:56:04 PM (11 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
master
Children:
a6fe73d
Parents:
d519032
Message:

Fixed a client-side map loading bug

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • client/Client/main.cpp

    rd519032 r233e736  
    856856               cout << "Game name: " << gameName << endl;
    857857               
    858                game = new Game(gameName);
    859 
     858               game = new Game(gameName, "../../data/map.txt");
     859
     860               /*
    860861               state = STATE_NEW_GAME;
    861862
     
    864865
    865866               msgProcessor.sendMessage(&msgTo, sock, &server, &outputLog);
     867               */
    866868
    867869               break;
  • common/Game.cpp

    rd519032 r233e736  
    1111}
    1212
    13 Game::Game(string name) {
     13Game::Game(string name, string filepath) {
    1414   this->id = 0;
    1515   this->name = name;
    1616   this->blueScore = 0;
    1717   this->redScore = 0;
    18    this->worldMap = WorldMap::loadMapFromFile("../data/map.txt");
     18   this->worldMap = WorldMap::loadMapFromFile(filepath);
    1919}
    2020
  • common/Game.h

    rd519032 r233e736  
    3030public:
    3131   Game();
    32    Game(string name);
     32   Game(string name, string filepath);
    3333
    3434   ~Game();
  • common/WorldMap.cpp

    rd519032 r233e736  
    124124   bool foundObject = false;
    125125
    126    cout << "Searching for obbject to update" << endl;
     126   cout << "Searching for object to update" << endl;
    127127   switch (t) {
    128128   case WorldMap::OBJECT_BLUE_FLAG:
     
    198198   ifstream file(filename.c_str());
    199199
     200   cout << "Trying to open file: " << filename << endl;
     201
    200202   if (file.is_open())
    201203   {
     204      cout << filename << " opened successfully" << endl;
     205
    202206      string line;
    203207      int width, height;
     
    299303      }
    300304      file.close();
     305      cout << filename << " closed" << endl;
    301306   }
    302307   else
    303308      cout << "Could not open the file" << endl;
     309
     310   cout << "Finished file processing" << endl;
    304311
    305312   return m;
Note: See TracChangeset for help on using the changeset viewer.