Move adminsys and more natives from core to logic.

This commit is contained in:
Nicholas Hastings
2014-05-29 13:31:12 -04:00
parent dc4c3f2f1a
commit 35784c018d
22 changed files with 2880 additions and 2769 deletions
+12 -2
View File
@@ -35,7 +35,7 @@
#include <IShareSys.h>
#define SMINTERFACE_ADMINSYS_NAME "IAdminSys"
#define SMINTERFACE_ADMINSYS_VERSION 7
#define SMINTERFACE_ADMINSYS_VERSION 8
/**
* @file IAdminSystem.h
@@ -728,12 +728,22 @@ namespace SourceMod
virtual bool FindFlagChar(AdminFlag flag, char *c) =0;
/**
* brief Returns whether or not an admin id is valid.
* @brief Returns whether or not an admin id is valid.
*
* @param id Admin id to check.
* @return True if valid, otherwise false.
*/
virtual bool IsValidAdmin(AdminId id) =0;
/**
* @brief Returns whether or not a client has access to a given command.
*
* @param client Client index.
* @param cmd Command name.
* @param flags Command admin flags.
* @return True if allowed access, otherwise false;
*/
virtual bool CheckClientCommandAccess(int client, const char *cmd, FlagBits cmdflags) =0;
};
}
+18 -1
View File
@@ -41,7 +41,7 @@
#include <IAdminSystem.h>
#define SMINTERFACE_PLAYERMANAGER_NAME "IPlayerManager"
#define SMINTERFACE_PLAYERMANAGER_VERSION 19
#define SMINTERFACE_PLAYERMANAGER_VERSION 20
struct edict_t;
class IPlayerInfo;
@@ -262,6 +262,11 @@ namespace SourceMod
* @param pMsg String to print.
*/
virtual void PrintToConsole(const char *pMsg) =0;
/**
* @brief Removes admin access from the client.
*/
virtual void ClearAdmin() =0;
};
/**
@@ -584,6 +589,18 @@ namespace SourceMod
* @param info Pointer to the cmd_target_info_t structure to process.
*/
virtual void ProcessCommandTarget(cmd_target_info_t *info) =0;
/**
* @brief Removes all access for the given admin id.
*
* @param id Admin id.
*/
virtual void ClearAdminId(AdminId id) =0;
/**
* @brief Reruns admin checks on all players.
*/
virtual void RecheckAnyAdmins() =0;
};
}
-8
View File
@@ -41,10 +41,6 @@
{
return cmd->IsFlagSet(flag);
}
inline void InsertServerCommand(const char *buf)
{
engine->InsertServerCommand(buf);
}
inline ConCommandBase *FindCommandBase(const char *name)
{
return icvar->FindCommandBase(name);
@@ -77,10 +73,6 @@
{
return cmd->IsBitSet(flag);
}
inline void InsertServerCommand(const char *buf)
{
engine->InsertServerCommand(buf);
}
inline ConCommandBase *FindCommandBase(const char *name)
{
ConCommandBase *pBase = icvar->GetCommands();