Skip to content

Commit

Permalink
Justice forwardport: SV_ -> N_
Browse files Browse the repository at this point in the history
  • Loading branch information
greghaynes committed Jul 21, 2010
1 parent 64b1f5c commit d20cdee
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 203 deletions.
10 changes: 5 additions & 5 deletions src/fpsgame/aiman.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace aiman
{
if(smode && bot->state.state==CS_ALIVE) smode->changeteam(bot, bot->team, t.team);
copystring(bot->team, t.team, MAXTEAMLEN+1);
sendf(-1, 1, "riis", SV_SETTEAM, bot->clientnum, bot->team);
sendf(-1, 1, "riis", N_SETTEAM, bot->clientnum, bot->team);
}
else teams.remove(0, 1);
}
Expand Down Expand Up @@ -138,7 +138,7 @@ namespace aiman
int cn = ci->clientnum - MAXCLIENTS;
if(!bots.inrange(cn)) return;
if(smode) smode->leavegame(ci, true);
sendf(-1, 1, "ri2", SV_CDIS, ci->clientnum);
sendf(-1, 1, "ri2", N_CDIS, ci->clientnum);
clientinfo *owner = (clientinfo *)getclientinfo(ci->ownernum);
if(owner) owner->bots.removeobj(ci);
clients.removeobj(ci);
Expand All @@ -161,7 +161,7 @@ namespace aiman
if(ci->ownernum < 0) deleteai(ci);
else if(ci->aireinit >= 1)
{
sendf(-1, 1, "ri6ss", SV_INITAI, ci->clientnum, ci->ownernum, ci->state.aitype, ci->state.skill, ci->playermodel, ci->name, ci->team);
sendf(-1, 1, "ri6ss", N_INITAI, ci->clientnum, ci->ownernum, ci->state.aitype, ci->state.skill, ci->playermodel, ci->name, ci->team);
if(ci->aireinit == 2)
{
ci->reassign();
Expand Down Expand Up @@ -235,13 +235,13 @@ namespace aiman
void reqadd(clientinfo *ci, int skill)
{
if(!ci->local && !ci->privilege) return;
if(!addai(skill, !ci->local && ci->privilege < PRIV_ADMIN ? botlimit : -1)) sendf(ci->clientnum, 1, "ris", SV_SERVMSG, "failed to create or assign bot");
if(!addai(skill, !ci->local && ci->privilege < PRIV_ADMIN ? botlimit : -1)) sendf(ci->clientnum, 1, "ris", N_SERVMSG, "failed to create or assign bot");
}

void reqdel(clientinfo *ci)
{
if(!ci->local && !ci->privilege) return;
if(!deleteai()) sendf(ci->clientnum, 1, "ris", SV_SERVMSG, "failed to remove any bots");
if(!deleteai()) sendf(ci->clientnum, 1, "ris", N_SERVMSG, "failed to remove any bots");
}

void setbotlimit(clientinfo *ci, int limit)
Expand Down
34 changes: 17 additions & 17 deletions src/fpsgame/capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ struct captureservmode : servmode
baseinfo &b = bases[i];
if(b.ammotype>0 && b.ammotype<=I_CARTRIDGES-I_SHELLS+1 && insidebase(b, player1->feetpos()) && player1->hasmaxammo(b.ammotype-1+I_SHELLS)) return;
}
addmsg(SV_REPAMMO, "rc", player1);
addmsg(N_REPAMMO, "rc", player1);
}

