Mania++
 All Classes Functions Variables Pages
CallBackManager.h
1 #ifndef CALLBACKMANAGER_H_
2 #define CALLBACKMANAGER_H_
3 
4 #include <string>
5 #include <map>
6 #include <vector>
7 
8 #include <cppconn/driver.h>
9 #include <cppconn/exception.h>
10 #include <cppconn/resultset.h>
11 #include <cppconn/statement.h>
12 #include <cppconn/prepared_statement.h>
13 
14 #include "../Commands/CommandManager.h"
15 #include "../Events/EventManager.h"
16 #include "../GbxRemote/GbxRemote.h"
17 #include "../GbxRemote/Message/GbxMessage.h"
18 #include "../GbxRemote/Parameters/GbxParameters.h"
19 #include "../Maps/MapList.h"
20 #include "../Objects/Map.h"
21 #include "../Objects/Player.h"
22 #include "../Utils/Logging.h"
23 #include "../Utils/Time.h"
24 
25 //* CallBackManager
30 {
31 public:
44  CallBackManager(GbxRemote* serverPtr, CommandManager* commandManagerPtr, EventManager* eventManagerPtr, sql::Connection* databasePtr, std::map<std::string, Player>* playerList, MapList* mapList);
45 
52  void HandleCallBack(std::string methodName, std::vector<GbxResponseParameter> parameters);
53 
59  void HandlePlayerConnect(std::vector<GbxResponseParameter> parameters);
60 
66  void HandlePlayerDisconnect(std::vector<GbxResponseParameter> parameters);
67 
73  void HandlePlayerChat(std::vector<GbxResponseParameter> parameters);
74 
80  void HandlePlayerManialinkPageAnswer(std::vector<GbxResponseParameter> parameters);
81 
87  void HandleEcho(std::vector<GbxResponseParameter> parameters);
88 
94  void HandleBeginMatch(std::vector<GbxResponseParameter> parameters);
95 
101  void HandleEndMatch(std::vector<GbxResponseParameter> parameters);
102 
108  void HandleBeginMap(std::vector<GbxResponseParameter> parameters);
109 
115  void HandleEndMap(std::vector<GbxResponseParameter> parameters);
116 
122  void HandleStatusChanged(std::vector<GbxResponseParameter> parameters);
123 
129  void HandlePlayerCheckpoint(std::vector<GbxResponseParameter> parameters);
130 
136  void HandlePlayerFinish(std::vector<GbxResponseParameter> parameters);
137 
143  void HandlePlayerIncoherence(std::vector<GbxResponseParameter> parameters);
144 
150  void HandleBillUpdated(std::vector<GbxResponseParameter> parameters);
151 
157  void HandleMapListModified(std::vector<GbxResponseParameter> parameters);
158 
164  void HandlePlayerInfoChanged(std::vector<GbxResponseParameter> parameters);
165 
171  void HandleVoteUpdated(std::vector<GbxResponseParameter> parameters);
172 
173 private:
177  sql::Connection* database;
178  std::map<std::string, Player>* players;
180 };
181 
182 #endif // CALLBACKMANAGER_H_
CommandManager * commands
Contains the command manager.
Definition: CallBackManager.h:175
void HandleStatusChanged(std::vector< GbxResponseParameter > parameters)
Handles StatusChanged callback.
Definition: CallBackManager.cpp:303
void HandleMapListModified(std::vector< GbxResponseParameter > parameters)
Handles MapListModified callback.
Definition: CallBackManager.cpp:351
EventManager * events
Contains the event manager.
Definition: CallBackManager.h:176
void HandlePlayerIncoherence(std::vector< GbxResponseParameter > parameters)
Handles PlayerIncoherence callback.
Definition: CallBackManager.cpp:333
void HandleEcho(std::vector< GbxResponseParameter > parameters)
Handles Echo callback.
Definition: CallBackManager.cpp:230
Handles communication with the ManiaPlanet server.
Definition: GbxRemote.h:20
void HandleCallBack(std::string methodName, std::vector< GbxResponseParameter > parameters)
Handles callback (updates lists, calls plugin functions).
Definition: CallBackManager.cpp:14
void HandlePlayerInfoChanged(std::vector< GbxResponseParameter > parameters)
Handles PlayerInfoChanged callback.
Definition: CallBackManager.cpp:361
CallBackManager(GbxRemote *serverPtr, CommandManager *commandManagerPtr, EventManager *eventManagerPtr, sql::Connection *databasePtr, std::map< std::string, Player > *playerList, MapList *mapList)
Definition: CallBackManager.cpp:3
MapList * maps
Contains the list of players currently on the server.
Definition: CallBackManager.h:179
void HandlePlayerChat(std::vector< GbxResponseParameter > parameters)
Handles PlayerChat callback.
Definition: CallBackManager.cpp:185
void HandleVoteUpdated(std::vector< GbxResponseParameter > parameters)
Handles VoteUpdated callback.
Definition: CallBackManager.cpp:369
void HandlePlayerFinish(std::vector< GbxResponseParameter > parameters)
Handles PlayerFinish callback.
Definition: CallBackManager.cpp:323
Handles callbacks from the server.
Definition: CallBackManager.h:29
sql::Connection * database
Contains the database connection.
Definition: CallBackManager.h:177
void HandlePlayerManialinkPageAnswer(std::vector< GbxResponseParameter > parameters)
Handles PlayerManialinkPageAnswer callback.
Definition: CallBackManager.cpp:208
void HandleBillUpdated(std::vector< GbxResponseParameter > parameters)
Handles BillUpdated callback.
Definition: CallBackManager.cpp:341
Contains the maplist and a pointer to the current map.
Definition: MapList.h:10
void HandleEndMatch(std::vector< GbxResponseParameter > parameters)
Handles EndMatch callback.
Definition: CallBackManager.cpp:243
std::map< std::string, Player > * players
Contains the list of players currently on the server.
Definition: CallBackManager.h:178
GbxRemote * server
Contains the serverconnection.
Definition: CallBackManager.h:174
void HandleEndMap(std::vector< GbxResponseParameter > parameters)
Handles EndMap callback.
Definition: CallBackManager.cpp:296
void HandlePlayerDisconnect(std::vector< GbxResponseParameter > parameters)
Handles PlayerDisconnect callback.
Definition: CallBackManager.cpp:174
void HandlePlayerConnect(std::vector< GbxResponseParameter > parameters)
Handles PlayerConnect callback.
Definition: CallBackManager.cpp:98
void HandlePlayerCheckpoint(std::vector< GbxResponseParameter > parameters)
Handles PlayerCheckpoint callback.
Definition: CallBackManager.cpp:311
Handles events (callbacks) from server to plugins.
Definition: EventManager.h:15
void HandleBeginMatch(std::vector< GbxResponseParameter > parameters)
Handles BeginMatch callback.
Definition: CallBackManager.cpp:238
void HandleBeginMap(std::vector< GbxResponseParameter > parameters)
Handles BeginMap callback.
Definition: CallBackManager.cpp:286
Manages the chat commands.
Definition: CommandManager.h:14