Celte
|
To allow maximum customization of celte's behaviors, most actions taken by celte can be coupled with user defined hooks. More...
#include <CelteHooks.hpp>
Public Member Functions | |
template<typename T , typename... Args> | |
bool | Call (T &&hook, Args &&...args) |
This function will call the hook if it is not null. | |
Public Attributes | ||
struct { | ||
struct { | ||
std::function< bool()> onConnectionProcedureInitiated | ||
This hook is called when the server starts trying to reach for the kafka cluster. More... | ||
std::function< bool()> onConnectionSuccess = []() { return true; } | ||
This hook is called when the server successfully connects to the kafka cluster. | ||
std::function< bool()> onConnectionError = []() { return true; } | ||
This hook is called when the server fails to connect to the kafka cluster. | ||
std::function< bool()> onServerDisconnected = []() { return true; } | ||
This hook is called when the server is disconnected from the kafka cluster for any reason. | ||
std::function< std::tuple< std::string, float, float, float >(std::string)> onSpawnPositionRequest | ||
This hook is called when the master receives a new connection and must decide where to redirect the player. The game dev is expected to look up the player's last known position and data, and return it so that it can be forwarded to the server node. More... | ||
} connection | ||
struct { | ||
std::function< bool(std::string)> accept | ||
This hook is called when a new player connects to the server. More... | ||
std::function< bool(std::string, int, int, int)> execPlayerSpawn | ||
This hook is called when a new player connects to the server, and must be instantiated in the game world. More... | ||
} newPlayerConnected | ||
struct { | ||
std::function< bool(std::string)> loadGrape | ||
This hook is called when the server is informed that a new grape has been assigned to it. More... | ||
} grape | ||
This collection of hooks regroups all hooks related to managing the lifecycle of a grape, and instantiating it into the game world. | ||
} | server | |
To allow maximum customization of celte's behaviors, most actions taken by celte can be coupled with user defined hooks.
pre_cev should return a boolean which, if false, will prevent the event cev from being processed and abord the procedure.
|
inline |
This function will call the hook if it is not null.
T | The type of the hook. |
Args | The type of the arguments to pass to the hook |
std::function<bool(std::string)> celte::api::HooksTable::accept |
This hook is called when a new player connects to the server.
std::function<bool(std::string, int, int, int)> celte::api::HooksTable::execPlayerSpawn |
This hook is called when a new player connects to the server, and must be instantiated in the game world.
std::function<bool(std::string)> celte::api::HooksTable::loadGrape |
This hook is called when the server is informed that a new grape has been assigned to it.
std::function<bool()> celte::api::HooksTable::onConnectionProcedureInitiated |
This hook is called when the server starts trying to reach for the kafka cluster.
std::function<std::tuple<std::string, float, float, float>(std::string)> celte::api::HooksTable::onSpawnPositionRequest |
This hook is called when the master receives a new connection and must decide where to redirect the player. The game dev is expected to look up the player's last known position and data, and return it so that it can be forwarded to the server node.
The hook is called by the impolementation of celte::server::states::Connected::__rp_getPlayerSpawnPosition.