Last change
on this file since 248e3c1 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
|
Line | |
---|
1 | #ifndef _DATA_ACCES_H
|
---|
2 | #define _DATA_ACCESS_H
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 | #include <list>
|
---|
6 |
|
---|
7 | #include <mysql/mysql.h>
|
---|
8 |
|
---|
9 | #include "../common/Player.h"
|
---|
10 |
|
---|
11 | using namespace std;
|
---|
12 |
|
---|
13 | class DataAccess {
|
---|
14 | public:
|
---|
15 | DataAccess();
|
---|
16 | ~DataAccess();
|
---|
17 |
|
---|
18 | int insertPlayer(string username, string password, Player::PlayerClass playerClass);
|
---|
19 | int updatePlayer(string username, string password);
|
---|
20 |
|
---|
21 | Player* getPlayer(string username);
|
---|
22 | list<Player*>* getPlayers();
|
---|
23 | bool verifyPassword(string encrypted, string password);
|
---|
24 |
|
---|
25 | int insert(string table, string rows, string values);
|
---|
26 | int update(string table, string values, string where);
|
---|
27 | MYSQL_RES *select(string table, string filter);
|
---|
28 |
|
---|
29 | private:
|
---|
30 | MYSQL *connection, mysql;
|
---|
31 | };
|
---|
32 |
|
---|
33 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.