plug_list enhancement

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1637 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2005-11-30 05:01:43 +00:00
parent 18b062a0fe
commit 61ea1d4429
2 changed files with 20 additions and 2 deletions

View File

@ -28,6 +28,8 @@ typedef struct plugin_s {
//protocol-in-a-plugin
int connectionlessclientpacket;
int messagefunction;
struct plugin_s *next;
} plugin_t;
@ -261,6 +263,8 @@ int VARGS Plug_ExportToEngine(void *offset, unsigned int mask, const long *arg)
currentplug->sbarlevel[2] = arg[1];
else if (!strcmp(name, "ConnectionlessClientPacket"))
currentplug->connectionlessclientpacket = arg[1];
else if (!strcmp(name, "MessageEvent"))
currentplug->messagefunction = arg[1];
else
return 0;
return 1;
@ -1502,6 +1506,19 @@ void Plug_SBar(void)
currentplug = oc;
}
int Plug_Message(int clientnum, int messagelevel, char *buffer)
{
for (currentplug = plugs; currentplug; currentplug = currentplug->next)
{
if (currentplug->messagefunction)
{
VM_Call(currentplug->vm, currentplug->messagefunction, clientnum, messagelevel, buffer);
}
}
return 1; // don't silence message
}
void Plug_Close(plugin_t *plug)
{
if (plugs == plug)
@ -1585,7 +1602,8 @@ void Plug_List_f(void)
plugin_t *plug;
for (plug = plugs; plug; plug = plug->next)
{
Con_Printf("%s\n", plug->name);
Con_Printf("%s - \n", plug->name);
VM_PrintInfo(plug->vm);
}
}

View File

@ -947,7 +947,7 @@ void VM_PrintInfo(vm_t *vm)
qvm_t *qvm;
if(!vm->name[0]) return;
Con_Printf("%s: ", vm->name);
Con_Printf("%s (%i): ", vm->name, (int)vm->hInst);
switch(vm->type)
{