Changeset aee0634 in network-game


Ignore:
Timestamp:
Oct 31, 2014, 1:11:45 AM (10 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
5037b4b
Parents:
c666518
Message:

Remove DataAccess::getPlayers() since it isn't used

Location:
server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • server/DataAccess.cpp

    rc666518 raee0634  
    135135}
    136136
    137 // need to make sure this list is freed
    138 // since we need to create a DataAccess class
    139 // when calling these functions,
    140 // we could free this list in the destructor
    141 list<Player*>* DataAccess::getPlayers()
    142 {
    143    // This method doesn't seem to ever get used. Decide whether it's actually needed
    144    MYSQL_RES *result;
    145    MYSQL_ROW row;
    146 
    147    result = select("users", "");
    148 
    149    if (result == NULL) {
    150       cout << mysql_error(connection) << endl;
    151       return NULL;
    152    }
    153 
    154    list<Player*>* lstPlayers = new list<Player*>();
    155    while ( ( row = mysql_fetch_row(result)) != NULL ) {
    156       cout << row[0] << ", " << row[1] << ", " << row[2] << endl;
    157       lstPlayers->push_back(new Player(row[1], row[2]));
    158 
    159       // need to assign all the other db values to the player
    160    }
    161 
    162    mysql_free_result(result);
    163 
    164    return lstPlayers;
    165 }
    166 
    167137bool DataAccess::verifyPassword(string password, string encrypted)
    168138{
  • server/DataAccess.h

    rc666518 raee0634  
    1717
    1818   Player* getPlayer(string username);
    19    list<Player*>* getPlayers();
    2019   bool verifyPassword(string encrypted, string password);
    2120   int insertPlayer(string username, string password, Player::PlayerClass playerClass);
Note: See TracChangeset for help on using the changeset viewer.