source: network-game/server/DataAccess.h@ 95d7add

Last change on this file since 95d7add was 521c88b, checked in by dportnoy <dmp1488@…>, 11 years ago

Upon player registration, the server stores the selected player class and no longer generates a random player class every time the player logs in

  • Property mode set to 100644
File size: 714 bytes
RevLine 
[36082e8]1#ifndef _DATA_ACCES_H
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
[521c88b]18 int insertPlayer(string username, string password, Player::PlayerClass playerClass);
[b128109]19 int updatePlayer(string username, string password);
[59061f6]20
[b128109]21 Player* getPlayer(string username);
22 list<Player*>* getPlayers();
23 bool verifyPassword(string encrypted, string password);
[59061f6]24
25 int insert(string table, string rows, string values);
[b128109]26 int update(string table, string values, string where);
[59061f6]27 MYSQL_RES *select(string table, string filter);
28
29private:
30 MYSQL *connection, mysql;
[36082e8]31};
32
33#endif
Note: See TracBrowser for help on using the repository browser.