From 2c16fc30897ceaea25b418507904685472581931 Mon Sep 17 00:00:00 2001 From: driAn Date: Sun, 15 Oct 2006 14:58:52 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@438 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 5 ----- source/src/clients2c.cpp | 5 ++--- source/src/cube.h | 4 ++-- source/src/menus.cpp | 4 +++- source/src/physics.cpp | 8 +------- source/src/server.cpp | 27 +++++++++++++++++++++++++-- source/vcpp/cube.suo | Bin 21504 -> 26112 bytes source/vcpp/cube.vcproj | 2 +- 8 files changed, 34 insertions(+), 21 deletions(-) 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 4146f07e764016d1b2985a4f67cb2301cac6daa5..acb4707e8fa607dd085e0562b6e62b135bf2b68d 100644 GIT binary patch delta 1943 zcmds2U2Icj82;YVc5SyhS6Ws#CZ4rh*R2!x8)w(ViUT$n%%-3*qLpL`VZ0X-y>KYX3>u5)f`p3&vqUA#keO)WjkjKk$hm4f(Rr45&zC&sygyIh z?|HxTp403MW#=h(PNC(gsEaR^sI+`F+D+%p!{sgC{`upfJKvB=2oY)5PM8lXRXbpJ z17Tn}pU)T2&r2nn0v{vV3-kdyfn9)P?8bc$FtFlt#M(@sXh*Ein;s%7f^Go3JTI8* zc(L?0&zW0!v22pE+PLGU`QdUwB*Y6~od%xZsME#!y)|0axkx3A2;Fn?3D;Zn4&Qa1 zr1yE;eam54sadG2Wj0P)=qK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ube.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"