1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-03-02 23:29:14 +01:00

fixed usermessages not printing

removed old ConMsg extraction code

--HG--
branch : sourcemm-1.6.0
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/sourcemm-1.6.0%40450
This commit is contained in:
David Anderson 2007-10-04 19:18:19 +00:00
parent 51160e117e
commit 82fc6210ba
2 changed files with 3 additions and 53 deletions

View File

@ -58,7 +58,6 @@ struct UsrMsgInfo
#undef CommandLine #undef CommandLine
DLL_IMPORT ICommandLine *CommandLine(); DLL_IMPORT ICommandLine *CommandLine();
/* Functions */ /* Functions */
CONPRINTF_FUNC ExtractRemotePrinter(void *addr);
bool CacheUserMessages(); bool CacheUserMessages();
void ClientCommand(edict_t *pEdict, const CCommand &args); void ClientCommand(edict_t *pEdict, const CCommand &args);
void LocalCommand_Meta(const CCommand &args); void LocalCommand_Meta(const CCommand &args);
@ -66,7 +65,6 @@ void _ServerCommand();
/* Variables */ /* Variables */
bool usermsgs_extracted = false; bool usermsgs_extracted = false;
CVector<UsrMsgInfo> usermsgs_list; CVector<UsrMsgInfo> usermsgs_list;
CONPRINTF_FUNC echo_msg_func = NULL;
ICvar *icvar = NULL; ICvar *icvar = NULL;
ISmmAPI *metamod_api = NULL; ISmmAPI *metamod_api = NULL;
IVEngineServer *engine = NULL; IVEngineServer *engine = NULL;
@ -81,14 +79,7 @@ SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *,
void BaseProvider::ConsolePrint(const char *str) void BaseProvider::ConsolePrint(const char *str)
{ {
if (echo_msg_func != NULL)
{
ConMsg("%s", str); ConMsg("%s", str);
}
else
{
Msg("%s", str);
}
} }
void BaseProvider::Notify_DLLInit_Pre(void *gamedll, void BaseProvider::Notify_DLLInit_Pre(void *gamedll,
@ -118,7 +109,6 @@ void BaseProvider::Notify_DLLInit_Pre(void *gamedll,
RegisterConCommandBase(&meta_local_cmd); RegisterConCommandBase(&meta_local_cmd);
conbases_unreg.push_back(&meta_local_cmd); conbases_unreg.push_back(&meta_local_cmd);
echo_msg_func = ExtractRemotePrinter(engineFactory);
usermsgs_extracted = CacheUserMessages(); usermsgs_extracted = CacheUserMessages();
if (gameclients) if (gameclients)
@ -141,7 +131,7 @@ void BaseProvider::Notify_DLLShutdown_Pre()
bool BaseProvider::IsRemotePrintingAvailable() bool BaseProvider::IsRemotePrintingAvailable()
{ {
return (echo_msg_func != NULL); return true;
} }
void BaseProvider::ClientConsolePrint(edict_t *client, const char *message) void BaseProvider::ClientConsolePrint(edict_t *client, const char *message)
@ -428,46 +418,6 @@ bool vcmp(const void *_addr1, const void *_addr2, size_t len)
return true; return true;
} }
/* :TODO: I hope we can get rid of this in the future */
CONPRINTF_FUNC ExtractRemotePrinter(void *addr)
{
char path[256+10];
if (!GetFileOfAddress(addr, path, sizeof(path)))
{
return NULL;
}
char *ptr = NULL;
#if defined __linux__
ptr = strstr(path, "engine_i486.so");
#else
ptr = strstr(path, "engine.dll");
#endif
if (ptr == NULL)
{
return NULL;
}
#if defined __linux__
strcpy(ptr, "tier0_i486.so");
#else
strcpy(ptr, "tier0.dll");
#endif
HINSTANCE handle = dlmount(path);
if (handle == NULL)
{
return NULL;
}
void *func = dlsym(handle, "ConMsg");
dlclose(handle);
return (CONPRINTF_FUNC)func;
}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// EVEN MORE HACKS HERE! YOU HAVE BEEN WARNED! // // EVEN MORE HACKS HERE! YOU HAVE BEEN WARNED! //
// Signatures necessary in finding the pointer to the CUtlDict that // // Signatures necessary in finding the pointer to the CUtlDict that //

View File

@ -88,7 +88,7 @@ bool Command_Meta(IMetamodSourceCommandInfo *info)
// Display user messages // Display user messages
int messages = g_Metamod.GetUserMessageCount(); int messages = g_Metamod.GetUserMessageCount();
if (messages == -1) if (messages != -1)
{ {
const char *msgname; const char *msgname;
int msgsize; int msgsize;