mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
Added client::print, client::printChat, client::printAll, and
client::printAllChat GIB builtins.
This commit is contained in:
parent
a99c859034
commit
15cc02f17c
1 changed files with 29 additions and 0 deletions
|
@ -109,6 +109,31 @@ SV_GIB_Client_GetInfo_f (void)
|
||||||
GIB_Return (str);
|
GIB_Return (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
SV_GIB_Client_Print_f (void)
|
||||||
|
{
|
||||||
|
client_t *cl;
|
||||||
|
|
||||||
|
if (GIB_Argc() != 3)
|
||||||
|
GIB_USAGE("uid message");
|
||||||
|
else if (!(cl = SV_GIB_GetClient (atoi(GIB_Argv(1)))))
|
||||||
|
GIB_Error ("uid", "No user with id '%s' was found on the server.", GIB_Argv(1));
|
||||||
|
else
|
||||||
|
SV_ClientPrintf (0, cl, GIB_Argv(0)[13] ? PRINT_CHAT : PRINT_HIGH, "%s", GIB_Argv(2));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
SV_GIB_Client_Print_All_f (void)
|
||||||
|
{
|
||||||
|
client_t *cl;
|
||||||
|
int i, level = GIB_Argv(0)[16] ? PRINT_CHAT : PRINT_HIGH;
|
||||||
|
|
||||||
|
if (GIB_Argc() != 2)
|
||||||
|
GIB_USAGE("message");
|
||||||
|
else for (i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++)
|
||||||
|
if (cl->state)
|
||||||
|
SV_ClientPrintf (0, cl, level, "%s", GIB_Argv(1));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SV_GIB_Init (void)
|
SV_GIB_Init (void)
|
||||||
|
@ -117,6 +142,10 @@ SV_GIB_Init (void)
|
||||||
GIB_Builtin_Add ("client::getList", SV_GIB_Client_GetList_f);
|
GIB_Builtin_Add ("client::getList", SV_GIB_Client_GetList_f);
|
||||||
GIB_Builtin_Add ("client::getKeys", SV_GIB_Client_GetKeys_f);
|
GIB_Builtin_Add ("client::getKeys", SV_GIB_Client_GetKeys_f);
|
||||||
GIB_Builtin_Add ("client::getInfo", SV_GIB_Client_GetInfo_f);
|
GIB_Builtin_Add ("client::getInfo", SV_GIB_Client_GetInfo_f);
|
||||||
|
GIB_Builtin_Add ("client::print", SV_GIB_Client_Print_f);
|
||||||
|
GIB_Builtin_Add ("client::printChat", SV_GIB_Client_Print_f);
|
||||||
|
GIB_Builtin_Add ("client::printAll", SV_GIB_Client_Print_All_f);
|
||||||
|
GIB_Builtin_Add ("client::printAllChat", SV_GIB_Client_Print_All_f);
|
||||||
|
|
||||||
// Events
|
// Events
|
||||||
sv_chat_e = GIB_Event_New ("chat");
|
sv_chat_e = GIB_Event_New ("chat");
|
||||||
|
|
Loading…
Reference in a new issue