void receiveammo(fpsent *d, int type)
Expand All @@ -285,7 +285,7 @@ struct captureservmode : servmode
{
if(d->lastrepammo!=i)
{
if(b.ammo > 0 && !player1->hasmaxammo(b.ammotype-1+I_SHELLS)) addmsg(SV_REPAMMO, "rc", d);
if(b.ammo > 0 && !player1->hasmaxammo(b.ammotype-1+I_SHELLS)) addmsg(N_REPAMMO, "rc", d);
d->lastrepammo = i;
}
return;
Expand Down Expand Up @@ -495,7 +495,7 @@ struct captureservmode : servmode

void senditems(packetbuf &p)
{
putint(p, SV_BASES);
putint(p, N_BASES);
putint(p, bases.length());
loopv(bases)
{
Expand Down Expand Up @@ -736,7 +736,7 @@ struct captureservmode : servmode
if(b.ammotype>0 && b.ammotype<=I_CARTRIDGES-I_SHELLS+1 && insidebase(b, ci->state.o) && !ci->state.hasmaxammo(b.ammotype-1+I_SHELLS) && b.takeammo(ci->team))
{
sendbaseinfo(i);
sendf(-1, 1, "riii", SV_REPAMMO, ci->clientnum, b.ammotype);
sendf(-1, 1, "riii", N_REPAMMO, ci->clientnum, b.ammotype);
ci->state.addammo(b.ammotype);
break;
}
Expand Down Expand Up @@ -772,7 +772,7 @@ struct captureservmode : servmode
if(!n) return;
score &cs = findscore(team);
cs.total += n;
sendf(-1, 1, "riisi", SV_BASESCORE, base, team, cs.total);
sendf(-1, 1, "riisi", N_BASESCORE, base, team, cs.total);
}

void regenowners(baseinfo &b, int ticks)
Expand Down Expand Up @@ -803,7 +803,7 @@ struct captureservmode : servmode
}
}
if(notify)
sendf(-1, 1, "ri6", SV_BASEREGEN, ci->clientnum, ci->state.health, ci->state.armour, b.ammotype, b.ammotype>0 ? ci->state.ammo[b.ammotype] : 0);
sendf(-1, 1, "ri6", N_BASEREGEN, ci->clientnum, ci->state.health, ci->state.armour, b.ammotype, b.ammotype>0 ? ci->state.ammo[b.ammotype] : 0);
}
}
}
Expand Down Expand Up @@ -846,7 +846,7 @@ struct captureservmode : servmode
void sendbaseinfo(int i)
{
baseinfo &b = bases[i];
sendf(-1, 1, "riissii", SV_BASEINFO, i, b.owner, b.enemy, b.enemy[0] ? b.converted : 0, b.owner[0] ? b.ammo : 0);
sendf(-1, 1, "riissii", N_BASEINFO, i, b.owner, b.enemy, b.enemy[0] ? b.converted : 0, b.owner[0] ? b.ammo : 0);
}

void sendbases()
Expand All @@ -863,13 +863,13 @@ struct captureservmode : servmode
loopv(scores)
{
score &cs = scores[i];
putint(p, SV_BASESCORE);
putint(p, N_BASESCORE);
putint(p, -1);
sendstring(cs.team, p);
putint(p, cs.total);
}
}
putint(p, SV_BASES);
putint(p, N_BASES);
putint(p, bases.length());
loopv(bases)
{
Expand Down Expand Up @@ -907,7 +907,7 @@ struct captureservmode : servmode

if(!lastteam) return;
findscore(lastteam).total = 10000;
sendf(-1, 1, "riisi", SV_BASESCORE, -1, lastteam, 10000);
sendf(-1, 1, "riisi", N_BASESCORE, -1, lastteam, 10000);
startintermission();
}

Expand Down Expand Up @@ -983,17 +983,17 @@ struct captureservmode : servmode

#elif SERVMODE

case SV_BASES:
case N_BASES:
if(smode==&capturemode) capturemode.parsebases(p, (ci->state.state!=CS_SPECTATOR || ci->privilege || ci->local) && !strcmp(ci->clientmap, smapname));
break;

case SV_REPAMMO:
case N_REPAMMO:
if(ci->state.state!=CS_SPECTATOR && cq && smode==&capturemode) capturemode.replenishammo(cq);
break;

#else

case SV_BASEINFO:
case N_BASEINFO:
{
int base = getint(p);
string owner, enemy;
Expand All @@ -1006,7 +1006,7 @@ case SV_BASEINFO:
break;
}

case SV_BASEREGEN:
case N_BASEREGEN:
{
int rcn = getint(p), health = getint(p), armour = getint(p), ammotype = getint(p), ammo = getint(p);
fpsent *regen = rcn==player1->clientnum ? player1 : getclient(rcn);
Expand All @@ -1019,7 +1019,7 @@ case SV_BASEREGEN:
break;
}

case SV_BASES:
case N_BASES:
{
int numbases = getint(p);
loopi(numbases)
Expand All @@ -1036,7 +1036,7 @@ case SV_BASES:
break;
}

case SV_BASESCORE:
case N_BASESCORE:
{
int base = getint(p);
getstring(text, p);
Expand All @@ -1045,7 +1045,7 @@ case SV_BASESCORE:
break;
}

case SV_REPAMMO:
case N_REPAMMO:
{
int rcn = getint(p), ammotype = getint(p);
fpsent *r = rcn==player1->clientnum ? player1 : getclient(rcn);
Expand Down
40 changes: 20 additions & 20 deletions src/fpsgame/ctf.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ struct ctfclientmode : clientmode
loopv(flags) if(flags[i].owner==ci->clientnum)
{
ivec o(vec(ci->state.o).mul(DMF));
sendf(-1, 1, "ri6", SV_DROPFLAG, ci->clientnum, i, o.x, o.y, o.z);
sendf(-1, 1, "ri6", N_DROPFLAG, ci->clientnum, i, o.x, o.y, o.z);
dropflag(i, o.tovec().div(DMF), lastmillis);
}
}
Expand Down Expand Up @@ -223,7 +223,7 @@ struct ctfclientmode : clientmode
returnflag(relay >= 0 ? relay : goal, relay >= 0 ? 0 : lastmillis);
ci->state.flags++;
int team = ctfteamflag(ci->team), score = addscore(team, 1);
sendf(-1, 1, "ri6", SV_SCOREFLAG, ci->clientnum, relay, goal, team, score);
sendf(-1, 1, "ri6", N_SCOREFLAG, ci->clientnum, relay, goal, team, score);
if(score >= FLAGLIMIT) startintermission();
}

Expand All @@ -237,7 +237,7 @@ struct ctfclientmode : clientmode
{
loopvj(flags) if(flags[j].owner==ci->clientnum) return;
ownflag(i, ci->clientnum);
sendf(-1, 1, "ri3", SV_TAKEFLAG, ci->clientnum, i);
sendf(-1, 1, "ri3", N_TAKEFLAG, ci->clientnum, i);
}
else if(m_protect)
{
Expand All @@ -246,7 +246,7 @@ struct ctfclientmode : clientmode
else if(f.droptime)
{
returnflag(i);
sendf(-1, 1, "ri3", SV_RETURNFLAG, ci->clientnum, i);
sendf(-1, 1, "ri3", N_RETURNFLAG, ci->clientnum, i);
}
else
{
Expand All @@ -263,19 +263,19 @@ struct ctfclientmode : clientmode
if(f.owner<0 && f.droptime && lastmillis - f.droptime >= RESETFLAGTIME)
{
returnflag(i, m_protect ? lastmillis : 0);
sendf(-1, 1, "ri4", SV_RESETFLAG, i, f.team, addscore(f.team, m_protect ? -1 : 0));
sendf(-1, 1, "ri4", N_RESETFLAG, i, f.team, addscore(f.team, m_protect ? -1 : 0));
}
if(f.invistime && lastmillis - f.invistime >= INVISFLAGTIME)
{
f.invistime = 0;
sendf(-1, 1, "ri3", SV_INVISFLAG, i, 0);
sendf(-1, 1, "ri3", N_INVISFLAG, i, 0);
}
}
}

void initclient(clientinfo *ci, packetbuf &p, bool connecting)
{
putint(p, SV_INITFLAGS);
putint(p, N_INITFLAGS);
loopk(2) putint(p, scores[k]);
putint(p, flags.length());
loopv(flags)
Expand Down Expand Up @@ -470,7 +470,7 @@ struct ctfclientmode : clientmode

void senditems(packetbuf &p)
{
putint(p, SV_INITFLAGS);
putint(p, N_INITFLAGS);
putint(p, flags.length());
loopv(flags)
{
Expand Down Expand Up @@ -520,7 +520,7 @@ struct ctfclientmode : clientmode
if(!m_ctf) return;
loopv(flags) if(flags[i].owner == player1)
{
addmsg(SV_TRYDROPFLAG, "rc", player1);
addmsg(N_TRYDROPFLAG, "rc", player1);
return;
}
}
Expand Down Expand Up @@ -650,7 +650,7 @@ struct ctfclientmode : clientmode
{
if(d->flagpickup&(1<<f.id)) continue;
if((lookupmaterial(o)&MATF_CLIP) != MAT_GAMECLIP && (lookupmaterial(loc)&MATF_CLIP) != MAT_GAMECLIP)
addmsg(SV_TAKEFLAG, "rci", d, i);
addmsg(N_TAKEFLAG, "rci", d, i);
d->flagpickup |= 1<<f.id;
}
else d->flagpickup &= ~(1<<f.id);
Expand Down Expand Up @@ -915,32 +915,32 @@ struct ctfclientmode : clientmode

#elif SERVMODE

case SV_TRYDROPFLAG:
case N_TRYDROPFLAG:
{
if(ci->state.state!=CS_SPECTATOR && cq && smode==&ctfmode) ctfmode.dropflag(cq);
break;
}

case SV_TAKEFLAG:
case N_TAKEFLAG:
{
int flag = getint(p);
if(ci->state.state!=CS_SPECTATOR && cq && smode==&ctfmode) ctfmode.takeflag(cq, flag);
break;
}

case SV_INITFLAGS:
case N_INITFLAGS:
if(smode==&ctfmode) ctfmode.parseflags(p, (ci->state.state!=CS_SPECTATOR || ci->privilege || ci->local) && !strcmp(ci->clientmap, smapname));
break;

#else

case SV_INITFLAGS:
case N_INITFLAGS:
{
ctfmode.parseflags(p, m_ctf);
break;
}

case SV_DROPFLAG:
case N_DROPFLAG:
{
int ocn = getint(p), flag = getint(p);
vec droploc;
Expand All @@ -950,38 +950,38 @@ case SV_DROPFLAG:
break;
}

case SV_SCOREFLAG:
case N_SCOREFLAG:
{
int ocn = getint(p), relayflag = getint(p), goalflag = getint(p), team = getint(p), score = getint(p);
fpsent *o = ocn==player1->clientnum ? player1 : newclient(ocn);
if(o && m_ctf) ctfmode.scoreflag(o, relayflag, goalflag, team, score);
break;
}

case SV_RETURNFLAG:
case N_RETURNFLAG:
{
int ocn = getint(p), flag = getint(p);
fpsent *o = ocn==player1->clientnum ? player1 : newclient(ocn);
if(o && m_ctf) ctfmode.returnflag(o, flag);
break;
}

case SV_TAKEFLAG:
case N_TAKEFLAG:
{
int ocn = getint(p), flag = getint(p);
fpsent *o = ocn==player1->clientnum ? player1 : newclient(ocn);
if(o && m_ctf) ctfmode.takeflag(o, flag);
break;
}

case SV_RESETFLAG:
case N_RESETFLAG:
{
int flag = getint(p), team = getint(p), score = getint(p);
if(m_ctf) ctfmode.resetflag(flag, team, score);
break;
}

case SV_INVISFLAG:
case N_INVISFLAG:
{
int flag = getint(p), invis = getint(p);
if(m_ctf) ctfmode.invisflag(flag, invis);
Expand Down

0 comments on commit d20cdee

Please sign in to comment.