Mania++
 All Classes Functions Variables Pages
ManiaPP.h
1 #ifndef MANIAPP_H_
2 #define MANIAPP_H_
3 
4 #include <ctime>
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/Formatting.h"
20 #include "Utils/GameMode.h"
21 #include "Utils/Logging.h"
22 #include "Utils/Time.h"
23 #include "Version/VersionChecker.h"
24 
25 //* ManiaPP
29 class ManiaPP
30 {
31 public:
35  ManiaPP();
36 
40  ~ManiaPP();
41 
45  bool ConnectToServer();
46 
50  bool ConnectToDatabase();
51 
55  void PrintServerInfo();
56 
60  void MainLoop();
61 
65  void Terminate();
66 
67 private:
71  std::map<std::string, Player>* players;
81  Database* db = NULL;
82  sql::Connection* database = NULL;
91  void retrievePlayerList();
92 
98  void retrieveMapList();
99 };
100 
101 #endif // MANIAPP_H_
Main class.
Definition: ManiaPP.h:29
~ManiaPP()
Destructs the pointers in the main class.
Definition: ManiaPP.cpp:30
ServerInfo * serverInfo
Struct with server information.
Definition: ManiaPP.h:84
sql::Connection * database
Contains database driver.
Definition: ManiaPP.h:82
Manages the plugins.
Definition: PluginManager.h:23
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:179
Utility to print information to the console.
Definition: Logging.h:13
void Terminate()
Disconnects the software from the server.
Definition: ManiaPP.cpp:403
Reads and stores configuration information.
Definition: Config.h:67
Config * config
Contains the configuration for the software.
Definition: ManiaPP.h:68
Methods * methods
Server method caller.
Definition: ManiaPP.h:78
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:143
UIManager * ui
UI manager (ManiaLink).
Definition: ManiaPP.h:79
Handles callbacks from the server.
Definition: CallBackManager.h:32
Logging * logging
Contains functions to log information.
Definition: ManiaPP.h:69
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:71
Contains all server methods and returns usable data types.
Definition: Methods.h:15
void PrintServerInfo()
Prints information about the server.
Definition: ManiaPP.cpp:168
EventManager * events
Contains the event manager.
Definition: ManiaPP.h:74
void retrieveMapList()
Gets a list of current maps from the server.
Definition: ManiaPP.cpp:325
MapList * maps
Contains the list of maps on the server.
Definition: ManiaPP.h:72
CommandManager * commands
Contains the command manager.
Definition: ManiaPP.h:77
GbxRemote * server
Contains the connection with the server and its methods.
Definition: ManiaPP.h:70
Database * db
Contains database connection and driver (needed on destruction).
Definition: ManiaPP.h:81
void retrievePlayerList()
Gets a list of current players from the server.
Definition: ManiaPP.cpp:217
Handles events (callbacks) from server to plugins.
Definition: EventManager.h:15
PluginManager * plugins
Contains the plugin manager.
Definition: ManiaPP.h:75
Manages the chat commands.
Definition: CommandManager.h:17
CallBackManager * callbacks
Contains the callback manager.
Definition: ManiaPP.h:76
Struct with server information.
Definition: Structs.h:41