diff options
| author | Narendra Umate <[email protected]> | 2013-09-07 15:43:32 -0700 |
|---|---|---|
| committer | Narendra Umate <[email protected]> | 2013-09-07 15:43:32 -0700 |
| commit | c3ca7291626b60a32008774dd290671708babc20 (patch) | |
| tree | c87d1097bb8b59b6724ca19560f7c92b0309caf3 /mp/src/game/server/client.cpp | |
| parent | Update .gitignore. (diff) | |
| parent | Added missing libs for linux and OSX in their new location. (diff) | |
| download | source-sdk-2013-c3ca7291626b60a32008774dd290671708babc20.tar.xz source-sdk-2013-c3ca7291626b60a32008774dd290671708babc20.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mp/src/game/server/client.cpp')
| -rw-r--r-- | mp/src/game/server/client.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mp/src/game/server/client.cpp b/mp/src/game/server/client.cpp index 2fd87cfe..39905046 100644 --- a/mp/src/game/server/client.cpp +++ b/mp/src/game/server/client.cpp @@ -798,6 +798,24 @@ CON_COMMAND( give, "Give item to player.\n\tArguments: <item_name>" ) Q_strncpy( item_to_give, args[1], sizeof( item_to_give ) );
Q_strlower( item_to_give );
+ // Don't allow regular users to create point_servercommand entities for the same reason as blocking ent_fire
+ if ( !Q_stricmp( item_to_give, "point_servercommand" ) )
+ {
+ if ( engine->IsDedicatedServer() )
+ {
+ // We allow people with disabled autokick to do it, because they already have rcon.
+ if ( pPlayer->IsAutoKickDisabled() == false )
+ return;
+ }
+ else if ( gpGlobals->maxClients > 1 )
+ {
+ // On listen servers with more than 1 player, only allow the host to create point_servercommand.
+ CBasePlayer *pHostPlayer = UTIL_GetListenServerHost();
+ if ( pPlayer != pHostPlayer )
+ return;
+ }
+ }
+
// Dirty hack to avoid suit playing it's pickup sound
if ( !Q_stricmp( item_to_give, "item_suit" ) )
{
|