source: network-game/server/DataAccess.h@ ace001a

Last change on this file since ace001a was aee0634, checked in by Dmitry Portnoy <dmp1488@…>, 10 years ago

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

  • Property mode set to 100644
File size: 850 bytes
RevLine 
[53643ca]1#ifndef _DATA_ACCESS_H
[36082e8]2#define _DATA_ACCESS_H
3
[59061f6]4#include <string>
[b128109]5#include <list>
[59061f6]6
7#include <mysql/mysql.h>
8
[edfd1d0]9#include "../common/Player.h"
[59061f6]10
11using namespace std;
12
[36082e8]13class DataAccess {
14public:
15 DataAccess();
16 ~DataAccess();
17
[b128109]18 Player* getPlayer(string username);
19 bool verifyPassword(string encrypted, string password);
[53643ca]20 int insertPlayer(string username, string password, Player::PlayerClass playerClass);
[84754c0]21 int updatePlayer(Player* player);
[53643ca]22
23 int* getPlayerRecord(int playerId);
24 int** getPlayerGameHistory(int playerId, unsigned int& numGames);
25 int saveGameHistory(int playerId, int team, int blueScore, int redScore);
[59061f6]26
27 int insert(string table, string rows, string values);
[b128109]28 int update(string table, string values, string where);
[59061f6]29 MYSQL_RES *select(string table, string filter);
30
31private:
32 MYSQL *connection, mysql;
[36082e8]33};
34
35#endif
Note: See TracBrowser for help on using the repository browser.