smarter (i.e. smaller) communication size for points

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5115 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-05-30 16:43:19 +00:00
parent 8d3f4fd381
commit 8bde28bbed
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -631,7 +631,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
int pcn = getint(p); int score = getint(p);
playerent *ppl = pcn == getclientnum() ? player1 : getclient(pcn);
if (!ppl) break;
ppl->points = score;
ppl->points += score;
}
break;
}
+1 -1
View File
@@ -373,7 +373,7 @@ void sendextras()
loopi(count)
{
client &c = *clients[*v];
putint(p,c.clientnum); putint(p,c.state.points); c.md.updated = false; c.md.upmillis = 0;
putint(p,c.clientnum); putint(p,c.md.dpt); c.md.updated = false; c.md.upmillis = c.md.dpt = 0;
v++;
}
+2 -2
View File
@@ -197,12 +197,12 @@ struct savedscore
struct medals
{
int dp, lasthit, lastgun, combohits, combo, combotime, combodamage, ncombos, ncovers, nhs;
int dpt, lasthit, lastgun, combohits, combo, combotime, combodamage, ncombos, ncovers, nhs;
int ask, askmillis, linked, linkmillis, linkreason, upmillis;
bool updated, combosend;
void reset()
{
dp = lasthit = lastgun = combohits = combo = combotime = combodamage = ncombos = ncovers = nhs = 0;
dpt = lasthit = lastgun = combohits = combo = combotime = combodamage = ncombos = ncovers = nhs = 0;
askmillis = linkmillis = upmillis = 0;
linkreason = linked = ask = -1;
updated = combosend = false;
+1
View File
@@ -84,6 +84,7 @@ This part is related to medals system. WIP
inline void addpt(client *c, int points) {
c->state.points += points;
c->md.dpt += points;
c->md.updated = true;
c->md.upmillis = gamemillis + 200;
}