Fixed some nq server issues
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1537 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
146e8a253f
commit
f7d90f4a0a
2 changed files with 89 additions and 68 deletions
|
@ -1599,8 +1599,12 @@ void SV_UpdateToReliableMessages (void)
|
||||||
|
|
||||||
if (host_client->entgravity != newval)
|
if (host_client->entgravity != newval)
|
||||||
{
|
{
|
||||||
|
if (ISQWCLIENT(host_client))
|
||||||
|
{
|
||||||
|
Con_Printf("svc_entgravity\n");
|
||||||
sp = SV_SplitClientDest(host_client, svc_entgravity, 5);
|
sp = SV_SplitClientDest(host_client, svc_entgravity, 5);
|
||||||
ClientReliableWrite_Float(sp, newval/movevars.gravity); //lie to the client in a cunning way
|
ClientReliableWrite_Float(sp, newval/movevars.gravity); //lie to the client in a cunning way
|
||||||
|
}
|
||||||
host_client->entgravity = newval;
|
host_client->entgravity = newval;
|
||||||
}
|
}
|
||||||
newval = ent->v->maxspeed;
|
newval = ent->v->maxspeed;
|
||||||
|
@ -1617,7 +1621,8 @@ void SV_UpdateToReliableMessages (void)
|
||||||
#endif
|
#endif
|
||||||
if (host_client->maxspeed != newval)
|
if (host_client->maxspeed != newval)
|
||||||
{ //MSVC can really suck at times (optimiser bug)
|
{ //MSVC can really suck at times (optimiser bug)
|
||||||
|
if (ISQWCLIENT(host_client))
|
||||||
|
{
|
||||||
if (host_client->controller)
|
if (host_client->controller)
|
||||||
{ //this is a slave client.
|
{ //this is a slave client.
|
||||||
//find the right number and send.
|
//find the right number and send.
|
||||||
|
@ -1641,6 +1646,7 @@ void SV_UpdateToReliableMessages (void)
|
||||||
ClientReliableWrite_Begin(host_client, svc_maxspeed, 5);
|
ClientReliableWrite_Begin(host_client, svc_maxspeed, 5);
|
||||||
ClientReliableWrite_Float(host_client, newval);
|
ClientReliableWrite_Float(host_client, newval);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
host_client->maxspeed = newval;
|
host_client->maxspeed = newval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2963,6 +2963,7 @@ ucmd_t ucmdsq2[] = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern ucmd_t nqucmds[];
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
SV_ExecuteUserCommand
|
SV_ExecuteUserCommand
|
||||||
|
@ -3001,6 +3002,9 @@ void SV_ExecuteUserCommand (char *s, qboolean fromQC)
|
||||||
u = ucmdsq2;
|
u = ucmdsq2;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
if (ISNQCLIENT(host_client))
|
||||||
|
u = nqucmds;
|
||||||
|
else
|
||||||
u=ucmds;
|
u=ucmds;
|
||||||
|
|
||||||
for ( ; u->name ; u++)
|
for ( ; u->name ; u++)
|
||||||
|
@ -3100,6 +3104,9 @@ void SVNQ_Spawn_f (void)
|
||||||
// send all current light styles
|
// send all current light styles
|
||||||
for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
|
for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
|
||||||
{
|
{
|
||||||
|
if (i >= MAX_STANDARDLIGHTSTYLES && host_client->protocol != SCP_DARKPLACES7)
|
||||||
|
break; //dp7 clients support more lightstyles.
|
||||||
|
|
||||||
ClientReliableWrite_Begin (host_client, svc_lightstyle,
|
ClientReliableWrite_Begin (host_client, svc_lightstyle,
|
||||||
3 + (sv.lightstyles[i] ? strlen(sv.lightstyles[i]) : 1));
|
3 + (sv.lightstyles[i] ? strlen(sv.lightstyles[i]) : 1));
|
||||||
ClientReliableWrite_Byte (host_client, (char)i);
|
ClientReliableWrite_Byte (host_client, (char)i);
|
||||||
|
@ -3459,6 +3466,7 @@ ucmd_t nqucmds[] =
|
||||||
{"ban", NULL},
|
{"ban", NULL},
|
||||||
{"vote", SV_Vote_f},
|
{"vote", SV_Vote_f},
|
||||||
|
|
||||||
|
{"setinfo", SV_SetInfo_f},
|
||||||
{"playermodel", NULL},
|
{"playermodel", NULL},
|
||||||
{"playerskin", NULL},
|
{"playerskin", NULL},
|
||||||
{"rate", SV_Rate_f},
|
{"rate", SV_Rate_f},
|
||||||
|
@ -3469,7 +3477,7 @@ ucmd_t nqucmds[] =
|
||||||
|
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
void SVNQ_ExecuteUserCommand (char *s)
|
void SVNQ_ExecuteUserCommand (char *s)
|
||||||
{
|
{
|
||||||
client_t *oldhost = host_client;
|
client_t *oldhost = host_client;
|
||||||
|
@ -3484,7 +3492,7 @@ void SVNQ_ExecuteUserCommand (char *s)
|
||||||
{
|
{
|
||||||
if (!strcmp (Cmd_Argv(0), u->name) )
|
if (!strcmp (Cmd_Argv(0), u->name) )
|
||||||
{
|
{
|
||||||
if (/*!fromQC && */!u->noqchandling)
|
if (/ *!fromQC && * /!u->noqchandling)
|
||||||
if (PR_UserCmd(s))
|
if (PR_UserCmd(s))
|
||||||
{
|
{
|
||||||
host_client = oldhost;
|
host_client = oldhost;
|
||||||
|
@ -3512,6 +3520,7 @@ void SVNQ_ExecuteUserCommand (char *s)
|
||||||
if (!u->name)
|
if (!u->name)
|
||||||
Con_Printf("%s tried to \"%s\"\n", host_client->name, s);
|
Con_Printf("%s tried to \"%s\"\n", host_client->name, s);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -4677,6 +4686,9 @@ void SVQ2_ExecuteClientMessage (client_t *cl)
|
||||||
s = MSG_ReadString ();
|
s = MSG_ReadString ();
|
||||||
SV_ExecuteUserCommand (s, false);
|
SV_ExecuteUserCommand (s, false);
|
||||||
|
|
||||||
|
host_client = cl;
|
||||||
|
sv_player = cl->edict;
|
||||||
|
|
||||||
if (cl->state == cs_zombie)
|
if (cl->state == cs_zombie)
|
||||||
return; // disconnect command
|
return; // disconnect command
|
||||||
break;
|
break;
|
||||||
|
@ -4862,7 +4874,10 @@ void SVNQ_ExecuteClientMessage (client_t *cl)
|
||||||
|
|
||||||
case clc_stringcmd:
|
case clc_stringcmd:
|
||||||
s = MSG_ReadString ();
|
s = MSG_ReadString ();
|
||||||
SVNQ_ExecuteUserCommand (s);
|
SV_ExecuteUserCommand (s, false);
|
||||||
|
|
||||||
|
host_client = cl;
|
||||||
|
sv_player = cl->edict;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue