From b070ead7b9979f85886a4f4fdb17b616f470895e Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Fri, 10 Aug 2007 21:19:05 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1224 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entities.cpp | 1 + source/src/protocol.cpp | 2 +- source/src/protocol.h | 2 +- source/src/server.cpp | 17 +++++++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 5f8011ac..2820d3b2 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -260,6 +260,7 @@ void item(int num) case GUN_SNIPER: case GUN_ASSAULT: player1->nextprimary = num; + addmsg(SV_PRIMARYWEAP, "ri", player1->nextprimary); break; default: diff --git a/source/src/protocol.cpp b/source/src/protocol.cpp index fc233fba..6bfdf406 100644 --- a/source/src/protocol.cpp +++ b/source/src/protocol.cpp @@ -111,7 +111,7 @@ char msgsizesl[] = // size inclusive message token, 0 for variable SV_MAPCHANGE, 0, SV_ITEMSPAWN, 2, SV_ITEMPICKUP, 2, SV_PING, 2, SV_PONG, 2, SV_CLIENTPING, 2, SV_GAMEMODE, 2, SV_EDITH, 7, SV_EDITT, 7, SV_EDITS, 6, SV_EDITD, 6, SV_EDITE, 6, - SV_SENDMAP, 0, SV_RECVMAP, 1, SV_SERVMSG, 0, SV_ITEMLIST, 0, SV_WEAPCHANGE, 2, + SV_SENDMAP, 0, SV_RECVMAP, 1, SV_SERVMSG, 0, SV_ITEMLIST, 0, SV_WEAPCHANGE, 2, SV_PRIMARYWEAP, 2, SV_MODELSKIN, 2, SV_FLAGPICKUP, 2, SV_FLAGDROP, 2, SV_FLAGRETURN, 2, SV_FLAGSCORE, 2, SV_FLAGRESET, 2, SV_FLAGINFO, 0, SV_FLAGS, 2, SV_ARENAWIN, 2, diff --git a/source/src/protocol.h b/source/src/protocol.h index f15df5c1..442db845 100644 --- a/source/src/protocol.h +++ b/source/src/protocol.h @@ -16,7 +16,7 @@ enum SV_MAPCHANGE, SV_ITEMSPAWN, SV_ITEMPICKUP, SV_PING, SV_PONG, SV_CLIENTPING, SV_GAMEMODE, SV_EDITMODE, SV_EDITH, SV_EDITT, SV_EDITS, SV_EDITD, SV_EDITE, - SV_SENDMAP, SV_RECVMAP, SV_SERVMSG, SV_ITEMLIST, SV_WEAPCHANGE, + SV_SENDMAP, SV_RECVMAP, SV_SERVMSG, SV_ITEMLIST, SV_WEAPCHANGE, SV_PRIMARYWEAP, SV_MODELSKIN, SV_FLAGPICKUP, SV_FLAGDROP, SV_FLAGRETURN, SV_FLAGSCORE, SV_FLAGRESET, SV_FLAGINFO, SV_FLAGS, SV_ARENAWIN, diff --git a/source/src/server.cpp b/source/src/server.cpp index a30dd77b..d482949b 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -992,6 +992,15 @@ void resetmap(const char *newname, int newmode, int newtime = -1, bool notify = } if(m_teammode && !lastteammode) shuffleteams(); if(m_arena) arenaround = 0; + if(notify) + { + loopv(clients) if(clients[i]->type!=ST_EMPTY) + { + client *c = clients[i]; + c->mapchange(); + if(m_mp(smode)) sendspawn(c); + } + } } void nextcfgset(bool notify = true) // load next maprotation set @@ -1410,6 +1419,14 @@ void process(ENetPacket *packet, int sender, int chan) // sender may be -1 break; } + case SV_PRIMARYWEAP: + { + int nextprimary = getint(p); + cl->state.nextprimary = nextprimary; + QUEUE_MSG; + break; + } + case SV_TRYSPAWN: if(cl->state.state!=CS_DEAD || !canspawn(cl)) break; if(cl->state.lastdeath) cl->state.respawn();