mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
Add rcon command, let csqc handle some relevant console commands.
This commit is contained in:
parent
77c3e2e1c6
commit
88db885ccc
9 changed files with 186 additions and 30 deletions
|
@ -529,6 +529,8 @@ CL_InitInput
|
|||
*/
|
||||
void CL_InitInput (void)
|
||||
{
|
||||
#undef Cmd_AddCommand
|
||||
#define Cmd_AddCommand(cmd,fnc) Cmd_AddCommand2(cmd,fnc,src_command,true)
|
||||
Cmd_AddCommand ("+moveup",IN_UpDown);
|
||||
Cmd_AddCommand ("-moveup",IN_UpUp);
|
||||
Cmd_AddCommand ("+movedown",IN_DownDown);
|
||||
|
|
|
@ -1227,6 +1227,31 @@ static void CL_ParseStartSoundPacket(void)
|
|||
for (i = 0; i < 3; i++)
|
||||
pos[i] = MSG_ReadCoord (cl.protocolflags);
|
||||
|
||||
|
||||
|
||||
if (cl.qcvm.extfuncs.CSQC_Event_Sound && cl.sound_precache[sound_num] && !cl.qcvm.nogameaccess)
|
||||
{ //blocked with csqc, too easy to do dead-reckoning.
|
||||
qboolean ret = false;
|
||||
PR_SwitchQCVM(&cl.qcvm);
|
||||
|
||||
if (qcvm->extglobals.player_localentnum)
|
||||
*qcvm->extglobals.player_localentnum = cl.viewentity;
|
||||
|
||||
G_FLOAT(OFS_PARM0) = ent;
|
||||
G_FLOAT(OFS_PARM1) = channel;
|
||||
G_INT(OFS_PARM2) = PR_MakeTempString(cl.sound_precache[sound_num]->name);
|
||||
G_FLOAT(OFS_PARM3) = volume;
|
||||
G_FLOAT(OFS_PARM4) = attenuation;
|
||||
VectorCopy(pos, G_VECTOR(OFS_PARM5));
|
||||
G_FLOAT(OFS_PARM6) = 100;
|
||||
G_FLOAT(OFS_PARM7) = field_mask>>8;
|
||||
PR_ExecuteProgram(cl.qcvm.extfuncs.CSQC_Event_Sound);
|
||||
ret = G_FLOAT(OFS_RETURN);
|
||||
PR_SwitchQCVM(NULL);
|
||||
if (ret)
|
||||
return;
|
||||
}
|
||||
|
||||
S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0, attenuation);
|
||||
}
|
||||
|
||||
|
|
|
@ -695,7 +695,7 @@ Cmd_AddCommand
|
|||
spike -- added an extra arg for client (also renamed and made a macro)
|
||||
============
|
||||
*/
|
||||
cmd_function_t *Cmd_AddCommand2 (const char *cmd_name, xcommand_t function, cmd_source_t srctype)
|
||||
cmd_function_t *Cmd_AddCommand2 (const char *cmd_name, xcommand_t function, cmd_source_t srctype, qboolean qcinterceptable)
|
||||
{
|
||||
cmd_function_t *cmd;
|
||||
cmd_function_t *cursor,*prev; //johnfitz -- sorted list insert
|
||||
|
@ -732,6 +732,7 @@ cmd_function_t *Cmd_AddCommand2 (const char *cmd_name, xcommand_t function, cmd_
|
|||
}
|
||||
cmd->function = function;
|
||||
cmd->srctype = srctype;
|
||||
cmd->qcinterceptable = qcinterceptable;
|
||||
|
||||
//johnfitz -- insert each entry in alphabetical order
|
||||
if (cmd_functions == NULL || strcmp(cmd->name, cmd_functions->name) < 0) //insert at front
|
||||
|
@ -845,16 +846,23 @@ qboolean Cmd_ExecuteString (const char *text, cmd_source_t src)
|
|||
if (!q_strcasecmp (cmd_argv[0],cmd->name))
|
||||
{
|
||||
if (src == src_client && cmd->srctype != src_client)
|
||||
Con_DPrintf("%s tried to %s\n", host_client->name, text); //src_client only allows client commands
|
||||
continue;
|
||||
else if (src == src_command && cmd->srctype == src_server)
|
||||
continue; //src_command can execute anything but server commands (which it ignores, allowing for alternative behaviour)
|
||||
else if (src == src_server && cmd->srctype != src_server)
|
||||
continue; //src_server may only execute server commands (such commands must be safe to parse within the context of a network message, so no disconnect/connect/playdemo/etc)
|
||||
else if (cmd->function)
|
||||
cmd->function ();
|
||||
else
|
||||
{
|
||||
qboolean ret = false;
|
||||
qcvm_t *oldvm;
|
||||
if (!ret && cmd->function && (!cmd->qcinterceptable || src == src_client))
|
||||
{
|
||||
cmd->function ();
|
||||
ret = true;
|
||||
}
|
||||
oldvm = ret?NULL:qcvm;
|
||||
if (oldvm)
|
||||
PR_SwitchQCVM(NULL);
|
||||
if (!ret && cl.qcvm.extfuncs.CSQC_ConsoleCommand)
|
||||
{
|
||||
PR_SwitchQCVM(&cl.qcvm);
|
||||
|
@ -871,9 +879,15 @@ qboolean Cmd_ExecuteString (const char *text, cmd_source_t src)
|
|||
ret = G_FLOAT(OFS_RETURN);
|
||||
PR_SwitchQCVM(NULL);
|
||||
}
|
||||
if (oldvm)
|
||||
PR_SwitchQCVM(oldvm);
|
||||
if (!ret && cmd->function)
|
||||
{
|
||||
cmd->function ();
|
||||
ret = true;
|
||||
}
|
||||
if (!ret)
|
||||
Con_Printf ("gamecode not running, cannot \"%s\"\n", Cmd_Argv(0));
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -95,18 +95,19 @@ typedef struct cmd_function_s
|
|||
xcommand_t function;
|
||||
cmd_source_t srctype;
|
||||
qboolean dynamic;
|
||||
qboolean qcinterceptable;
|
||||
} cmd_function_t;
|
||||
|
||||
void Cmd_Init (void);
|
||||
|
||||
cmd_function_t *Cmd_AddCommand2 (const char *cmd_name, xcommand_t function, cmd_source_t srctype);
|
||||
cmd_function_t *Cmd_AddCommand2 (const char *cmd_name, xcommand_t function, cmd_source_t srctype, qboolean qcinterceptable);
|
||||
void Cmd_RemoveCommand (cmd_function_t *cmd);
|
||||
// called by the init functions of other parts of the program to
|
||||
// register commands and functions to call for them.
|
||||
// The cmd_name is referenced later, so it should not be in temp memory
|
||||
#define Cmd_AddCommand(cmdname,func) Cmd_AddCommand2(cmdname,func,src_command) //regular console commands
|
||||
#define Cmd_AddCommand_ClientCommand(cmdname,func) Cmd_AddCommand2(cmdname,func,src_client) //command is meant to be safe for anyone to execute.
|
||||
#define Cmd_AddCommand_ServerCommand(cmdname,func) Cmd_AddCommand2(cmdname,func,src_server) //command came from a server
|
||||
#define Cmd_AddCommand(cmdname,func) Cmd_AddCommand2(cmdname,func,src_command,false) //regular console commands
|
||||
#define Cmd_AddCommand_ClientCommand(cmdname,func) Cmd_AddCommand2(cmdname,func,src_client,false) //command is meant to be safe for anyone to execute.
|
||||
#define Cmd_AddCommand_ServerCommand(cmdname,func) Cmd_AddCommand2(cmdname,func,src_server,false) //command came from a server
|
||||
#define Cmd_AddCommand_Console Cmd_AddCommand //to make the disabiguation more obvious
|
||||
|
||||
qboolean Cmd_AliasExists (const char *aliasname);
|
||||
|
|
|
@ -758,7 +758,7 @@ static void CL_LoadCSProgs(void)
|
|||
//try csprogs.dat first, then fall back on progs.dat in case someone tried merging the two.
|
||||
//we only care about it if it actually contains a CSQC_DrawHud, otherwise its either just a (misnamed) ssqc progs or a full csqc progs that would just crash us on 3d stuff.
|
||||
if ((PR_LoadProgs(versionedname, false, PROGHEADER_CRC, pr_csqcbuiltins, pr_csqcnumbuiltins) && (qcvm->extfuncs.CSQC_DrawHud||cl.qcvm.extfuncs.CSQC_UpdateView))||
|
||||
(PR_LoadProgs("csprogs.dat", false, PROGHEADER_CRC, pr_csqcbuiltins, pr_csqcnumbuiltins) && (qcvm->extfuncs.CSQC_DrawHud||cl.qcvm.extfuncs.CSQC_UpdateView))||
|
||||
(PR_LoadProgs("csprogs.dat", false, PROGHEADER_CRC, pr_csqcbuiltins, pr_csqcnumbuiltins) && (qcvm->extfuncs.CSQC_DrawHud||qcvm->extfuncs.CSQC_DrawScores||cl.qcvm.extfuncs.CSQC_UpdateView))||
|
||||
(PR_LoadProgs("progs.dat", false, PROGHEADER_CRC, pr_csqcbuiltins, pr_csqcnumbuiltins) && (qcvm->extfuncs.CSQC_DrawHud||cl.qcvm.extfuncs.CSQC_UpdateView)))
|
||||
{
|
||||
qcvm->max_edicts = CLAMP (MIN_EDICTS,(int)max_edicts.value,MAX_EDICTS);
|
||||
|
|
|
@ -2828,6 +2828,8 @@ Host_InitCommands
|
|||
*/
|
||||
void Host_InitCommands (void)
|
||||
{
|
||||
#define Cmd_AddCommand_ClientCommandQC(cmd,fnc) Cmd_AddCommand2(cmd,fnc,src_client,true)
|
||||
|
||||
Cmd_AddCommand ("maps", Host_Maps_f); //johnfitz
|
||||
Cmd_AddCommand ("mods", Host_Mods_f); //johnfitz
|
||||
Cmd_AddCommand ("games", Host_Mods_f); // as an alias to "mods" -- S.A. / QuakeSpasm
|
||||
|
@ -2840,9 +2842,9 @@ void Host_InitCommands (void)
|
|||
|
||||
Cmd_AddCommand_ClientCommand ("status", Host_Status_f);
|
||||
Cmd_AddCommand ("quit", Host_Quit_f);
|
||||
Cmd_AddCommand_ClientCommand ("god", Host_God_f);
|
||||
Cmd_AddCommand_ClientCommand ("notarget", Host_Notarget_f);
|
||||
Cmd_AddCommand_ClientCommand ("fly", Host_Fly_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("god", Host_God_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("notarget", Host_Notarget_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("fly", Host_Fly_f);
|
||||
Cmd_AddCommand ("map", Host_Map_f);
|
||||
Cmd_AddCommand ("restart", Host_Restart_f);
|
||||
Cmd_AddCommand ("changelevel", Host_Changelevel_f);
|
||||
|
@ -2851,23 +2853,23 @@ void Host_InitCommands (void)
|
|||
Cmd_AddCommand_ServerCommand ("reconnect", Host_Reconnect_Sv_f);
|
||||
Cmd_AddCommand_ServerCommand ("ls", Host_Lightstyle_f);
|
||||
Cmd_AddCommand_ClientCommand ("name", Host_Name_f);
|
||||
Cmd_AddCommand_ClientCommand ("noclip", Host_Noclip_f);
|
||||
Cmd_AddCommand_ClientCommand ("setpos", Host_SetPos_f); //QuakeSpasm
|
||||
Cmd_AddCommand_ClientCommandQC ("noclip", Host_Noclip_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("setpos", Host_SetPos_f); //QuakeSpasm
|
||||
|
||||
Cmd_AddCommand_ClientCommand ("say", Host_Say_f);
|
||||
Cmd_AddCommand_ClientCommand ("say_team", Host_Say_Team_f);
|
||||
Cmd_AddCommand_ClientCommand ("tell", Host_Tell_f);
|
||||
Cmd_AddCommand_ClientCommand ("color", Host_Color_f);
|
||||
Cmd_AddCommand_ClientCommand ("kill", Host_Kill_f);
|
||||
Cmd_AddCommand_ClientCommand ("pause", Host_Pause_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("say", Host_Say_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("say_team", Host_Say_Team_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("tell", Host_Tell_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("color", Host_Color_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("kill", Host_Kill_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("pause", Host_Pause_f);
|
||||
Cmd_AddCommand_ClientCommand ("spawn", Host_Spawn_f);
|
||||
Cmd_AddCommand_ClientCommand ("begin", Host_Begin_f);
|
||||
Cmd_AddCommand_ClientCommand ("prespawn", Host_PreSpawn_f);
|
||||
Cmd_AddCommand_ClientCommand ("kick", Host_Kick_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("kick", Host_Kick_f);
|
||||
Cmd_AddCommand_ClientCommand ("ping", Host_Ping_f);
|
||||
Cmd_AddCommand ("load", Host_Loadgame_f);
|
||||
Cmd_AddCommand ("save", Host_Savegame_f);
|
||||
Cmd_AddCommand_ClientCommand ("give", Host_Give_f);
|
||||
Cmd_AddCommand_ClientCommandQC ("give", Host_Give_f);
|
||||
Cmd_AddCommand_ClientCommand ("download", Host_Download_f);
|
||||
Cmd_AddCommand_ClientCommand ("sv_startdownload", Host_StartDownload_f);
|
||||
Cmd_AddCommand_ClientCommand ("enablecsqc", Host_EnableCSQC_f);
|
||||
|
|
|
@ -464,6 +464,11 @@ qsocket_t *Datagram_GetAnyMessage(void)
|
|||
if (BigLong(packetBuffer.length) & NETFLAG_CTL)
|
||||
{
|
||||
_Datagram_ServerControlPacket(sock, &addr, (byte *)&packetBuffer, length);
|
||||
|
||||
//rcon can mess some stuff up...
|
||||
sock = dfunc.listeningSock;
|
||||
if (sock == INVALID_SOCKET)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -570,7 +575,18 @@ int Datagram_GetMessage (qsocket_t *sock)
|
|||
length &= NETFLAG_LENGTH_MASK;
|
||||
|
||||
if (flags & NETFLAG_CTL)
|
||||
{
|
||||
SZ_Clear (&net_message);
|
||||
SZ_Write (&net_message, (byte*)&packetBuffer + 4, length-4);
|
||||
MSG_BeginReading();
|
||||
switch(MSG_ReadByte())
|
||||
{
|
||||
case CCREP_RCON:
|
||||
Con_Printf("%s\n", MSG_ReadString());
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
sequence = BigLong(packetBuffer.sequence);
|
||||
packetsReceived++;
|
||||
|
@ -1027,6 +1043,24 @@ JustDoIt:
|
|||
SchedulePollProcedure(&test2PollProcedure, 0.05);
|
||||
}
|
||||
|
||||
void NET_Rcon_f(void)
|
||||
{
|
||||
qsocket_t *sock = cls.netcon;
|
||||
|
||||
if (!sock || !net_drivers[sock->driver].initialized || net_drivers[sock->driver].SendUnreliableMessage != Datagram_SendUnreliableMessage)
|
||||
return; //not dgram. probably loopback. just use the proper command or something.
|
||||
|
||||
SZ_Clear(&net_message);
|
||||
MSG_WriteLong(&net_message, 0);
|
||||
MSG_WriteByte(&net_message, CCREQ_RCON);
|
||||
MSG_WriteString(&net_message, rcon_password.string);
|
||||
MSG_WriteString(&net_message, Cmd_Args());
|
||||
|
||||
*(int*)net_message.data = BigLong(NETFLAG_CTL | (net_message.cursize & NETFLAG_LENGTH_MASK));
|
||||
|
||||
if (sfunc.Write (sock->socket, net_message.data, net_message.cursize, &sock->addr) == -1)
|
||||
return;
|
||||
}
|
||||
|
||||
int Datagram_Init (void)
|
||||
{
|
||||
|
@ -1064,6 +1098,7 @@ int Datagram_Init (void)
|
|||
#endif
|
||||
Cmd_AddCommand ("test", Test_f);
|
||||
Cmd_AddCommand ("test2", Test2_f);
|
||||
Cmd_AddCommand ("rcon", NET_Rcon_f);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1369,9 +1404,15 @@ static void _Datagram_ServerControlPacket (sys_socket_t acceptsock, struct qsock
|
|||
response = "rcon is not enabled on this server";
|
||||
else if (!strcmp(password, rcon_password.string))
|
||||
{
|
||||
qcvm_t *oldvm = qcvm;
|
||||
Con_Redirect(Datagram_Rcon_Flush);
|
||||
PR_SwitchQCVM(NULL);
|
||||
Cmd_ExecuteString(MSG_ReadString(), src_command);
|
||||
PR_SwitchQCVM(oldvm);
|
||||
Con_Redirect(NULL);
|
||||
net_landriverlevel = rcon_response_landriver;
|
||||
if (!sv.active)
|
||||
Host_EndGame("Server shut down from rcon."); //stuff got cleaned up that parent functions care about... like the socket.
|
||||
return;
|
||||
}
|
||||
else if (!strcmp(password, "password"))
|
||||
|
|
|
@ -1818,6 +1818,16 @@ static void PF_cl_setmodelindex(void)
|
|||
SetMinMaxSize (e, vec3_origin, vec3_origin, true);
|
||||
}
|
||||
|
||||
static void PF_modelnameforidx(void)
|
||||
{
|
||||
int idx = G_FLOAT(OFS_PARM0);
|
||||
qmodel_t *mod = qcvm->GetModel(idx);
|
||||
if (mod)
|
||||
G_INT(OFS_RETURN) = PR_MakeTempString(mod->name);
|
||||
else
|
||||
G_INT(OFS_RETURN) = 0;
|
||||
}
|
||||
|
||||
static void PF_frameforname(void)
|
||||
{
|
||||
unsigned int modelindex = G_FLOAT(OFS_PARM0);
|
||||
|
@ -2900,6 +2910,9 @@ static void PF_fopen(void)
|
|||
}
|
||||
file = fopen(name, "wb");
|
||||
break;
|
||||
default:
|
||||
Con_Warning("PF_fopen: unsupported mode: %i\n", fmode);
|
||||
return;
|
||||
}
|
||||
if (!file)
|
||||
return;
|
||||
|
@ -6817,6 +6830,7 @@ static void PF_checkpvs (void)
|
|||
|
||||
enum getrenderentityfield_e
|
||||
{
|
||||
//DP's range
|
||||
GE_MAXENTS = -1,
|
||||
GE_ACTIVE = 0,
|
||||
GE_ORIGIN = 1,
|
||||
|
@ -6835,6 +6849,27 @@ enum getrenderentityfield_e
|
|||
// GE_ABSMIN = 14,
|
||||
// GE_ABSMAX = 15,
|
||||
// GE_LIGHT = 16,
|
||||
|
||||
//FTE's range.
|
||||
GE_MODELINDEX = 200,
|
||||
// GE_MODELINDEX2 = 201,
|
||||
GE_EFFECTS = 202,
|
||||
GE_FRAME = 203,
|
||||
GE_ANGLES = 204,
|
||||
// GE_FATNESS = 205,
|
||||
// GE_DRAWFLAGS = 206,
|
||||
// GE_ABSLIGHT = 207,
|
||||
// GE_GLOWMOD = 208,
|
||||
// GE_GLOWSIZE = 209,
|
||||
// GE_GLOWCOLOUR = 210,
|
||||
// GE_RTSTYLE = 211,
|
||||
// GE_RTPFLAGS = 212,
|
||||
// GE_RTCOLOUR = 213,
|
||||
// GE_RTRADIUS = 214,
|
||||
GE_TAGENTITY = 215,
|
||||
GE_TAGINDEX = 216,
|
||||
// GE_GRAVITYDIR = 217,
|
||||
GE_TRAILEFFECTNUM = 218,
|
||||
};
|
||||
static void PF_cl_getrenderentity(void)
|
||||
{
|
||||
|
@ -6934,8 +6969,42 @@ static void PF_cl_getrenderentity(void)
|
|||
// case GE_ABSMIN:
|
||||
// case GE_ABSMAX:
|
||||
// case GE_LIGHT:
|
||||
case GE_MODELINDEX:
|
||||
G_FLOAT(OFS_RETURN+0) = cl.entities[entnum].netstate.modelindex;
|
||||
break;
|
||||
// case GE_MODELINDEX2:
|
||||
case GE_EFFECTS:
|
||||
G_FLOAT(OFS_RETURN+0) = cl.entities[entnum].effects;
|
||||
break;
|
||||
case GE_FRAME:
|
||||
G_FLOAT(OFS_RETURN+0) = cl.entities[entnum].frame;
|
||||
break;
|
||||
case GE_ANGLES:
|
||||
VectorCopy(cl.entities[entnum].angles, G_VECTOR(OFS_RETURN));
|
||||
break;
|
||||
// case GE_FATNESS:
|
||||
// case GE_DRAWFLAGS:
|
||||
// case GE_ABSLIGHT:
|
||||
// case GE_GLOWMOD:
|
||||
// case GE_GLOWSIZE:
|
||||
// case GE_GLOWCOLOUR:
|
||||
// case GE_RTSTYLE:
|
||||
// case GE_RTPFLAGS:
|
||||
// case GE_RTCOLOUR:
|
||||
// case GE_RTRADIUS:
|
||||
case GE_TAGENTITY:
|
||||
G_FLOAT(OFS_RETURN+0) = cl.entities[entnum].netstate.tagentity;
|
||||
break;
|
||||
case GE_TAGINDEX:
|
||||
G_FLOAT(OFS_RETURN+0) = cl.entities[entnum].netstate.tagindex;
|
||||
break;
|
||||
// case GE_GRAVITYDIR:
|
||||
case GE_TRAILEFFECTNUM:
|
||||
G_FLOAT(OFS_RETURN+0) = cl.entities[entnum].netstate.traileffectnum;
|
||||
break;
|
||||
|
||||
case GE_MAXENTS:
|
||||
// default:
|
||||
default:
|
||||
Con_Printf("PF_cl_getrenderentity(,%i): not implemented\n", fldnum);
|
||||
break;
|
||||
}
|
||||
|
@ -7150,7 +7219,7 @@ static struct
|
|||
{"getstats", PF_NoSSQC, PF_cl_getstat_string,332, PF_NoMenu, D("string(float stnum)", "Retrieves the value of the given EV_STRING stat, as a tempstring.\nString stats use a separate pool of stats from numeric ones.\n")},
|
||||
// {"getplayerstat", PF_NoSSQC, PF_FullCSQCOnly, 0, PF_NoMenu, D("__variant(float playernum, float statnum, float stattype)", "Retrieves a specific player's stat, matching the type specified on the server. This builtin is primarily intended for mvd playback where ALL players are known. For EV_ENTITY, world will be returned if the entity is not in the pvs, use type-punning with EV_INTEGER to get the entity number if you just want to see if its set. STAT_ITEMS should be queried as an EV_INTEGER on account of runes and items2 being packed into the upper bits.")},
|
||||
{"setmodelindex", PF_sv_setmodelindex,PF_cl_setmodelindex,333, PF_NoMenu, D("void(entity e, float mdlindex)", "Sets a model by precache index instead of by name. Otherwise identical to setmodel.")},//
|
||||
// {"modelnameforindex",PF_modelnameforidx,PF_modelnameforidx, 334, PF_NoMenu, D("string(float mdlindex)", "Retrieves the name of the model based upon a precache index. This can be used to reduce csqc network traffic by enabling model matching.")},//
|
||||
{"modelnameforindex",PF_modelnameforidx,PF_modelnameforidx, 334, PF_NoMenu, D("string(float mdlindex)", "Retrieves the name of the model based upon a precache index. This can be used to reduce csqc network traffic by enabling model matching.")},//
|
||||
{"particleeffectnum",PF_sv_particleeffectnum,PF_cl_particleeffectnum,335,PF_NoMenu, D("float(string effectname)", "Precaches the named particle effect. If your effect name is of the form 'foo.bar' then particles/foo.cfg will be loaded by the client if foo.bar was not already defined.\nDifferent engines will have different particle systems, this specifies the QC API only.")},// (EXT_CSQC)
|
||||
{"trailparticles", PF_sv_trailparticles,PF_cl_trailparticles,336, PF_NoMenu, D("void(float effectnum, entity ent, vector start, vector end)", "Draws the given effect between the two named points. If ent is not world, distances will be cached in the entity in order to avoid framerate dependancies. The entity is not otherwise used.")},// (EXT_CSQC),
|
||||
{"pointparticles", PF_sv_pointparticles,PF_cl_pointparticles,337, PF_NoMenu, D("void(float effectnum, vector origin, optional vector dir, optional float count)", "Spawn a load of particles from the given effect at the given point traveling or aiming along the direction specified. The number of particles are scaled by the count argument.")},// (EXT_CSQC)
|
||||
|
@ -7476,6 +7545,7 @@ static struct
|
|||
#endif
|
||||
{"DP_TE_STANDARDEFFECTBUILTINS"},
|
||||
{"EXT_BITSHIFT"},
|
||||
{"EXT_CSQC"},
|
||||
{"FRIK_FILE"}, //lacks the file part, but does have the strings part.
|
||||
{"FTE_CSQC_SERVERBROWSER"}, //callable from csqc too, for feature parity.
|
||||
{"FTE_ENT_SKIN_CONTENTS"}, //SOLID_BSP&&skin==CONTENTS_FOO changes CONTENTS_SOLID to CONTENTS_FOO, allowing you to swim in moving ents without qc hacks, as well as correcting view cshifts etc.
|
||||
|
|
|
@ -176,28 +176,29 @@ struct pr_extfuncs_s
|
|||
QCEXTFUNC(SV_RunClientCommand, "void()") \
|
||||
/*csqc*/
|
||||
#define QCEXTFUNCS_CS \
|
||||
QCEXTFUNC(CSQC_Init, "void(float apilevel, string enginename, float engineversion)") \
|
||||
QCEXTFUNC(CSQC_Shutdown, "void()") \
|
||||
QCEXTFUNC(CSQC_Init, "void(float apilevel, string enginename, float engineversion)") \
|
||||
QCEXTFUNC(CSQC_Shutdown, "void()") \
|
||||
QCEXTFUNC(CSQC_DrawHud, "void(vector virtsize, float showscores)") /*simple: for the simple(+limited) hud-only csqc interface.*/ \
|
||||
QCEXTFUNC(CSQC_DrawScores, "void(vector virtsize, float showscores)") /*simple: (optional) for the simple hud-only csqc interface.*/ \
|
||||
QCEXTFUNC(CSQC_InputEvent, "float(float evtype, float scanx, float chary, float devid)") \
|
||||
QCEXTFUNC(CSQC_ConsoleCommand, "float(string cmdstr)") \
|
||||
QCEXTFUNC(CSQC_Parse_Event, "void()") \
|
||||
QCEXTFUNC(CSQC_Parse_Damage, "float(float save, float take, vector dir)") \
|
||||
QCEXTFUNC(CSQC_Parse_Damage, "float(float save, float take, vector dir)") \
|
||||
QCEXTFUNC(CSQC_UpdateView, "void(float vwidth, float vheight, float notmenu)") /*full only: for the full csqc-draws-entire-screen interface*/ \
|
||||
QCEXTFUNC(CSQC_Input_Frame, "void()") /*full only: input angles stuff.*/ \
|
||||
QCEXTFUNC(CSQC_Parse_CenterPrint, "float(string msg)") \
|
||||
QCEXTFUNC(CSQC_Parse_Print, "void(string printmsg, float printlvl)") \
|
||||
QCEXTFUNC(CSQC_Ent_Update, "void(float isnew)") /*full: lots of reads needed to interpret the bytestream*/ \
|
||||
QCEXTFUNC(CSQC_Ent_Remove, "void()") /*full: basically just remove(self)*/\
|
||||
QCEXTFUNC(CSQC_Parse_TempEntity, "float()") /*full: evil... This is the bane of all protocol compatibility. Die.*/ \
|
||||
QCEXTFUNC(CSQC_Event_Sound, "void(float entnum, float channel, string soundname, float vol, float attenuation, vector pos, float pitchmod, float flags)") /*full: basically just remove(self)*/\
|
||||
QCEXTFUNC(CSQC_Parse_TempEntity, "float()") /*full: evil... This is the bane of all protocol compatibility. Die.*/ \
|
||||
QCEXTFUNC(CSQC_Parse_StuffCmd, "void(string msg)") /*full only: not in simple. Too easy to make cheats by ignoring server messages.*/ \
|
||||
/*menucsqc*/
|
||||
#define QCEXTFUNCS_MENU \
|
||||
QCEXTFUNC(m_init, "void()") \
|
||||
QCEXTFUNC(m_toggle, "void(float wantmode)") /*-1: toggle, 0: clear, 1: force*/ \
|
||||
QCEXTFUNC(m_draw, "void(vector screensize)") \
|
||||
QCEXTFUNC(m_keydown, "void(float scan, float chr)") /*obsoleted by Menu_InputEvent, included for dp compat.*/ \
|
||||
QCEXTFUNC(m_keydown, "void(float scan, float chr)") /*obsoleted by Menu_InputEvent, included for dp compat.*/ \
|
||||
QCEXTFUNC(m_keyup, "void(float scan, float chr)") /*obsoleted by Menu_InputEvent, included for dp compat.*/ \
|
||||
QCEXTFUNC(m_consolecommand, "float(string cmd)") \
|
||||
QCEXTFUNC(Menu_InputEvent, "float(float evtype, float scanx, float chary, float devid)") \
|
||||
|
|
Loading…
Reference in a new issue