mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-02-20 13:54:14 +01:00
fixed incompatibility with gcc-4.2 mods that have -fvisibility=hidden
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40667
This commit is contained in:
parent
4b320fd8be
commit
47ba6866cb
@ -45,6 +45,12 @@
|
|||||||
typedef void (*CONPRINTF_FUNC)(const char *, ...);
|
typedef void (*CONPRINTF_FUNC)(const char *, ...);
|
||||||
struct UsrMsgInfo
|
struct UsrMsgInfo
|
||||||
{
|
{
|
||||||
|
UsrMsgInfo()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
UsrMsgInfo(int s, const char *t) : size(s), name(t)
|
||||||
|
{
|
||||||
|
}
|
||||||
int size;
|
int size;
|
||||||
String name;
|
String name;
|
||||||
};
|
};
|
||||||
@ -72,6 +78,22 @@ ConCommand meta_local_cmd("meta", LocalCommand_Meta, "Metamod:Source control opt
|
|||||||
|
|
||||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
|
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
|
||||||
|
|
||||||
|
bool AssumeUserMessages()
|
||||||
|
{
|
||||||
|
int q, size;
|
||||||
|
char buffer[256];
|
||||||
|
|
||||||
|
q = 0;
|
||||||
|
|
||||||
|
while (server->GetUserMessageInfo(q, buffer, sizeof(buffer), size))
|
||||||
|
{
|
||||||
|
usermsgs_list.push_back(UsrMsgInfo(size, buffer));
|
||||||
|
q++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void BaseProvider::ConsolePrint(const char *str)
|
void BaseProvider::ConsolePrint(const char *str)
|
||||||
{
|
{
|
||||||
ConMsg("%s", str);
|
ConMsg("%s", str);
|
||||||
@ -110,7 +132,10 @@ void BaseProvider::Notify_DLLInit_Pre(CreateInterfaceFn engineFactory,
|
|||||||
RegisterConCommandBase(&meta_local_cmd);
|
RegisterConCommandBase(&meta_local_cmd);
|
||||||
conbases_unreg.push_back(&meta_local_cmd);
|
conbases_unreg.push_back(&meta_local_cmd);
|
||||||
|
|
||||||
usermsgs_extracted = CacheUserMessages();
|
if ((usermsgs_extracted = CacheUserMessages()) == false)
|
||||||
|
{
|
||||||
|
usermsgs_extracted = AssumeUserMessages();
|
||||||
|
}
|
||||||
|
|
||||||
if (gameclients)
|
if (gameclients)
|
||||||
{
|
{
|
||||||
@ -609,6 +634,10 @@ bool CacheUserMessages()
|
|||||||
if (handle != NULL)
|
if (handle != NULL)
|
||||||
{
|
{
|
||||||
void *addr = dlsym(handle, "usermessages");
|
void *addr = dlsym(handle, "usermessages");
|
||||||
|
if (addr == NULL)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
dict = (UserMsgDict *)*(void **)addr;
|
dict = (UserMsgDict *)*(void **)addr;
|
||||||
dlclose(handle);
|
dlclose(handle);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user