@ -46,6 +46,9 @@ var private /*config*/ bool useMutateInput;
// Chat messages, prepended by this prefix will be treated as commands.
// Chat messages, prepended by this prefix will be treated as commands.
// Default is "!". Empty values are also treated as "!".
// Default is "!". Empty values are also treated as "!".
var private /*config*/ Text chatCommandPrefix;
var private /*config*/ Text chatCommandPrefix;
// List of steam IDs of players allowed to use commands.
// Temporary measure until a better solution is finished.
var private /*config*/ array<string> allowedPlayers;
var LoggerAPI.Definition errCommandDuplicate;
var LoggerAPI.Definition errCommandDuplicate;
@ -94,6 +97,7 @@ protected function SwapConfig(FeatureConfig config)
}
}
_.memory.Free(chatCommandPrefix);
_.memory.Free(chatCommandPrefix);
chatCommandPrefix = _.text.FromString(newConfig.chatCommandPrefix);
chatCommandPrefix = _.text.FromString(newConfig.chatCommandPrefix);
allowedPlayers = newConfig.allowedPlayers;
if (useChatInput != newConfig.useChatInput)
if (useChatInput != newConfig.useChatInput)
{
{
useChatInput = newConfig.useChatInput;
useChatInput = newConfig.useChatInput;
@ -423,6 +427,8 @@ public final function array<Text> GetGroupsNames()
*/
*/
public final function HandleInput(Parser parser, EPlayer callerPlayer)
public final function HandleInput(Parser parser, EPlayer callerPlayer)
{
{
local int i;
local bool foundID;
local string steamID;
local string steamID;
local PlayerController controller;
local PlayerController controller;
local Command commandInstance;
local Command commandInstance;
@ -435,11 +441,15 @@ public final function HandleInput(Parser parser, EPlayer callerPlayer)
if (controller == none) return;
if (controller == none) return;
steamID = controller.GetPlayerIDHash();
steamID = controller.GetPlayerIDHash();
if ( steamID != "76561198025127722"
for (i = 0; i < allowedPlayers.length; i += 1)
&& steamID != "76561198044316328"
{
&& steamID != "76561198003353515"
if (allowedPlayers[i] == steamID)
&& steamID != "76561198281136503")
{
{
foundID = true;
break;
}
}
if (!foundID) {
return;
return;
}
}
parser.MUntilMany(commandName, commandDelimiters, true, true);
parser.MUntilMany(commandName, commandDelimiters, true, true);