Changeset 0678d60 in network-game for server


Ignore:
Timestamp:
Jan 22, 2014, 1:31:27 AM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
06fc7f7
Parents:
204edcf
Message:

All server warnings have been fixed and the WorldMap class has a new method to create flags (and, in the future, other objects) based on structures present on the map

Location:
server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • server/DataAccess.cpp

    r204edcf r0678d60  
    177177MYSQL_RES *DataAccess::select(string table, string filter)
    178178{
    179    MYSQL_RES *result;
    180179   int query_state;
    181180   ostringstream oss;
  • server/server.cpp

    r204edcf r0678d60  
    589589            // add flag objects to the map
    590590            WorldMap* m = g->getMap();
    591             for (int y=0; y<m->height; y++) {
    592                for (int x=0; x<m->width; x++) {
    593                   switch (m->getStructure(x, y)) {
    594                      case WorldMap::STRUCTURE_BLUE_FLAG:
    595                         m->addObject(WorldMap::OBJECT_BLUE_FLAG, x*25+12, y*25+12);
    596                         break;
    597                      case WorldMap::STRUCTURE_RED_FLAG:
    598                         m->addObject(WorldMap::OBJECT_RED_FLAG, x*25+12, y*25+12);
    599                         break;
    600                      case WorldMap::STRUCTURE_NONE:
    601                         break;
    602                   }
    603                }
    604             }
     591            m->createObjectsFromStructures();
    605592
    606593            serverMsg.type = MSG_TYPE_JOIN_GAME_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.