added reply-to stuff for the C++ API

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401525
This commit is contained in:
David Anderson 2007-10-02 01:50:36 +00:00
parent 5600942b3c
commit c420f453de
6 changed files with 34 additions and 5 deletions

View File

@ -33,6 +33,7 @@
#include "ChatTriggers.h"
#include "sm_stringutil.h"
#include "ConCmdManager.h"
#include <IPlayerHelpers.h>
/* :HACKHACK: We can't SH_DECL here because ConCmdManager.cpp does */
extern bool __SourceHook_FHRemoveConCommandDispatch(void *, bool, class fastdelegate::FastDelegate0<void>);

View File

@ -34,9 +34,7 @@
#include "sm_globals.h"
#include "sourcemm_api.h"
#define SM_REPLY_CONSOLE 0
#define SM_REPLY_CHAT 1
#include <IGameHelpers.h>
class ChatTriggers : public SMGlobalClass
{

View File

@ -382,4 +382,3 @@ bool CHalfLife2::IsLANServer()
return (sv_lan->GetInt() != 0);
}

View File

@ -43,6 +43,7 @@
#include "TimerSys.h"
#include "Translator.h"
#include "Logger.h"
#include "ChatTriggers.h"
PlayerManager g_Players;
bool g_OnMapStarted = false;
@ -791,6 +792,16 @@ void PlayerManager::RecheckAnyAdmins()
}
}
unsigned int PlayerManager::GetReplyTo()
{
return g_ChatTriggers.GetReplyTo();
}
unsigned int PlayerManager::SetReplyTo(unsigned int reply)
{
return g_ChatTriggers.SetReplyTo(reply);
}
/*******************
*** PLAYER CODE ***
*******************/

View File

@ -147,6 +147,8 @@ public:
bool CheckSetAdminName(int index, CPlayer *pPlayer, AdminId id);
const char *GetPassInfoVar();
void RecheckAnyAdmins();
unsigned int GetReplyTo();
unsigned int SetReplyTo(unsigned int reply);
private:
void OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
private:

View File

@ -41,11 +41,14 @@
#include <IAdminSystem.h>
#define SMINTERFACE_PLAYERMANAGER_NAME "IPlayerManager"
#define SMINTERFACE_PLAYERMANAGER_VERSION 5
#define SMINTERFACE_PLAYERMANAGER_VERSION 6
struct edict_t;
class IPlayerInfo;
#define SM_REPLY_CONSOLE 0 /**< Reply to console. */
#define SM_REPLY_CHAT 1 /**< Reply to chat. */
namespace SourceMod
{
/**
@ -305,6 +308,21 @@ namespace SourceMod
* at least once, false otherwise.
*/
virtual bool IsServerActivated() =0;
/**
* @brief Gets SourceMod's reply source.
*
* @return ReplyTo source.
*/
virtual unsigned int GetReplyTo() =0;
/**
* @brief Sets SourceMod's reply source.
*
* @param reply Reply source.
* @return Old reply source.
*/
virtual unsigned int SetReplyTo(unsigned int reply) =0;
};
}