serverevents cleanups (scopeevent removed)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7022 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2013-01-01 15:32:38 +00:00
parent 9f53b96539
commit 8d5d52351d
2 changed files with 3 additions and 24 deletions
+1 -9
View File
@@ -8,7 +8,7 @@
#define valid_flag(f) (f >= 0 && f < 2)
enum { GE_NONE = 0, GE_SHOT, GE_EXPLODE, GE_HIT, GE_AKIMBO, GE_RELOAD, GE_SCOPING, GE_SUICIDE, GE_PICKUP };
enum { GE_NONE = 0, GE_SHOT, GE_EXPLODE, GE_HIT, GE_AKIMBO, GE_RELOAD, GE_SUICIDE, GE_PICKUP };
enum { ST_EMPTY, ST_LOCAL, ST_TCPIP };
extern int smode, servmillis;
@@ -65,13 +65,6 @@ struct reloadevent
int gun;
};
struct scopeevent
{
int type;
int millis, id;
bool scoped;
};
union gameevent
{
int type;
@@ -82,7 +75,6 @@ union gameevent
pickupevent pickup;
akimboevent akimbo;
reloadevent reload;
scopeevent scoping;
};
template <int N>
+2 -15
View File
@@ -75,14 +75,9 @@ void processevent(client *c, shotevent &e)
int numhits_c = (h.info & 0x0000FF00) >> 8, numhits_m = (h.info & 0x00FF0000) >> 16, numhits_o = (h.info & 0xFF000000) >> 24;
tothits_c += numhits_c; tothits_m += numhits_m; tothits_o += numhits_o;
rays = numhits_c + numhits_m + numhits_o;
if(rays < 1) continue;
if(tothits_c > SGRAYS || tothits_m > SGRAYS || tothits_o > SGRAYS || bonusdist > SGDMGBONUS)
{
addban(c, DISC_CHEAT);
continue;
}
if(rays < 1 || tothits_c > SGRAYS || tothits_m > SGRAYS || tothits_o > SGRAYS || bonusdist > SGDMGBONUS) continue;
gib = rays == maxrays;
float fdamage = (SGDMGTOTAL/(21*100.0f)) * (numhits_o * SGCOdmg/10.0f + numhits_m * SGCMdmg/10.0f + numhits_c * SGCCdmg/10.0f);
fdamage += (float)bonusdist;
@@ -123,13 +118,6 @@ void processevent(client *c, pickupevent &e)
serverpickup(e.ent, c->clientnum);
}
void processevent(client *c, scopeevent &e) // FIXME remove in the next protocol change
{
clientstate &gs = c->state;
if(!gs.isalive(gamemillis)/* || e.gun!=GUN_SNIPER*/) return; // currently we check the gun on the client-side only
gs.scoped = e.scoped;
}
void processevent(client *c, reloadevent &e)
{
clientstate &gs = c->state;
@@ -193,7 +181,6 @@ void processevents()
case GE_EXPLODE: processevent(c, e.explode); break;
case GE_AKIMBO: processevent(c, e.akimbo); break;
case GE_RELOAD: processevent(c, e.reload); break;
case GE_SCOPING: processevent(c, e.scoping); break;
// untimed events
case GE_SUICIDE: processevent(c, e.suicide); break;
case GE_PICKUP: processevent(c, e.pickup); break;