Last change
on this file since ad5d122 was edfd1d0, checked in by dportnoy <dmp1488@…>, 12 years ago |
Moved the Player class to the common directory, added a position to Player, added a new message type for sending player info, and made the server broadcast player positions everytime it receives and replies to a message
|
-
Property mode
set to
100644
|
File size:
484 bytes
|
Rev | Line | |
---|
[36082e8] | 1 | #ifndef _DATA_ACCES_H
|
---|
| 2 | #define _DATA_ACCESS_H
|
---|
| 3 |
|
---|
[59061f6] | 4 | #include <string>
|
---|
| 5 |
|
---|
| 6 | #include <mysql/mysql.h>
|
---|
| 7 |
|
---|
[edfd1d0] | 8 | #include "../common/Player.h"
|
---|
[59061f6] | 9 |
|
---|
| 10 | using namespace std;
|
---|
| 11 |
|
---|
[36082e8] | 12 | class DataAccess {
|
---|
| 13 | public:
|
---|
| 14 | DataAccess();
|
---|
| 15 | ~DataAccess();
|
---|
| 16 |
|
---|
[59061f6] | 17 | int insertPlayer(string username, string password);
|
---|
| 18 |
|
---|
| 19 | Player *getPlayer(string username);
|
---|
| 20 | int printPlayers();
|
---|
| 21 |
|
---|
| 22 | int insert(string table, string rows, string values);
|
---|
| 23 | MYSQL_RES *select(string table, string filter);
|
---|
| 24 |
|
---|
| 25 | private:
|
---|
| 26 | MYSQL *connection, mysql;
|
---|
[36082e8] | 27 | };
|
---|
| 28 |
|
---|
| 29 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.