Browse Source

Added access filter to RenX::Server::triggerCommand(); RenX::GameCommand::access now defaults to 0.

pull/3/head
JustinAJ 10 years ago
parent
commit
e196688a30
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 2
      RenX.Core/RenX_GameCommand.h
  3. 3
      RenX.Core/RenX_Server.cpp

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

2
RenX.Core/RenX_GameCommand.h

@ -98,7 +98,7 @@ namespace RenX
virtual ~GameCommand(); virtual ~GameCommand();
private: private:
int access; /** Minimum access level */ int access = 0; /** Minimum access level */
}; };
} }

3
RenX.Core/RenX_Server.cpp

@ -427,7 +427,10 @@ unsigned int RenX::Server::triggerCommand(const Jupiter::ReadableString &trigger
cmd = RenX::Server::commands.get(i); cmd = RenX::Server::commands.get(i);
if (cmd->matches(trigger)) if (cmd->matches(trigger))
{ {
if (player->access >= cmd->getAccessLevel())
cmd->trigger(this, player, parameters); cmd->trigger(this, player, parameters);
else
RenX::Server::sendMessage(player, STRING_LITERAL_AS_REFERENCE("Access Denied."));
r++; r++;
} }
} }

Loading…
Cancel
Save