source:
network-game/server/DataAccess.h@
8c74150
| Last change on this file since 8c74150 was b128109, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 681 bytes | |
| Rev | Line | |
|---|---|---|
| [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 | |
| 11 | using namespace std; | |
| 12 | ||
| [36082e8] | 13 | class DataAccess { |
| 14 | public: | |
| 15 | DataAccess(); | |
| 16 | ~DataAccess(); | |
| 17 | ||
| [59061f6] | 18 | int insertPlayer(string username, string password); |
| [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 | ||
| 29 | private: | |
| 30 | MYSQL *connection, mysql; | |
| [36082e8] | 31 | }; |
| 32 | ||
| 33 | #endif |
Note:
See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](/medieval/chrome/site/your_project_logo.png)