118 std::shared_ptr<CustomCommandHandler> handler);
158 #ifdef LEAK_INTO_GLOBAL virtual DLLEXPORT ~CommandHandler()
virtual DLLEXPORT void EndOwnership(CommandHandler *which)
Marks the end of ownership, it is no longer required to report that this object is released...
virtual DLLEXPORT void StartOwnership(CommandHandler *commander)
Marks the start of a time period during which this object needs to report if it is released...
COMMANDSENDER_PERMISSIONMODE
virtual DLLEXPORT void _OnReleaseParentCommanders()
Call when releasing, this is only required if StartOwnership and EndOwnership aren't overloaded...
virtual DLLEXPORT void RemoveMe(CommandSender *object)
This should be called by CommandSender subclasses when they are no longer available to remove their c...
virtual DLLEXPORT bool RegisterCustomCommandHandler(std::shared_ptr< CustomCommandHandler > handler)
Registers a new custom command handler.
void _LetGoOfAll()
Lets go of all the CommandSenders.
virtual DLLEXPORT const std::string & GetUniqueName()=0
Returns the unique name of this entity, this can be something like a steam id or some other static na...
virtual DLLEXPORT void SenderNoLongerRequired(CommandSender *checkthis)
Called by a command handler when a CommandSender is no longer needed.
virtual DLLEXPORT void UpdateStatus()
Call this periodically to perform cleanup tasks.
std::list< CommandHandler * > CommandHandlersToNotify
virtual DLLEXPORT bool IsThisDefaultCommand(const std::string &firstword) const
Returns true when the default command handling function can process this.
DLLEXPORT CommandHandler(NetworkServerInterface *owneraccess)
Constructs a CommandHandler for use by a single server network interface.
static CommandHandler * Staticaccess
A static access member for command executing functions.
NetworkServerInterface * Owner
Pointer to the owning interface for fetching various other things.
virtual DLLEXPORT void SendPrivateMessage(const std::string &message)
This should send a message to this entity for them to see what happened when they executed a command...
Represents an entity that can execute commands.
virtual DLLEXPORT COMMANDSENDER_PERMISSIONMODE GetPermissionMode()=0
Returns the permissions model used by this object.
std::vector< std::shared_ptr< CustomCommandHandler > > CustomHandlers
All the custom command providers.
std::list< CommandSender * > SendersInUse
Holds all the command dispatchers who are currently executing commands.
virtual DLLEXPORT void QueueCommand(const std::string &command, CommandSender *issuer)
Queues a command to be executed.
Class that encapsulates common networking functionality required by server programs.
virtual DLLEXPORT bool IsSenderStillValid(CommandSender *checkthis)
Called by an actual command callback to make sure that the sender is still active.
The access mask controls which registered functions and classes a script sees.
virtual DLLEXPORT bool _OnSendPrivateMessage(const std::string &message)=0
Should be the actual implementation of SendPrivateMessage.
void _AddSender(CommandSender *object)
Adds a CommandSender to the list of active ones.
virtual DLLEXPORT const std::string & GetNickname()=0
Returns a friendly name, nickname used to represent this entity.
Handles all commands sent by the players on the server.
static DLLEXPORT CommandHandler * Get()