mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-20 13:54:14 +01:00
Updated for latest hl2sdk-dota changes.
This commit is contained in:
parent
aacb75f99d
commit
0452567b43
@ -784,6 +784,20 @@ size_t MetamodSource::PathFormat(char *buffer, size_t len, const char *fmt, ...)
|
||||
return mylen;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void MetamodSource::ClientConPrintf(int clientIndex, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char buffer[2048];
|
||||
|
||||
va_start(ap, fmt);
|
||||
UTIL_FormatArgs(buffer, sizeof(buffer), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
ClientConPrintf((edict_t *)(gpGlobals->pEdicts + clientIndex), "%s", buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
void MetamodSource::ClientConPrintf(edict_t *client, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -77,6 +77,10 @@ public:
|
||||
void *InterfaceSearch(CreateInterfaceFn fn, const char *iface, int max, int *ret);
|
||||
const char *GetBaseDir();
|
||||
size_t PathFormat(char *buffer, size_t len, const char *fmt, ...);
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
// Shim
|
||||
void ClientConPrintf(int clientIndex, const char *fmt, ...);
|
||||
#endif
|
||||
void ClientConPrintf(edict_t *client, const char *fmt, ...);
|
||||
void *VInterfaceMatch(CreateInterfaceFn fn, const char *iface, int min=-1);
|
||||
void EnableVSPListener();
|
||||
|
@ -659,7 +659,11 @@ bool Command_Meta(IMetamodSourceCommandInfo *info)
|
||||
return true;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
bool Command_ClientMeta(int client, IMetamodSourceCommandInfo *info)
|
||||
#else
|
||||
bool Command_ClientMeta(edict_t *client, IMetamodSourceCommandInfo *info)
|
||||
#endif
|
||||
{
|
||||
const char *cmd = info->GetArg(0);
|
||||
|
||||
|
@ -31,6 +31,10 @@
|
||||
#include "metamod_provider.h"
|
||||
|
||||
bool Command_Meta(IMetamodSourceCommandInfo *info);
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
bool Command_ClientMeta(int client, IMetamodSourceCommandInfo *info);
|
||||
#else
|
||||
bool Command_ClientMeta(edict_t *client, IMetamodSourceCommandInfo *info);
|
||||
#endif
|
||||
|
||||
#endif //_INCLUDE_CONCOMMANDS_H
|
||||
|
@ -63,7 +63,7 @@ DLL_IMPORT ICommandLine *CommandLine();
|
||||
void CacheUserMessages();
|
||||
void Detour_Error(const tchar *pMsg, ...);
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void ClientCommand(edict_t *pEdict, const CCommand &args);
|
||||
void ClientCommand(int client, const CCommand &args);
|
||||
void LocalCommand_Meta(void *pUnknown, const CCommand &args);
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
void ClientCommand(edict_t *pEdict, const CCommand &args);
|
||||
@ -88,7 +88,9 @@ IServerGameClients *gameclients = NULL;
|
||||
IMetamodSourceProvider *provider = &g_Ep1Provider;
|
||||
ConCommand meta_local_cmd("meta", LocalCommand_Meta, "Metamod:Source control options");
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, int, const CCommand &);
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
|
||||
#else
|
||||
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *);
|
||||
@ -176,9 +178,14 @@ bool BaseProvider::IsRemotePrintingAvailable()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BaseProvider::ClientConsolePrint(edict_t *client, const char *message)
|
||||
void BaseProvider::ClientConsolePrint(edict_t *pEdict, const char *message)
|
||||
{
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
int client = (int)(pEdict - g_Metamod.GetCGlobals()->pEdicts);
|
||||
engine->ClientPrintf(client, message);
|
||||
#else
|
||||
engine->ClientPrintf(pEdict, message);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BaseProvider::ServerCommand(const char *cmd)
|
||||
@ -517,18 +524,22 @@ void LocalCommand_Meta()
|
||||
Command_Meta(&cmd);
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
void ClientCommand(edict_t *pEdict, const CCommand &_cmd)
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void ClientCommand(int client, const CCommand &_cmd)
|
||||
{
|
||||
GlobCommand cmd(&_cmd);
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
void ClientCommand(edict_t *client, const CCommand &_cmd)
|
||||
{
|
||||
GlobCommand cmd(&_cmd);
|
||||
#else
|
||||
void ClientCommand(edict_t *pEdict)
|
||||
void ClientCommand(edict_t *client)
|
||||
{
|
||||
GlobCommand cmd;
|
||||
#endif
|
||||
if (strcmp(cmd.GetArg(0), "meta") == 0)
|
||||
{
|
||||
Command_ClientMeta(pEdict, &cmd);
|
||||
Command_ClientMeta(client, &cmd);
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user