diff --git a/plugins/irc/irc.dsp b/plugins/irc/irc.dsp index b0dbbbd5..923836ec 100644 --- a/plugins/irc/irc.dsp +++ b/plugins/irc/irc.dsp @@ -79,7 +79,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"d:\quake\id1\plugins\ircx86.dll" /pdbtype:sept +# ADD LINK32 kernel32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"d:\quake\fte\plugins\ircx86.dll" /pdbtype:sept !ENDIF diff --git a/plugins/irc/ircclient.c b/plugins/irc/ircclient.c index 694c5adb..498abeff 100644 --- a/plugins/irc/ircclient.c +++ b/plugins/irc/ircclient.c @@ -823,8 +823,10 @@ int IRC_ClientFrame(ircclient_t *irc) { char *motdmessage = var[4]+1; - if (irc_motd.value == 1) + if (irc_motd.value == 2) Con_SubPrintf("irc", "MOTD: %s\n", motdmessage); + else if (irc_motd.value) + Con_SubPrintf("irc", "%s\n", motdmessage); } else if (!strncmp(msg, "375 ", 4)) { diff --git a/plugins/jabber/Makefile b/plugins/jabber/Makefile index 34d794f9..d1a07f4c 100644 --- a/plugins/jabber/Makefile +++ b/plugins/jabber/Makefile @@ -1,7 +1,7 @@ all: native native: - gcc -shared -fPIC jabberclient.c ../qvm_api.c ../plugin.c -o jabberx86.so + gcc -shared -fPIC -ggdb jabberclient.c ../qvm_api.c ../plugin.c -o jabberx86.so install: native cp jabberx86.so /opt/quake/fte/plugins/ diff --git a/plugins/plugin.c b/plugins/plugin.c index ea549e47..b208d5ae 100644 --- a/plugins/plugin.c +++ b/plugins/plugin.c @@ -64,7 +64,7 @@ BUILTINR(unsigned int, Sys_Milliseconds, (void)); //get the time the engine has #undef ARGNAMES #define ARGNAMES ,buffer -BUILTIN(void, Cmd_AddCommand, (char *buffer)); //register a command. +BUILTINR(int, Cmd_AddCommand, (char *buffer)); //register a command. #undef ARGNAMES #define ARGNAMES ,buffer,bufsize BUILTIN(void, Cmd_Args, (char *buffer, int bufsize)); //retrieve some arguments. @@ -110,6 +110,10 @@ BUILTIN(void, CL_GetStats, (int pnum, unsigned int *stats, int maxstats)); BUILTIN(void, LocalSound, (char *soundname)); #undef ARGNAMES +#define ARGNAMES ,plugnum, buffer, bufsize +BUILTIN(void, GetPluginName, (int plugnum, char *buffer, int bufsize)); +#undef ARGNAMES + #define ARGNAMES ,name,iswadimage BUILTINR(qhandle_t, Draw_LoadImage, (char *name, qboolean iswadimage)); //wad image is ONLY for loading out of q1 gfx.wad #undef ARGNAMES @@ -308,6 +312,8 @@ void Plug_InitStandardBuiltins(void) CHECKBUILTIN(Media_ShowFrameRGBA_32); + CHECKBUILTIN(GetPluginName); + //sub consoles (optional) CHECKBUILTIN(Con_SubPrint); CHECKBUILTIN(Con_RenameSub); diff --git a/plugins/plugin.h b/plugins/plugin.h index 9bb97962..fe86f080 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -17,7 +17,7 @@ # define BUILTINR(t, n, args) t (*n) args # define BUILTIN(t, n, args) t (*n) args # define CHECKBUILTIN(n) n = (funcptr_t)Plug_GetEngineFunction(#n); -# define BUILTINISVALID(n) n!=NULL +# define BUILTINISVALID(n) (n!=NULL) #endif #define double float //all floats are 32bit, qvm stuff @@ -61,7 +61,7 @@ void BadBuiltin(void); #define BUILTIN(t, n, args) int BUILTIN_##n; t n args {plugin_syscall(BUILTIN_##n ARGNAMES);} #endif #define CHECKBUILTIN(n) BUILTIN_##n = (int)Plug_GetEngineFunction(#n); -#define BUILTINISVALID(n) BUILTIN_##n != 0 +#define BUILTINISVALID(n) (BUILTIN_##n != 0) #ifdef _WIN32 #define QDECL __cdecl #else @@ -91,7 +91,7 @@ EBUILTIN(void, Con_RenameSub, (char *old, char *new)); //rename a console. EBUILTIN(void, Sys_Error, (char *message)); //abort the entire engine. EBUILTIN(unsigned int, Sys_Milliseconds, ()); -EBUILTIN(void, Cmd_AddCommand, (char *buffer)); //abort the entire engine. +EBUILTIN(int, Cmd_AddCommand, (char *buffer)); //abort the entire engine. EBUILTIN(void, Cmd_Args, (char *buffer, int bufsize)); //abort the entire engine. EBUILTIN(void, Cmd_Argv, (int argnum, char *buffer, int bufsize)); //abort the entire engine. EBUILTIN(int, Cmd_Argc, (void)); //abort the entire engine. @@ -105,6 +105,7 @@ EBUILTIN(float, Cvar_GetFloat, (char *name)); EBUILTIN(qhandle_t, Cvar_Register, (char *name, char *defaultval, int flags, char *grouphint)); EBUILTIN(int, Cvar_Update, (qhandle_t handle, int *modificationcount, char *stringv, float *floatv)); //stringv is 256 chars long, don't expect this function to do anything if modification count is unchanged. +EBUILTIN(void, GetPluginName, (int plugnum, char *buffer, int bufsize)); EBUILTIN(void, LocalSound, (char *soundname)); EBUILTIN(void, CL_GetStats, (int pnum, unsigned int *stats, int maxstats));