gonext command (the client requests to the server for the next map/mode in the map rotation)

/gonext 0 ---> next map/mode no matter the player number
/gonext 1 ---> the player number matters

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5613 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-08-13 23:10:47 +00:00
parent 805628de99
commit 7e1be3ed29
4 changed files with 70 additions and 22 deletions
+15 -3
View File
@@ -12,7 +12,7 @@ flaginfo flaginfos[2];
void mode(int n)
{
nextmode = n;
if(m_mp(n) || !multiplayer()) addmsg(SV_GAMEMODE, "ri", n);
if(m_mp(n) || !multiplayer()) addmsg(SV_GAMEMODE, "ri", n);
}
COMMAND(mode, ARG_1INT);
@@ -1137,8 +1137,8 @@ int vote(int v)
putint(p, SV_VOTE);
putint(p, v);
sendpackettoserv(1, p.finalize());
// flowtron : 2008 11 06 : I don't think the following comments are still current
if(!curvote) { /*printf(":: curvote vanished!\n");*/ return 0; } // flowtron - happens when I call "/stopdemo"! .. seems the map-load happens in-between
// flowtron : 2008 11 06 : I don't think the following comments are still current
if(!curvote) { /*printf(":: curvote vanished!\n");*/ return 0; } // flowtron - happens when I call "/stopdemo"! .. seems the map-load happens in-between
curvote->stats[v]++;
curvote->localplayervoted = true;
return 1;
@@ -1214,6 +1214,18 @@ void setnext(char *arg1, char *arg2)
}
COMMAND(setnext, ARG_2STR);
void gonext(char *arg1)
{
if(calledvote || !multiplayer(false)) return;
packetbuf p(MAXTRANS, ENET_PACKET_FLAG_RELIABLE);
putint(p, SV_CALLVOTE);
putint(p, SA_MAP);
sendstring("+1", p);
putint(p, atoi(arg1));
sendpackettoserv(1, p.finalize());
}
COMMAND(gonext, ARG_1STR);
COMMANDN(callvote, scallvote, ARG_3STR); //fixme,ah
COMMAND(vote, ARG_1EXP);