diff --git a/source/src/client.cpp b/source/src/client.cpp index 283e801b..3dc747fe 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -347,8 +347,3 @@ void gets2c() // get updates from the server return; } }; - -void lsinfo() -{ - printf("%i %i\n", player1->ammo[player1->gunselect], player1->mag[player1->gunselect]); -}; COMMAND(lsinfo, ARG_NONE); diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 925c18da..1c5b1d86 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -676,9 +676,8 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th case SV_MASTERCMD: { - int cmd = getint(p), arg1 = getint(p); - dynent *a = getclient(arg1); - if(a && d) conoutf("player %s has been %s by %s", a->name, cmd == MCMD_KICK ? "kicked" : "banned", d->name); + getint(p); + getint(p); break; }; diff --git a/source/src/cube.h b/source/src/cube.h index 3bc16da9..d11c1837 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -292,8 +292,8 @@ enum { M_NONE = 0, M_SEARCH, M_HOME, M_ATTACKING, M_PAIN, M_SLEEP, M_AIMING, M_N #define MAXCLIENTS 256 // in a multiplayer game, can be arbitrarily changed #define MAXTRANS 5000 // max amount of data to swallow in 1 go -#define CUBE_SERVER_PORT 28764 -#define CUBE_SERVINFO_PORT 28766 +#define CUBE_SERVER_PORT 28763 +#define CUBE_SERVINFO_PORT 28764 #define PROTOCOL_VERSION 123 // bump when protocol changes #define WEAPONCHANGE_TIME 400 diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 5ab151af..50517507 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -243,8 +243,10 @@ bool menukey(int code, bool isdown) if(vmenu==1) connects(getservername(menusel)); else if(vmenu==3 || vmenu==4) { - mastercommand(vmenu==3 ? MCMD_KICK : MCMD_BAN, (int)action); + int cn = (int)action; + mastercommand(vmenu==3 ? MCMD_KICK : MCMD_BAN, cn); purgemenu(vmenu); + menuset(-1); return true; } menustack.add(vmenu); diff --git a/source/src/physics.cpp b/source/src/physics.cpp index e215c351..051d8031 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -296,12 +296,6 @@ void moveplayer(dynent *pl, int moveres, bool local, int curtime) else if(pl->monsterstate) playsound(S_JUMP, &pl->o); else if(pl->bIsBot) botplaysound(S_JUMP, pl); // Added by Rick } - /*else if(pl->timeinair>800) // if we land after long time must have been a high jump, make thud sound - { - if(local) playsoundc(S_LAND); - else if(pl->monsterstate) playsound(S_LAND, &pl->o); - else if(pl->bIsBot) botplaysound(S_LAND, pl); // Added by Rick - };*/ pl->timeinair = 0; if(pl->isphysent) pl->vel.z *= 0.7f; } @@ -332,7 +326,7 @@ void moveplayer(dynent *pl, int moveres, bool local, int curtime) if(collide(pl, false, drop, rise)) { d.x = 0; - if(pl->isphysent) pl->vel.x = -pl->vel.x; + if(pl->isphysent) pl->vel.x = -pl->vel.x; continue; }; pl->o.x += f*d.x; diff --git a/source/src/server.cpp b/source/src/server.cpp index 2b9f820e..2cd40645 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -546,7 +546,11 @@ bool isbanned(int cn) void getmaster(int sender, char *pwd) { if(!pwd[0] || !isdedicated) return; - if(masterpasswd && !strcmp(masterpasswd, pwd)) clients[sender].ismaster = true; + if(masterpasswd && !strcmp(masterpasswd, pwd)) + { + clients[sender].ismaster = true; + sendservmsg("master login successful", sender); + } else disconnect_client(sender, "failed master login"); }; @@ -560,6 +564,7 @@ void mastercmd(int sender, int cmd, int a) { if(!valid_client(a)) return; disconnect_client(a, "kicked by master"); + sendservmsg("player kicked"); break; }; case MCMD_BAN: @@ -568,11 +573,13 @@ void mastercmd(int sender, int cmd, int a) ban b = { clients[a].peer->address, lastsec+20*60 }; bans.add(b); disconnect_client(a, "banned by master"); + sendservmsg("player banned"); break; }; case MCMD_REMBANS: { if(bans.length()) bans.setsize(0); + sendservmsg("bans removed"); break; }; }; @@ -840,6 +847,21 @@ void process(ENetPacket * packet, int sender) // sender may be -1 return; }; + case SV_MASTERCMD: + { + SENDER_CHECK; + int cmd = getint(p); + int arg = getint(p); + mastercmd(sender, cmd, arg); + break; + }; + + case SV_PWD: + { + sgetstr(); + return; + }; + default: { int size = msgsizelookup(type); @@ -848,7 +870,8 @@ void process(ENetPacket * packet, int sender) // sender may be -1 }; }; - if(p>end) { if(sender>=0) disconnect_client(sender, "end of packet"); return; }; + if(p>end) { if(sender>=0) + disconnect_client(sender, "end of packet"); return; }; multicast(packet, sender); }; diff --git a/source/vcpp/cube.suo b/source/vcpp/cube.suo index 4146f07e..acb4707e 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 99341e2c..4bedf1cd 100644 --- a/source/vcpp/cube.vcproj +++ b/source/vcpp/cube.vcproj @@ -274,7 +274,7 @@ ForceConformanceInForLoopScope="TRUE" UsePrecompiledHeader="0" PrecompiledHeaderThrough="cube.h" - PrecompiledHeaderFile=".\Standalone/cube.pch" + PrecompiledHeaderFile="Standalone/cube.pch" WarningLevel="3" SuppressStartupBanner="TRUE" Detect64BitPortabilityProblems="TRUE"