/* Kicks the given (client) edict out of the server, reason will be printed before */ static void KickClient(edict_t * target, char *reason) { if (target && target->client && target->inuse) { gi.bprintf(PRINT_HIGH, "%s has to be KICKED from the server.\n", target->client->pers.netname); gi.bprintf(PRINT_MEDIUM, "Reason: %s\n", reason); Kick_Client(target); } }
/* =========== VideoCheckClient =========== */ void VideoCheckClient (edict_t * ent) { if (!ent->client->resp.vidref) return; if (video_check_lockpvs->value) { if (ent->client->resp.gllockpvs != 0) { gi.cprintf (ent, PRINT_HIGH, "This server does not allow using that value for gl_lockpvs, set it to '0'\n"); gi.bprintf (PRINT_HIGH, "%s was using an illegal setting\n", ent->client->pers.netname); Kick_Client (ent); return; } } if (video_check_glclear->value) { if (ent->client->resp.glclear != 0) { gi.cprintf (ent, PRINT_HIGH, "This server does not allow using that value for gl_clear, set it to '0'\n"); gi.bprintf (PRINT_HIGH, "%s was using an illegal setting\n", ent->client->pers.netname); Kick_Client (ent); return; } } if (darkmatch->value) { if (ent->client->resp.gldynamic !=1) { gi.cprintf (ent, PRINT_HIGH, "This server does not allow using that value for gl_dynamic, set it to '1'\n"); gi.bprintf (PRINT_HIGH, "%s was using an illegal setting\n", ent->client->pers.netname); Kick_Client (ent); return; } } //Starting Modulate checks if(video_check->value) { if (Q_stricmp (ent->client->resp.gldriver, "3dfxgl") == 0) { if (ent->client->resp.glmodulate > video_max_3dfx->value) { gi.cprintf (ent, PRINT_HIGH, "Your gl_modulate value is too high for this server. Max Allowed is %.1f\n", video_max_3dfx->value); gi.bprintf (PRINT_HIGH, "%s is using a gl_modulated higher than allowed (%.1f)\n", ent->client->pers.netname, ent->client->resp.glmodulate); Kick_Client (ent); return; } return; } if (Q_stricmp (ent->client->resp.gldriver, "opengl32") == 0) { if (ent->client->resp.glmodulate > video_max_opengl->value) { gi.cprintf (ent, PRINT_HIGH, "Your gl_modulate value is too high for this server. Max Allowed is %.1f\n", video_max_opengl->value); gi.bprintf (PRINT_HIGH, "%s is using a gl_modulate higher than allowed (%.1f)\n", ent->client->pers.netname, ent->client->resp.glmodulate); Kick_Client (ent); return; } return; } if (Q_stricmp (ent->client->resp.gldriver, "3dfxglam") == 0) { if (ent->client->resp.glmodulate > video_max_3dfxam->value) { gi.cprintf (ent, PRINT_HIGH, "Your gl_modulate value is too high for this server. Max Allowed is %.1f\n", video_max_3dfxam->value); gi.bprintf (PRINT_HIGH, "%s is using a gl_modulate higher than allowed (%.1f)\n", ent->client->pers.netname, ent->client->resp.glmodulate); Kick_Client (ent); return; } return; } if (ent->client->resp.glmodulate > video_max_opengl->value) { gi.cprintf (ent, PRINT_HIGH, "Your gl_modulate value is too high for this server. Max Allowed is %.1f\n", video_max_opengl->value); gi.bprintf (PRINT_HIGH, "%s is using a gl_modulate higher than allowed (%.1f)\n", ent->client->pers.netname, ent->client->resp.glmodulate); Kick_Client (ent); return; } } }