Mania++
 All Classes Functions Variables Pages
ManiaPP.h
1 #ifndef MANIAPP_H_
2 #define MANIAPP_H_
3 
4 #include <chrono>
5 
6 #include "CallBacks/CallBackManager.h"
7 #include "Config/Version.h"
8 #include "Config/Config.h"
9 #include "Commands/CommandManager.h"
10 #include "Database/Database.h"
11 #include "Events/EventManager.h"
12 #include "GbxRemote/GbxRemote.h"
13 #include "Maps/MapList.h"
14 #include "Methods/Methods.h"
15 #include "Objects/Map.h"
16 #include "Objects/Player.h"
17 #include "Plugins/PluginManager.h"
18 #include "UI/UIManager.h"
19 #include "Utils/Logging.h"
20 #include "Utils/Time.h"
21 #include "Version/VersionChecker.h"
22 
23 //* ManiaPP
27 class ManiaPP
28 {
29 public:
33  ManiaPP();
34 
38  ~ManiaPP();
39 
43  bool ConnectToServer();
44 
48  bool ConnectToDatabase();
49 
53  void PrintServerInfo();
54 
58  void MainLoop();
59 
63  void Terminate();
64 
65 private:
69  std::map<std::string, Player>* players;
79  Database* db = NULL;
80  sql::Connection* database = NULL;
90  void retrievePlayerList();
91 
97  void retrieveMapList();
98 };
99 
100 #endif // MANIAPP_H_
SystemInfo systemInfo
Struct with system information.
Definition: ManiaPP.h:83
Main class.
Definition: ManiaPP.h:27
~ManiaPP()
Destructs the pointers in the main class.
Definition: ManiaPP.cpp:26
sql::Connection * database
Contains database driver.
Definition: ManiaPP.h:80
Manages the plugins.
Definition: PluginManager.h:35
bool ConnectToServer()
Connects and authenticates with the server.
Definition: ManiaPP.cpp:50
Handles communication with the ManiaPlanet server.
Definition: GbxRemote.h:20
Handles the connection to the database.
Definition: Database.h:17
Manages the user interface on the server (ManiaLinks).
Definition: UIManager.h:17
void MainLoop()
Performing our tasks ...
Definition: ManiaPP.cpp:171
Utility to print information to the console.
Definition: Logging.h:13
void Terminate()
Disconnects the software from the server.
Definition: ManiaPP.cpp:368
Reads and stores configuration information.
Definition: Config.h:65
Config * config
Contains the configuration for the software.
Definition: ManiaPP.h:66
Methods * methods
Server method caller.
Definition: ManiaPP.h:76
ManiaPP()
Sets up the several variables needed to run the software.
Definition: ManiaPP.cpp:3
bool ConnectToDatabase()
Connects and authenticates with the database server.
Definition: ManiaPP.cpp:137
UIManager * ui
UI manager (ManiaLink).
Definition: ManiaPP.h:77
Handles callbacks from the server.
Definition: CallBackManager.h:29
Logging * logging
Contains functions to log information.
Definition: ManiaPP.h:67
Struct with system information.
Definition: Structs.h:21
Contains the maplist and a pointer to the current map.
Definition: MapList.h:10
std::map< std::string, Player > * players
Contains the list of players currently on the server.
Definition: ManiaPP.h:69
Contains all server methods and returns usable data types.
Definition: Methods.h:14
Struct with server version information.
Definition: Structs.h:8
void PrintServerInfo()
Prints information about the server.
Definition: ManiaPP.cpp:162
EventManager * events
Contains the event manager.
Definition: ManiaPP.h:72
void retrieveMapList()
Gets a list of current maps from the server.
Definition: ManiaPP.cpp:290
MapList * maps
Contains the list of maps on the server.
Definition: ManiaPP.h:70
CommandManager * commands
Contains the command manager.
Definition: ManiaPP.h:75
ServerVersion serverVersion
Struct with server version information.
Definition: ManiaPP.h:82
GbxRemote * server
Contains the connection with the server and its methods.
Definition: ManiaPP.h:68
Database * db
Contains database connection and driver (needed on destruction).
Definition: ManiaPP.h:79
void retrievePlayerList()
Gets a list of current players from the server.
Definition: ManiaPP.cpp:194
Handles events (callbacks) from server to plugins.
Definition: EventManager.h:15
PluginManager * plugins
Contains the plugin manager.
Definition: ManiaPP.h:73
Manages the chat commands.
Definition: CommandManager.h:14
CallBackManager * callbacks
Contains the callback manager.
Definition: ManiaPP.h:74