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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user