Mania++
 All Classes Functions Variables Pages
CallBackManager.h
1 #ifndef CALLBACKMANAGER_H_
2 #define CALLBACKMANAGER_H_
3 
4 #include <ctime>
5 #include <string>
6 #include <map>
7 #include <vector>
8 
9 #include <cppconn/driver.h>
10 #include <cppconn/exception.h>
11 #include <cppconn/resultset.h>
12 #include <cppconn/statement.h>
13 #include <cppconn/prepared_statement.h>
14 
15 #include "../Config/Config.h"
16 #include "../Commands/CommandManager.h"
17 #include "../Events/EventManager.h"
18 #include "../GbxRemote/GbxRemote.h"
19 #include "../GbxRemote/Message/GbxMessage.h"
20 #include "../GbxRemote/Parameters/GbxParameters.h"
21 #include "../Maps/MapList.h"
22 #include "../Methods/Structs.h"
23 #include "../Objects/Map.h"
24 #include "../Objects/Player.h"
25 #include "../Utils/Logging.h"
26 #include "../Utils/Time.h"
27 
28 //* CallBackManager
33 {
34 public:
49  CallBackManager(Config* configPtr, GbxRemote* serverPtr, CommandManager* commandManagerPtr, EventManager* eventManagerPtr, sql::Connection* databasePtr, std::map<std::string, Player>* playerList, MapList* mapList, ServerInfo* serverInfoPtr);
50 
57  void HandleCallBack(std::string methodName, std::vector<GbxResponseParameter> parameters);
58 
64  void HandlePlayerConnect(std::vector<GbxResponseParameter> parameters);
65 
71  void HandlePlayerDisconnect(std::vector<GbxResponseParameter> parameters);
72 
78  void HandlePlayerChat(std::vector<GbxResponseParameter> parameters);
79 
85  void HandlePlayerManialinkPageAnswer(std::vector<GbxResponseParameter> parameters);
86 
92  void HandleEcho(std::vector<GbxResponseParameter> parameters);
93 
99  void HandleBeginMatch(std::vector<GbxResponseParameter> parameters);
100 
106  void HandleEndMatch(std::vector<GbxResponseParameter> parameters);
107 
113  void HandleBeginMap(std::vector<GbxResponseParameter> parameters);
114 
120  void HandleEndMap(std::vector<GbxResponseParameter> parameters);
121 
127  void HandleStatusChanged(std::vector<GbxResponseParameter> parameters);
128 
134  void HandlePlayerCheckpoint(std::vector<GbxResponseParameter> parameters);
135 
141  void HandlePlayerFinish(std::vector<GbxResponseParameter> parameters);
142 
148  void HandlePlayerIncoherence(std::vector<GbxResponseParameter> parameters);
149 
155  void HandleBillUpdated(std::vector<GbxResponseParameter> parameters);
156 
162  void HandleMapListModified(std::vector<GbxResponseParameter> parameters);
163 
169  void HandlePlayerInfoChanged(std::vector<GbxResponseParameter> parameters);
170 
176  void HandleVoteUpdated(std::vector<GbxResponseParameter> parameters);
177 
178 private:
183  sql::Connection* database;
184  std::map<std::string, Player>* players;
187 };
188 
189 #endif // CALLBACKMANAGER_H_
CommandManager * commands
Contains the command manager.
Definition: CallBackManager.h:181
void HandleStatusChanged(std::vector< GbxResponseParameter > parameters)
Handles StatusChanged callback.
Definition: CallBackManager.cpp:304
void HandleMapListModified(std::vector< GbxResponseParameter > parameters)
Handles MapListModified callback.
Definition: CallBackManager.cpp:355
EventManager * events
Contains the event manager.
Definition: CallBackManager.h:182
void HandlePlayerIncoherence(std::vector< GbxResponseParameter > parameters)
Handles PlayerIncoherence callback.
Definition: CallBackManager.cpp:337
void HandleEcho(std::vector< GbxResponseParameter > parameters)
Handles Echo callback.
Definition: CallBackManager.cpp:227
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:16
void HandlePlayerInfoChanged(std::vector< GbxResponseParameter > parameters)
Handles PlayerInfoChanged callback.
Definition: CallBackManager.cpp:365
MapList * maps
Contains the list of players currently on the server.
Definition: CallBackManager.h:185
void HandlePlayerChat(std::vector< GbxResponseParameter > parameters)
Handles PlayerChat callback.
Definition: CallBackManager.cpp:182
ServerInfo * serverInfo
Contains the server information.
Definition: CallBackManager.h:186
Reads and stores configuration information.
Definition: Config.h:67
void HandleVoteUpdated(std::vector< GbxResponseParameter > parameters)
Handles VoteUpdated callback.
Definition: CallBackManager.cpp:386
void HandlePlayerFinish(std::vector< GbxResponseParameter > parameters)
Handles PlayerFinish callback.
Definition: CallBackManager.cpp:324
Handles callbacks from the server.
Definition: CallBackManager.h:32
sql::Connection * database
Contains the database connection.
Definition: CallBackManager.h:183
void HandlePlayerManialinkPageAnswer(std::vector< GbxResponseParameter > parameters)
Handles PlayerManialinkPageAnswer callback.
Definition: CallBackManager.cpp:205
Config * config
Contains the configuration.
Definition: CallBackManager.h:179
void HandleBillUpdated(std::vector< GbxResponseParameter > parameters)
Handles BillUpdated callback.
Definition: CallBackManager.cpp:345
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:240
std::map< std::string, Player > * players
Contains the list of players currently on the server.
Definition: CallBackManager.h:184
GbxRemote * server
Contains the serverconnection.
Definition: CallBackManager.h:180
void HandleEndMap(std::vector< GbxResponseParameter > parameters)
Handles EndMap callback.
Definition: CallBackManager.cpp:297
void HandlePlayerDisconnect(std::vector< GbxResponseParameter > parameters)
Handles PlayerDisconnect callback.
Definition: CallBackManager.cpp:171
void HandlePlayerConnect(std::vector< GbxResponseParameter > parameters)
Handles PlayerConnect callback.
Definition: CallBackManager.cpp:90
CallBackManager(Config *configPtr, GbxRemote *serverPtr, CommandManager *commandManagerPtr, EventManager *eventManagerPtr, sql::Connection *databasePtr, std::map< std::string, Player > *playerList, MapList *mapList, ServerInfo *serverInfoPtr)
Definition: CallBackManager.cpp:3
void HandlePlayerCheckpoint(std::vector< GbxResponseParameter > parameters)
Handles PlayerCheckpoint callback.
Definition: CallBackManager.cpp:312
Handles events (callbacks) from server to plugins.
Definition: EventManager.h:15
void HandleBeginMatch(std::vector< GbxResponseParameter > parameters)
Handles BeginMatch callback.
Definition: CallBackManager.cpp:235
void HandleBeginMap(std::vector< GbxResponseParameter > parameters)
Handles BeginMap callback.
Definition: CallBackManager.cpp:283
Manages the chat commands.
Definition: CommandManager.h:17
Struct with server information.
Definition: Structs.h:41