X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmain.qc;h=cf91b9de4bafd7d6b250a860732702a82222f409;hb=18f0e41a5c2b1fb64161157c974688f401b79211;hp=49ff3afc64d45da33a9c25bcd1ce805cc4bb7062;hpb=8bed39a680d18ef81d42952d21197647c4c91721;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/main.qc b/qcsrc/server/main.qc index 49ff3afc6..cf91b9de4 100644 --- a/qcsrc/server/main.qc +++ b/qcsrc/server/main.qc @@ -1,37 +1,64 @@ #include "main.qh" -#include "anticheat.qh" -#include "hook.qh" -#include "damage.qh" -#include "world.qh" -#include "spawnpoints.qh" -#include -#include - -#include "bot/api.qh" - -#include "command/common.qh" - -#include -#include "weapons/csqcprojectile.qh" -#include -#include - -#include "../common/constants.qh" #include -#include "../common/deathtypes/all.qh" -#include "../common/debug.qh" -#include "../common/mapinfo.qh" -#include "../common/util.qh" - -#include "../common/vehicles/all.qh" +#include +#include +#include +#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "../lib/csqcmodel/sv_model.qh" - -#include "../lib/warpzone/common.qh" -#include "../lib/warpzone/server.qh" +void dropclient_do(entity this) +{ + if (this.owner) + dropclient(this.owner); + delete(this); +} +/** + * Schedules dropclient for a player and returns true; + * if dropclient is already scheduled (for that player) it does nothing and returns false. + * + * NOTE: this function exists only to allow sending a message to the kicked player with + * Send_Notification, which doesn't work if called together with dropclient + */ +bool dropclient_schedule(entity this) +{ + bool scheduled = false; + FOREACH_ENTITY_CLASS("dropclient_handler", true, + { + if(it.owner == this) + { + scheduled = true; + break; // can't use return here, compiler shows a warning + } + }); + if (scheduled) + return false; + + entity e = new_pure(dropclient_handler); + setthink(e, dropclient_do); + e.owner = this; + e.nextthink = time + 0.1; + return true; +} void CreatureFrame_hotliquids(entity this) { @@ -388,7 +415,7 @@ string GetField_fullspawndata(entity e, string f, ...) if (!e.fullspawndata) { - LOG_WARNF("^1EDICT %s (classname %s) has no fullspawndata, engine lacks support?", ftos(num_for_edict(e)), e.classname); + //LOG_WARNF("^1EDICT %s (classname %s) has no fullspawndata, engine lacks support?", ftos(num_for_edict(e)), e.classname); return v; }