diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 2c8ffecc..6dec69f9 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -527,6 +527,39 @@ void damageblend(int n) damageblendmillis += n*damagescreenfactor; } +VAR(interms,0,0,1); +void drawmedals(float x, float y, int col, int row, Texture *tex) +{ + if(tex) + { + glPushAttrib(GL_COLOR_BUFFER_BIT); + glDisable(GL_BLEND); + drawicon(tex, x, y, 120, col, row, 1/4.0f); + glPopAttrib(); + } +} +void drawscores() +{ + glPushAttrib(GL_COLOR_BUFFER_BIT); + static Texture *tex = NULL; + if(!tex) tex = textureload("packages/misc/nice_medals.png", 4); + static float time=0; + if(!interms && time != 0.0f) time=0.0f; + if(!interms /*&& !multiplayer(false)*/) return; + time+=((float)(curtime))/1000; + float vw=VIRTW*7/4,vh=VIRTH*7/4; + glLoadIdentity(); + glOrtho(0, vw, vh, 0, -1, 1); + int left = vw/4, top = vh/4; + blendbox(left, top, left*3, top*3, true, -1); + top+=10;left+=10;const float txtdx=160,txtdy=30,medalsdy=130; + glColor4f(1,1,1,1); + if(time > 0.3) {drawmedals(left, top, 0, 0, tex); draw_textf("TEST WRITING!!", left+txtdx, top+txtdy); top+=medalsdy;} + if(time > 0.6) {drawmedals(left, top, 0, 1, tex); draw_textf("TEST WRITING!!", left+txtdx, top+txtdy); top+=medalsdy;} + if(time > 0.9) {drawmedals(left, top, 0, 2, tex); draw_textf("TEST WRITING!!", left+txtdx, top+txtdy); top+=medalsdy;} + glPopAttrib(); +} + void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater) { playerent *p = camera1->typespectatemode!=SM_DEATHCAM) { glLoadIdentity(); diff --git a/source/src/server.h b/source/src/server.h index da998a3b..1feb757c 100644 --- a/source/src/server.h +++ b/source/src/server.h @@ -124,7 +124,7 @@ struct clientstate : playerstate projectilestate<8> grenades; int akimbomillis; bool scoped; - int flagscore, frags, teamkills, deaths, shotdamage, damage, points; + int flagscore, frags, teamkills, deaths, shotdamage, damage, points, events; clientstate() : state(CS_DEAD) {} @@ -147,7 +147,7 @@ struct clientstate : playerstate grenades.reset(); akimbomillis = 0; scoped = forced = false; - flagscore = frags = teamkills = deaths = shotdamage = damage = points = 0; + flagscore = frags = teamkills = deaths = shotdamage = damage = points = events = 0; respawn(); } @@ -168,7 +168,7 @@ struct savedscore { string name; uint ip; - int frags, flagscore, deaths, teamkills, shotdamage, damage, team, points; + int frags, flagscore, deaths, teamkills, shotdamage, damage, team, points, events; bool valid, forced; void save(clientstate &cs, int t) @@ -181,6 +181,7 @@ struct savedscore damage = cs.damage; points = cs.points; forced = cs.forced; + events = cs.events; team = t; valid = true; } @@ -195,6 +196,7 @@ struct savedscore cs.damage = damage; cs.points = points; cs.forced = forced; + cs.events = events; } }; @@ -202,14 +204,14 @@ struct medals { int dpt, lasthit, lastgun, ncovers, nhs; int combohits, combo, combofrags, combotime, combodamage, ncombos; - int ask, askmillis, linked, linkmillis, linkreason, upmillis; + int ask, askmillis, linked, linkmillis, linkreason, upmillis, flagmillis; bool updated, combosend; vec pos, flagpos; void reset() { dpt = lasthit = lastgun = ncovers = nhs = 0; combohits = combo = combofrags = combotime = combodamage = ncombos = 0; - askmillis = linkmillis = upmillis = 0; + askmillis = linkmillis = upmillis = flagmillis = 0; linkreason = linked = ask = -1; updated = combosend = false; pos = flagpos = vec(-1e10f, -1e10f, -1e10f); @@ -258,7 +260,7 @@ struct client // server side version of "dynent" type vec spawnp; int nvotes; int input, inputmillis; - int ffire; + int ffire, wn; gameevent &addevent() { @@ -312,6 +314,7 @@ struct client // server side version of "dynent" type freshgame = false; // don't spawn into running games mute = spam = lastvc = badspeech = badmillis = nvotes = 0; input = inputmillis = 0; + wn = -1; } void zap() diff --git a/source/src/serverchecks.h b/source/src/serverchecks.h index 05b2feee..b08edfb9 100644 --- a/source/src/serverchecks.h +++ b/source/src/serverchecks.h @@ -1,3 +1,4 @@ +// #include "anticheat.h" inline float pow2(float x) { @@ -128,6 +129,7 @@ void flagpoints (client *c, int message) case FM_PICKUP: c->md.flagpos.x = c->state.o.x; c->md.flagpos.y = c->state.o.y; + c->md.flagmillis = servmillis; if (m_ctf) addpt(c, CTFPICKPT); break; case FM_DROP: @@ -148,7 +150,7 @@ void flagpoints (client *c, int message) if (m_ctf) { distance = sqrt(POW2XY(c->state.o,c->md.flagpos)); if (distance > 200) distance = 200; - addpt(c, CTFSCOREPT); + /*if ( validflagscore(distance,c) )*/ addpt(c, CTFSCOREPT); } else addpt(c, HTFSCOREPT); break; case FM_KTFSCORE: