*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@494 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2006-11-06 15:36:54 +00:00
parent cb934b868d
commit 3ea2b2e1f2
4 changed files with 33 additions and 19 deletions
+1 -1
View File
@@ -610,7 +610,7 @@ void startmap(char *name) // called just after a map load
spawnplayer(player1, true);
player1->frags = 0;
player1->flagscore = 0;
loopv(players) if(players[i]) players[i]->frags = 0;
loopv(players) if(players[i]) players[i]->frags = players[i]->flagscore = 0;
resetspawns();
s_strcpy(clientmap, name);
if(editmode) toggleedit();
+6 -6
View File
@@ -349,12 +349,12 @@ void parsemessages(int cn, dynent *d, ucharbuf &p)
case SV_RESUME:
{
int cn = getint(p), frags = getint(p);
if(cn==clientnum) player1->frags = frags;
else
int cn = getint(p), frags = getint(p), flags = getint(p);
dynent *d = cn==clientnum ? player1 : getclient(cn);
if(d)
{
dynent *d = getclient(cn);
if(d) d->frags = frags;
d->frags = frags;
d->flagscore = flags;
};
break;
};
@@ -568,7 +568,7 @@ void parsemessages(int cn, dynent *d, ucharbuf &p)
if (!b)
break;
conoutf("bot %s disconnected", b->name[0] ? b->name : "[incompatible client]");
if(b->name[0]) conoutf("bot %s disconnected", b->name);
delete b->pBot;
zapdynent(bots[n]);
bots.remove(n);
-1
View File
@@ -132,7 +132,6 @@ void setfullscreen(bool enable)
{
#ifdef WIN32
conoutf("\"fullscreen\" variable not supported on this platform. Use the -t command-line option.");
extern int fullscreen;
fullscreen = !enable;
#else
SDL_WM_ToggleFullScreen(screen);
+26 -11
View File
@@ -13,7 +13,12 @@ enum { ST_EMPTY, ST_LOCAL, ST_TCPIP };
struct clientscore
{
int frags;
int frags, flags;
void reset()
{
frags = flags = 0;
};
};
struct savedscore : clientscore
@@ -51,7 +56,7 @@ struct client // server side version of "dynent" type
void reset()
{
name[0] = 0;
score.frags = 0;
score.reset();
position.setsizenodelete(0);
messages.setsizenodelete(0);
};
@@ -207,9 +212,9 @@ clientscore *findscore(client &c, bool insert)
};
if(!insert) return NULL;
savedscore &sc = scores.add();
sc.reset();
s_strcpy(sc.name, c.name);
sc.ip = c.peer->address.host;
(clientscore &)sc = c.score;
return ≻
};
@@ -217,7 +222,7 @@ void resetscores()
{
loopv(clients) if(clients[i]->type==ST_TCPIP)
{
clients[i]->score.frags = 0;
clients[i]->score.reset();
};
scores.setsize(0);
};
@@ -814,7 +819,7 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1
if(newclient)
{
clientscore *sc = findscore(*clients[cn], false);
if(sc) sendf(-1, 1, "riii", SV_RESUME, cn, sc->frags);
if(sc) sendf(-1, 1, "ri4", SV_RESUME, cn, sc->frags, sc->flags);
};
getstring(text, p);
getint(p);
@@ -992,12 +997,10 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1
};
case SV_GETMASTER:
{
SENDER_CHECK;
getstring(text, p);
getmaster(sender, text);
break;
};
case SV_MASTERCMD:
{
@@ -1009,18 +1012,20 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1
};
case SV_PWD:
{
getstring(text, p);
break;
};
case SV_FRAGS:
{
CN_CHECK;
cl->score.frags = getint(p);
QUEUE_MSG;
break;
};
case SV_FLAGS:
CN_CHECK;
cl->score.flags = getint(p);
QUEUE_MSG;
break;
default:
{
@@ -1058,6 +1063,16 @@ void send_welcome(int n)
putint(p, -1);
};
};
loopv(clients)
{
client &c = *clients[i];
if(c.type!=ST_TCPIP || c.clientnum==n) continue;
if(!c.score.frags && !c.score.flags) continue;
putint(p, SV_RESUME);
putint(p, c.clientnum);
putint(p, c.score.frags);
putint(p, c.score.flags);
};
enet_packet_resize(packet, p.length());
sendpacket(n, 1, packet);
if(smapname[0] && m_ctf_s) loopi(2) sendflaginfo(i, -1, n); // EDIT: AH