Cleaning up some logic and coding style.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2400 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
b4cb2a66b6
commit
83bcdc0cc7
2 changed files with 23 additions and 15 deletions
|
@ -498,14 +498,14 @@ void SV_DropClient (client_t *drop)
|
|||
drop->frameunion.frames = NULL;
|
||||
}
|
||||
|
||||
if (svs.gametype != GT_PROGS) //gamecode should do it all for us.
|
||||
return;
|
||||
|
||||
if (svs.gametype == GT_PROGS) //gamecode should do it all for us.
|
||||
{
|
||||
// send notification to all remaining clients
|
||||
SV_FullClientUpdate (drop, &sv.reliable_datagram, 0);
|
||||
#ifdef NQPROT
|
||||
SVNQ_FullClientUpdate (drop, &sv.nqreliable_datagram);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (drop->controlled)
|
||||
{
|
||||
|
@ -3594,17 +3594,21 @@ void SV_ExtractFromUserinfo (client_t *cl)
|
|||
|
||||
if (strncmp(newname, cl->name, sizeof(cl->namebuf)-1))
|
||||
{
|
||||
if (cl->ismuted)
|
||||
if (cl->ismuted && *cl->name)
|
||||
SV_ClientTPrintf (cl, PRINT_HIGH, STL_NONAMEASMUTE);
|
||||
else
|
||||
{
|
||||
|
||||
Info_SetValueForKey (cl->userinfo, "name", newname, sizeof(cl->userinfo));
|
||||
if (!sv.paused) {
|
||||
if (!cl->lastnametime || realtime - cl->lastnametime > 5) {
|
||||
if (!sv.paused && *cl->name)
|
||||
{
|
||||
if (!cl->lastnametime || realtime - cl->lastnametime > 5)
|
||||
{
|
||||
cl->lastnamecount = 0;
|
||||
cl->lastnametime = realtime;
|
||||
} else if (cl->lastnamecount++ > 4) {
|
||||
}
|
||||
else if (cl->lastnamecount++ > 4)
|
||||
{
|
||||
SV_BroadcastTPrintf (PRINT_HIGH, STL_CLIENTKICKEDNAMESPAM, cl->name);
|
||||
SV_ClientTPrintf (cl, PRINT_HIGH, STL_YOUWEREKICKEDNAMESPAM);
|
||||
SV_DropClient (cl);
|
||||
|
@ -3612,7 +3616,7 @@ void SV_ExtractFromUserinfo (client_t *cl)
|
|||
}
|
||||
}
|
||||
|
||||
if (cl->state >= cs_spawned && !cl->spectator)
|
||||
if (*cl->name && cl->state >= cs_spawned && !cl->spectator)
|
||||
{
|
||||
SV_BroadcastTPrintf (PRINT_HIGH, STL_CLIENTNAMECHANGE, cl->name, val);
|
||||
}
|
||||
|
|
|
@ -4102,23 +4102,27 @@ void SV_RunCmd (usercmd_t *ucmd, qboolean recurse)
|
|||
// (also extra inside parm on all SV_RunCmds that follow)
|
||||
|
||||
// To prevent a infinite loop
|
||||
if (!recurse) {
|
||||
if (!recurse)
|
||||
{
|
||||
host_client->msecs += ucmd->msec;
|
||||
|
||||
if ((tmp_time = realtime - host_client->last_check) >= sv_cheatspeedchecktime.value) {
|
||||
if ((tmp_time = realtime - host_client->last_check) >= sv_cheatspeedchecktime.value)
|
||||
{
|
||||
tmp_time = tmp_time * 1000.0 * sv_cheatpc.value/100.0;
|
||||
if (host_client->msecs > tmp_time) {
|
||||
if (host_client->msecs > tmp_time)
|
||||
{
|
||||
host_client->msec_cheating++;
|
||||
SV_BroadcastTPrintf(PRINT_HIGH,
|
||||
STL_SPEEDCHEATPOSSIBLE,
|
||||
host_client->msecs, tmp_time,
|
||||
host_client->msec_cheating, host_client->name);
|
||||
|
||||
if (host_client->msec_cheating >= 2) {
|
||||
if (host_client->msec_cheating >= 2)
|
||||
{
|
||||
SV_BroadcastTPrintf(PRINT_HIGH,
|
||||
STL_SPEEDCHEATKICKED,
|
||||
host_client->name, NET_AdrToString(host_client->netchan.remote_address));
|
||||
SV_DropClient(host_client);
|
||||
host_client->drop = true; //drop later
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue