|
|
@ -25,9 +25,16 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
#include "Jupiter/Command.h" |
|
|
|
#include "Jupiter/String.h" |
|
|
|
#include "RenX.h" |
|
|
|
#include "RenX_Core.h" // getCore(). |
|
|
|
|
|
|
|
/** DLL Linkage Nagging */ |
|
|
|
#if defined _MSC_VER |
|
|
|
#pragma warning(push) |
|
|
|
#pragma warning(disable: 4251) |
|
|
|
#endif |
|
|
|
|
|
|
|
namespace RenX |
|
|
|
{ |
|
|
|
/** Forward delcarations */ |
|
|
@ -79,6 +86,11 @@ namespace RenX |
|
|
|
*/ |
|
|
|
virtual GameCommand *copy() = 0; |
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Same as the Default constructor, except that the command is not added to the master command list. |
|
|
|
*/ |
|
|
|
GameCommand(nullptr_t); |
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Copy constructor for a Game Command. |
|
|
|
* Note: This is automatically generated by the GENERIC_GAME_COMMAND macro. |
|
|
@ -100,6 +112,24 @@ namespace RenX |
|
|
|
private: |
|
|
|
int access = 0; /** Minimum access level */ |
|
|
|
}; |
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Provides a simple interface for implementing basic text-to-player commands. |
|
|
|
*/ |
|
|
|
class RENX_API BasicGameCommand : public RenX::GameCommand |
|
|
|
{ |
|
|
|
public: |
|
|
|
void trigger(RenX::Server *source, RenX::PlayerInfo *player, const Jupiter::ReadableString ¶meters); |
|
|
|
const Jupiter::ReadableString &getHelp(const Jupiter::ReadableString ¶meters); |
|
|
|
BasicGameCommand *copy(); |
|
|
|
void create(); |
|
|
|
BasicGameCommand(); |
|
|
|
BasicGameCommand(BasicGameCommand &c); |
|
|
|
BasicGameCommand(const Jupiter::ReadableString &trigger, const Jupiter::ReadableString &in_message, const Jupiter::ReadableString &in_help_message); |
|
|
|
|
|
|
|
private: |
|
|
|
Jupiter::StringS message, help_message; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
/** Game Command Macros */ |
|
|
@ -124,4 +154,9 @@ class CLASS : public RenX::GameCommand { \ |
|
|
|
CLASS CLASS ## _instance; \ |
|
|
|
CLASS *CLASS::copy() { return new CLASS(*this); } |
|
|
|
|
|
|
|
/** Re-enable warnings */ |
|
|
|
#if defined _MSC_VER |
|
|
|
#pragma warning(pop) |
|
|
|
#endif |
|
|
|
|
|
|
|
#endif // _RENX_GAMECOMMAND_H_HEADER
|