diff --git a/source/src/cube.h b/source/src/cube.h index 7b7f5438..afeec09c 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -404,7 +404,8 @@ extern bool demoplayback; 4 - team survior 5 - ctf 6 - pistols -7 - botmatch +7 - bot dm +8 - bot tdm */ #define m_noitems (m_arena) @@ -420,6 +421,8 @@ extern bool demoplayback; //#define m_classicsp (gamemode==-2) #define isteam(a,b) (m_teammode && strcmp(a, b)==0) +#define srvm_notimelimit (mode==1 || mode==7 || mode==8) + #define TEAM_CLA 0 // #define TEAM_RVSF 1 // // rb means red/blue diff --git a/source/src/main.cpp b/source/src/main.cpp index 14adf2cb..064ee08e 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -197,6 +197,7 @@ int main(int argc, char **argv) log("mainloop"); int ignore = 5; + int lastflush = 0; for(;;) { int millis = SDL_GetTicks()*gamespeed/100; @@ -248,6 +249,7 @@ int main(int argc, char **argv) break; }; }; + if(millis>lastflush+60000) { fflush(stdout); lastflush = millis; } }; quit(); return 1; diff --git a/source/src/server.cpp b/source/src/server.cpp index cda7371b..b3adb410 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -555,7 +555,9 @@ void process(ENetPacket * packet, int sender) // sender may be -1 sgetstr(); int reqmode = getint(p); if(reqmode<0) reqmode = 0; + printf("SV_MAPCHANGE %i %s", reqmode, text); if(smapname[0] && !mapreload && !vote(text, reqmode, sender)) return; + printf(" - accepted\n"); mapreload = false; mode = reqmode; minremain = m_ctf_s ? 10 : (mode&1 ? 15 : 10); @@ -781,7 +783,7 @@ void checkintermission() send2(true, -1, SV_TIMEUP, minremain--); }; -void startintermission() { minremain = 0; checkintermission(); }; +/*void startintermission() { minremain = 0; checkintermission(); };*/ void resetserverifempty() { @@ -832,7 +834,8 @@ void serverslice(int seconds, unsigned int timeout) // main server update, cal lastsec = seconds; - if((mode>1 || (mode==0 && nonlocalclients)) && seconds>mapend-minremain*60) checkintermission(); + //if((mode>1 || (mode==0 && nonlocalclients)) && seconds>mapend-minremain*60) checkintermission(); + if(((srvm_notimelimit && !nonlocalclients) || (mode==0 && nonlocalclients)) && seconds>mapend-minremain*60) checkintermission(); if(interm && seconds>interm) { interm = 0; @@ -844,10 +847,10 @@ void serverslice(int seconds, unsigned int timeout) // main server update, cal changemap(); ctfbroadcast = true; } - else - loopv(clients) if(clients[i].type!=ST_EMPTY) + else loopv(clients) if(clients[i].type!=ST_EMPTY) { send2(true, i, SV_MAPRELOAD, 0); // ask a client to trigger map reload + printf("SV_MAPRELOAD\n"); //fixme mapreload = true; break; }; @@ -871,7 +874,7 @@ void serverslice(int seconds, unsigned int timeout) // main server update, cal nonlocalclients = 0; loopv(clients) if(clients[i].type==ST_TCPIP) nonlocalclients++; laststatus = seconds; - if(nonlocalclients || bsend || brec) printf("status: %d remote clients, %.1f send, %.1f rec (K/sec)\n", nonlocalclients, bsend/60.0f/1024, brec/60.0f/1024); + if(nonlocalclients || bsend || brec) { printf("status: %d remote clients, %.1f send, %.1f rec (K/sec)\n", nonlocalclients, bsend/60.0f/1024, brec/60.0f/1024); fflush(stdout); } bsend = brec = 0; }; @@ -912,9 +915,6 @@ void serverslice(int seconds, unsigned int timeout) // main server update, cal disconnect_client(lastconnect, "maxclients reached"); }; }; - #ifndef WIN32 - fflush(stdout); - #endif }; void cleanupserver() diff --git a/source/vcpp/cube.suo b/source/vcpp/cube.suo index 19f2d5fe..d71edfc7 100644 Binary files a/source/vcpp/cube.suo and b/source/vcpp/cube.suo differ diff --git a/source/vcpp/cube.vcproj b/source/vcpp/cube.vcproj index e65d4525..842450f9 100644 --- a/source/vcpp/cube.vcproj +++ b/source/vcpp/cube.vcproj @@ -433,6 +433,9 @@ + +