diff --git a/source/src/client.cpp b/source/src/client.cpp index 3dc747fe..91288921 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -204,6 +204,17 @@ void sendpackettoserv(void *packet) else localclienttoserver((ENetPacket *)packet); } +void c2skeepalive() +{ + if(clientnum<0 || !clienthost) return; + if(lastmillis-lastupdate<40) return; + + ENetEvent event; + while(clienthost!=NULL && enet_host_service(clienthost, &event, 0)>0) {}; // fixme + + lastupdate = SDL_GetTicks(); +}; + extern string masterpwd; void c2sinfo(dynent *d) // send update to the server diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 1c5b1d86..1ee7e1cc 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -680,6 +680,11 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th getint(p); break; }; + + case SV_NOP: + { + getint(p); break; + }; // End add diff --git a/source/src/cube.h b/source/src/cube.h index d11c1837..90ef9bc8 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -317,6 +317,7 @@ enum SV_BOTITEMPICKUP, SV_BOT2CLIENTDMG, SV_DIEDBYBOT, SV_GETMASTER, SV_MASTERCMD, SV_PWD, + SV_NOP, SV_EXT, }; diff --git a/source/src/protos.h b/source/src/protos.h index 79865ace..5b1f028f 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -69,6 +69,7 @@ extern bool allowedittoggle(); extern void sendpackettoserv(void *packet); extern void gets2c(); extern void c2sinfo(dynent *d); +extern void c2skeepalive(); extern void neterr(char *s); extern void initclientnet(); extern bool netmapstart(); diff --git a/source/src/server.cpp b/source/src/server.cpp index 8f4d47d1..075d363d 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -992,7 +992,6 @@ void serverslice(int seconds, unsigned int timeout) // main server update, cal if(configsets.length()) // EDIT: AH { nextcfgset(); - mapreload = true; changemap(); ctfbroadcast = true; } diff --git a/source/src/serverutil.cpp b/source/src/serverutil.cpp index d1e7b077..35224020 100644 --- a/source/src/serverutil.cpp +++ b/source/src/serverutil.cpp @@ -68,6 +68,7 @@ char msgsizesl[] = // size inclusive message token, 0 for variable SV_BOTITEMPICKUP, 3, SV_BOT2CLIENTDMG, 5, SV_DIEDBYBOT, 2, SV_GETMASTER, 0, SV_MASTERCMD, 3, SV_PWD, 0, + SV_NOP, 1, SV_EXT, 0, -1 }; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index fdb87656..035f86b3 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -16,7 +16,7 @@ guninfo guns[NUMGUNS] = { S_SHOTGUN, S_RSHOTGUN, 2400, 1000, 6, 0, 0, 1, 35, 7, 9, 9, false, "shotgun" }, //reload time is for 1 shell from 7 too powerful to 6 { S_SUBGUN, S_RSUBGUN, 1650, 80, 17, 0, 0, 70, 15, 30, 1, 2, true, "subgun" }, { S_SNIPER, S_RSNIPER, 1950, 1500, 72, 0, 0, 60, 50, 5, 4, 4, false, "sniper" }, - { S_ASSAULT, S_RASSAULT, 2000, 130, 20, 0, 0, 20, 40, 20, 0, 2, true, "assault" }, //recoil was 44 + { S_ASSAULT, S_RASSAULT, 2000, 130, /*20*/25, 0, 0, 20, 40, 20, 0, 2, true, "assault" }, //recoil was 44 { S_NULL, S_NULL, 1000, 1200, 150, 20, 6, 1, 1, 1, 3, 1, "grenade" }, }; @@ -67,6 +67,7 @@ void weapon(int gun) void shiftweapon(int i) { + if(player1->weaponchanging) return; int gun; switch(player1->gunselect) { @@ -75,8 +76,9 @@ void shiftweapon(int i) case GUN_GRENADE: gun=G_GRENADE; break; default: gun=G_PRIMARY; break; }; - gun += i; - weapon(gun); + gun += i; + weapon(gun); + for(int j = 0; j <= G_NUM && !player1->weaponchanging; j++) { gun += i > 0 ? 1 : -1; weapon(gun); } } COMMAND(weapon, ARG_1INT); diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index e1e33140..bde7df35 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -285,6 +285,7 @@ void load_world(char *mname) // still supports all map formats that have }; free(world); setupworld(hdr.sfactor); + c2skeepalive(); char texuse[256]; loopi(256) texuse[i] = 0; sqr *t = NULL; @@ -349,6 +350,7 @@ void load_world(char *mname) // still supports all map formats that have if(!SOLID(s)) texuse[s->utex] = texuse[s->ftex] = texuse[s->ctex] = 1; }; gzclose(f); + c2skeepalive(); calclight(); settagareas(); conoutf("read map %s (%d milliseconds)", cgzname, SDL_GetTicks()-lastmillis); @@ -363,8 +365,11 @@ void load_world(char *mname) // still supports all map formats that have execfile(pcfname); execfile(mcfname); int xs, ys; + c2skeepalive(); loopi(256) if(texuse) lookuptexture(i, xs, ys); + c2skeepalive(); preload_mapmodels(); + c2skeepalive(); }; COMMANDN(savemap, save_world, ARG_1STR); diff --git a/source/vcpp/cube.suo b/source/vcpp/cube.suo index 7c46c290..becf9569 100644 Binary files a/source/vcpp/cube.suo and b/source/vcpp/cube.suo differ