13 #include <cppconn/driver.h>
14 #include <cppconn/exception.h>
15 #include <cppconn/resultset.h>
16 #include <cppconn/statement.h>
17 #include <cppconn/prepared_statement.h>
19 #include "../Events/Structs.h"
20 #include "../Maps/MapList.h"
21 #include "../Methods/Methods.h"
22 #include "../Objects/Player.h"
23 #include "../Objects/Map.h"
24 #include "../UI/UIManager.h"
25 #include "../Utils/Logging.h"
50 virtual void Init() = 0;
66 std::vector<std::function<void(Player, std::string)>>
PlayerChat;
67 std::vector<std::function<void(std::string, std::string)>>
Echo;
69 std::vector<std::function<void(std::vector<PlayerRanking>, int)>>
EndMatch;
70 std::vector<std::function<void(Map)>>
BeginMap;
71 std::vector<std::function<void(Map)>>
EndMap;
76 std::vector<std::function<void(int, int, std::string, int)>>
BillUpdated;
79 std::vector<std::function<void(std::string, std::string, std::string, std::string)>>
VoteUpdated;
81 std::map<std::string, std::function<void(Player, std::vector<std::string>)>>
Commands =
82 std::map<std::string, std::function<
void(
Player, std::vector<std::string>)>>();
83 std::map<std::string, std::function<void(Player, std::vector<std::string>)>>
AdminCommands =
84 std::map<std::string, std::function<
void(
Player, std::vector<std::string>)>>();
100 Commands.insert(std::pair<std::string, std::function<
void(
Player, std::vector<std::string>)>>(name, method));
111 AdminCommands.insert(std::pair<std::string, std::function<
void(
Player, std::vector<std::string>)>>(name, method));
std::map< std::string, std::string > Settings
Plugin settings (from the config file).
Definition: Plugin.h:62
void RegisterCommand(std::string name, std::function< void(Player, std::vector< std::string >)> method)
Register chat command.
Definition: Plugin.h:98
std::vector< std::function< void(int, std::string)> > StatusChanged
Vector with functions for the StatusChanged event.
Definition: Plugin.h:72
std::vector< std::function< void(Player)> > PlayerDisconnect
Vector with functions for the PlayerDisconnect event.
Definition: Plugin.h:65
Controller * controller
Struct with needed instances.
Definition: Plugin.h:90
std::vector< std::function< void(std::string, std::string, std::string, std::string)> > VoteUpdated
Vector with functions for the VoteUpdated event.
Definition: Plugin.h:79
UIManager * UI
UI manager instance.
Definition: Plugin.h:37
std::string Author
Plugin author.
Definition: Plugin.h:87
Manages the user interface on the server (ManiaLinks).
Definition: UIManager.h:17
Contains all information about a player in easy-to-use format.
Definition: Player.h:10
std::map< std::string, std::function< void(Player, std::vector< std::string >)> > AdminCommands
Map with admin chat commands for the plugin.
Definition: Plugin.h:83
std::map< std::string, Player > * Players
Playerlist instance.
Definition: Plugin.h:34
std::vector< std::function< void(Player, int, int, int)> > PlayerCheckpoint
Vector with functions for the PlayerCheckpoint event.
Definition: Plugin.h:73
std::string Version
Plugin version.
Definition: Plugin.h:86
std::vector< std::function< void(std::string, std::string)> > Echo
Vector with functions for the Echo event.
Definition: Plugin.h:67
Methods * Server
Methods instance.
Definition: Plugin.h:33
Plugin interface, inherited by all plugins.
Definition: Plugin.h:44
Contains the maplist and a pointer to the current map.
Definition: MapList.h:10
std::vector< std::function< void(Player)> > PlayerInfoChanged
Vector with functions for the PlayerInfoChanged event.
Definition: Plugin.h:78
std::vector< std::function< void(std::vector< PlayerRanking >, int)> > EndMatch
Vector with functions for the EndMatch event.
Definition: Plugin.h:69
Contains all server methods and returns usable data types.
Definition: Methods.h:14
std::vector< std::function< void()> > BeginMatch
Vector with functions for the BeginMatch event.
Definition: Plugin.h:68
Struct with all instances needed for plugins.
Definition: Plugin.h:31
MapList * Maps
Maplist instance.
Definition: Plugin.h:35
virtual void Init()=0
Initializes plugin (called after loading all plugins).
std::vector< std::function< void(Player, std::string)> > PlayerChat
Vector with functions for the PlayerChat event.
Definition: Plugin.h:66
void SetController(Controller *controllerPtr)
Sets the controller instance.
Definition: Plugin.h:57
std::vector< std::function< void(int, int, std::string, int)> > BillUpdated
Vector with functions for the BillUpdated event.
Definition: Plugin.h:76
std::map< std::string, std::function< void(Player, std::vector< std::string >)> > Commands
Map with normal chat commands for the plugin.
Definition: Plugin.h:81
std::vector< std::function< void(Player, int)> > PlayerFinish
Vector with functions for the PlayerFinish event.
Definition: Plugin.h:74
void RegisterAdminCommand(std::string name, std::function< void(Player, std::vector< std::string >)> method)
Register admin chat command.
Definition: Plugin.h:109
std::vector< std::function< void(Player)> > PlayerIncoherence
Vector with functions for the PlayerIncoherence event.
Definition: Plugin.h:75
sql::Connection * Database
Database instance.
Definition: Plugin.h:36
std::vector< std::function< void(Player)> > PlayerConnect
Vector with functions for the PlayerConnect event.
Definition: Plugin.h:64
std::vector< std::function< void(Map)> > BeginMap
Vector with functions for the BeginMap event.
Definition: Plugin.h:70
std::vector< std::function< void(Map)> > EndMap
Vector with functions for the EndMap event.
Definition: Plugin.h:71
std::vector< std::function< void(int, int, bool)> > MapListModified
Vector with functions for the MapListModified event.
Definition: Plugin.h:77