linux bins, and some more anticheats included

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5450 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-07-23 19:40:33 +00:00
parent 5a8d5154c6
commit 4141e2d4c9
3 changed files with 54 additions and 37 deletions
+33 -1
View File
@@ -491,6 +491,36 @@ void check_ffire (client *target, client *actor, int damage)
}
}
inline void checkclientpos(client *cl)
{
vec &po = cl->state.o;
int ls = (1 << maplayout_factor) - 1;
if(po.x < 0 || po.y < 0 || po.x > ls || po.y > ls || maplayout[((int) po.x) + (((int) po.y) << maplayout_factor)] > po.z + 3)
{
if(gamemillis > 10000 && (servmillis - cl->connectmillis) > 10000) cl->mapcollisions++;
if(cl->mapcollisions && !(cl->mapcollisions % 25))
{
logline(ACLOG_INFO, "[%s] %s is colliding with the map", cl->hostname, cl->name);
}
}
}
inline int check_pdist(client *c, float & dist) // pick up distance
{
// ping 1000ms at max velocity can produce an error of 20 cubes
float delay = 9.0f + (float)c->ping * 0.02f; // at ping 100, delay = 11
if ( dist > delay )
{
if ( dist < 1.5f * delay ) return 1;
#ifdef ACAC
pickup_checks(c,dist-delay);
#endif
return 2;
}
return 0;
}
/**
If you read README.txt you must know that AC does not have cheat protection implemented.
However this file is the sketch to a very special kind of cheat detection tools in server side.
@@ -520,6 +550,8 @@ inline void checkmove (client *cl)
cl->inputmillis = servmillis;
}
if(maplayout) checkclientpos(cl);
#ifdef ACAC
m_engine(cl);
#endif
@@ -545,7 +577,7 @@ bool validdamage (client *&target, client *&actor, int &gun, bool &gib)
{
#ifdef ACAC
d_engine(target, actor, gun, gib);
if (!d_engine(target, actor, gun, gib)) return false;
#endif
return true;
}