Changeset aee0634 in network-game
- Timestamp:
- Oct 31, 2014, 1:11:45 AM (10 years ago)
- Branches:
- master
- Children:
- 5037b4b
- Parents:
- c666518
- Location:
- server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
server/DataAccess.cpp
rc666518 raee0634 135 135 } 136 136 137 // need to make sure this list is freed138 // since we need to create a DataAccess class139 // when calling these functions,140 // we could free this list in the destructor141 list<Player*>* DataAccess::getPlayers()142 {143 // This method doesn't seem to ever get used. Decide whether it's actually needed144 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 player160 }161 162 mysql_free_result(result);163 164 return lstPlayers;165 }166 167 137 bool DataAccess::verifyPassword(string password, string encrypted) 168 138 { -
server/DataAccess.h
rc666518 raee0634 17 17 18 18 Player* getPlayer(string username); 19 list<Player*>* getPlayers();20 19 bool verifyPassword(string encrypted, string password); 21 20 int insertPlayer(string username, string password, Player::PlayerClass playerClass);
Note:
See TracChangeset
for help on using the changeset viewer.