Browse Source

Change commands to adapt to new AcediaCore

develop
Anton Tarasenko 1 year ago
parent
commit
b4cde8c458
  1. 64
      sources/Commands/ACommandDB.uc
  2. 35
      sources/Commands/ACommandDosh.uc
  3. 97
      sources/Commands/ACommandFeature.uc
  4. 30
      sources/Commands/ACommandGod.uc
  5. 66
      sources/Commands/ACommandInventory.uc
  6. 38
      sources/Commands/ACommandNick.uc
  7. 32
      sources/Commands/ACommandSpawn.uc
  8. 104
      sources/Commands/ACommandTrader.uc
  9. 31
      sources/Commands/ACommandUserData.uc
  10. 6
      sources/Futility_Feature.uc
  11. 10
      sources/Tools/PendingConfigsTool.uc

64
sources/Commands/ACommandDB.uc

@ -74,39 +74,39 @@ var protected const int TDB_CANNOT_BE_CREATED, TNO_DEFAULT_COMMAND, TBAD_DBLINK;
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(P("db")).Group(P("admin"))
.Summary(P("Read and edit data in your databases."
builder.Group(P("admin"));
builder.Summary(P("Read and edit data in your databases."
@ "Databases' values are addressed with links:"
@ "\"<db_name>:<json_path>\""));
builder.SubCommand(T(TCREATE))
.ParamText(T(TDATABASE_NAME))
.Describe(P("Creates new database with a specified name."));
builder.SubCommand(T(TDELETE))
.ParamText(T(TDATABASE_NAME))
.Describe(P("Completely deletes specified database."));
builder.SubCommand(T(TLIST))
.Describe(P("Lists available databases."));
builder.SubCommand(T(TREAD))
.ParamText(T(TDATABASE_LINK))
.Describe(P("Reads data from location given by the `databaseLink`."));
builder.SubCommand(T(TSIZE))
.ParamText(T(TDATABASE_LINK))
.Describe(P("Gets amount of elements inside JSON array or object at"
builder.SubCommand(T(TCREATE));
builder.ParamText(T(TDATABASE_NAME));
builder.Describe(P("Creates new database with a specified name."));
builder.SubCommand(T(TDELETE));
builder.ParamText(T(TDATABASE_NAME));
builder.Describe(P("Completely deletes specified database."));
builder.SubCommand(T(TLIST));
builder.Describe(P("Lists available databases."));
builder.SubCommand(T(TREAD));
builder.ParamText(T(TDATABASE_LINK));
builder.Describe(P("Reads data from location given by the `databaseLink`."));
builder.SubCommand(T(TSIZE));
builder.ParamText(T(TDATABASE_LINK));
builder.Describe(P("Gets amount of elements inside JSON array or object at"
@ "location given by the `databaseLink`."));
builder.SubCommand(T(TKEYS))
.ParamText(T(TDATABASE_LINK))
.Describe(P("Lists keys of JSON object at location given by"
builder.SubCommand(T(TKEYS));
builder.ParamText(T(TDATABASE_LINK));
builder.Describe(P("Lists keys of JSON object at location given by"
@ "the `databaseLink`."));
builder.SubCommand(T(TREMOVE))
.ParamText(T(TDATABASE_LINK))
.Describe(P("Removes data from location given by the `databaseLink`."));
builder.SubCommand(T(TWRITE))
.ParamText(T(TDATABASE_LINK))
.ParamJSON(T(TJSON_VALUE))
.Describe(P("Writes specified JSON value into location given by"
builder.SubCommand(T(TREMOVE));
builder.ParamText(T(TDATABASE_LINK));
builder.Describe(P("Removes data from location given by the `databaseLink`."));
builder.SubCommand(T(TWRITE));
builder.ParamText(T(TDATABASE_LINK));
builder.ParamJSON(T(TJSON_VALUE));
builder.Describe(P("Writes specified JSON value into location given by"
@ "the `databaseLink`."));
builder.Option(T(TINCREMENT))
.Describe(F("Specifying this option for any of the"
builder.Option(T(TINCREMENT));
builder.Describe(F("Specifying this option for any of the"
@ "{$TextEmphasis 'write'} subcommands will cause them to append"
@ "data to the old one, instead of rewriting it."));
}
@ -152,8 +152,11 @@ protected function EPlayer PopPlayer(Database relevantDatabase)
return none;
}
protected function Executed(CallData arguments, EPlayer instigator)
{
protected function Executed(
CallData arguments,
EPlayer instigator,
CommandPermissions permissions
) {
local AcediaObject valueToWrite;
local DBPointerPair pair;
local Text subCommand;
@ -422,6 +425,7 @@ protected function DisplayResponse(
defaultproperties
{
preferredName = "db"
TCREATE = 0
stringConstants(0) = "create"
TDELETE = 1

35
sources/Commands/ACommandDosh.uc

@ -29,23 +29,23 @@ protected function Finalizer()
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(P("dosh")).Group(P("gameplay"))
.Summary(P("Changes amount of money."));
builder.Group(P("gameplay"));
builder.Summary(P("Changes amount of money."));
builder.RequireTarget();
builder.ParamInteger(P("amount"))
.Describe(P("Gives (or takes if negative) players a specified <amount>"
builder.ParamInteger(P("amount"));
builder.Describe(P("Gives (or takes if negative) players a specified <amount>"
@ "of money."));
builder.SubCommand(P("set"))
.ParamInteger(P("amount"))
.Describe(P("Sets player's money to a specified <amount>."));
builder.Option(P("min"))
.ParamInteger(P("minValue"))
.Describe(F("Players will retain at least this amount of dosh after"
builder.SubCommand(P("set"));
builder.ParamInteger(P("amount"));
builder.Describe(P("Sets player's money to a specified <amount>."));
builder.Option(P("min"));
builder.ParamInteger(P("minValue"));
builder.Describe(F("Players will retain at least this amount of dosh after"
@ "the command's execution. In case of conflict, overrides"
@ "'{$TextEmphasis --max}' option. `0` is assumed by default."));
builder.Option(P("max"), P("M"))
.ParamInteger(P("maxValue"))
.Describe(F("Players will have at most this amount of dosh after"
builder.Option(P("max"), P("M"));
builder.ParamInteger(P("maxValue"));
builder.Describe(F("Players will have at most this amount of dosh after"
@ "the command's execution. In case of conflict, it is overridden"
@ "by '{$TextEmphasis --min}' option."));
announcer = ACommandDosh_Announcer(
@ -55,8 +55,9 @@ protected function BuildData(CommandDataBuilder builder)
protected function ExecutedFor(
EPlayer target,
CallData arguments,
EPlayer instigator)
{
EPlayer instigator,
CommandPermissions permissions
) {
local int oldAmount, newAmount;
local int amount, minValue, maxValue;
@ -88,6 +89,6 @@ protected function ExecutedFor(
}
}
defaultproperties
{
defaultproperties {
preferredName = "dosh"
}

97
sources/Commands/ACommandFeature.uc

@ -42,66 +42,69 @@ protected function Finalizer()
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(P("feature")).Group(P("admin"))
.Summary(P("Managing features."))
.Describe(P("Command for managing features and their configs."));
builder.SubCommand(P("enable"))
.ParamText(P("feature"),, P("feature"))
.OptionalParams()
.ParamText(P("config"))
.Describe(P("Enables specified <feature>. If <config> isn't specified -"
builder.Group(P("admin"));
builder.Summary(P("Managing features."));
builder.Describe(P("Command for managing features and their configs."));
builder.SubCommand(P("enable"));
builder.ParamText(P("feature"),, P("feature"));
builder.OptionalParams();
builder.ParamText(P("config"));
builder.Describe(P("Enables specified <feature>. If <config> isn't specified -"
@ "choses the \"default\" one, making new config with default"
@ "settings if it doesn't exist."));
builder.SubCommand(P("disable"))
.ParamText(P("feature"),, P("feature"))
.Describe(P("Disables specified <feature>."));
builder.SubCommand(P("showconf"))
.ParamText(P("feature"),, P("feature"))
.OptionalParams()
.ParamText(P("config"))
.Describe(P("Show given <config> for the given <feature>."));
builder.SubCommand(P("editconf"))
.ParamText(P("feature"),, P("feature"))
.ParamText(P("config"))
.ParamText(P("variable_path"))
.ParamJSON(P("value"))
.Describe(P("Changes a value inside given <config> of the given"
builder.SubCommand(P("disable"));
builder.ParamText(P("feature"),, P("feature"));
builder.Describe(P("Disables specified <feature>."));
builder.SubCommand(P("showconf"));
builder.ParamText(P("feature"),, P("feature"));
builder.OptionalParams();
builder.ParamText(P("config"));
builder.Describe(P("Show given <config> for the given <feature>."));
builder.SubCommand(P("editconf"));
builder.ParamText(P("feature"),, P("feature"));
builder.ParamText(P("config"));
builder.ParamText(P("variable_path"));
builder.ParamJSON(P("value"));
builder.Describe(P("Changes a value inside given <config> of the given"
@ "<feature> by setting value at JSON path <variable_path> to"
@ "the JSON value <value>. Changes won't be immediately applied to"
@ "the game and kept as pending."));
builder.SubCommand(P("saveconf"))
.ParamText(P("feature"),, P("feature"))
.ParamText(P("config"))
.Describe(P("Saves pending changes for the given <config> of the given"
builder.SubCommand(P("saveconf"));
builder.ParamText(P("feature"),, P("feature"));
builder.ParamText(P("config"));
builder.Describe(P("Saves pending changes for the given <config> of the given"
@ "<feature>."));
builder.SubCommand(P("newconf"))
.ParamText(P("feature"),, P("feature"))
.ParamText(P("config"))
.Describe(P("Creates new config for the given <feature>."));
builder.SubCommand(P("removeconf"))
.ParamText(P("feature"),, P("feature"))
.ParamText(P("config"))
.Describe(P("Removes specified <config> of the specified <feature>."));
builder.SubCommand(P("autoconf"))
.ParamText(P("feature"),, P("feature"))
.OptionalParams()
.ParamText(P("config"))
.Describe(P("Changes current auto config config of the specified"
builder.SubCommand(P("newconf"));
builder.ParamText(P("feature"),, P("feature"));
builder.ParamText(P("config"));
builder.Describe(P("Creates new config for the given <feature>."));
builder.SubCommand(P("removeconf"));
builder.ParamText(P("feature"),, P("feature"));
builder.ParamText(P("config"));
builder.Describe(P("Removes specified <config> of the specified <feature>."));
builder.SubCommand(P("autoconf"));
builder.ParamText(P("feature"),, P("feature"));
builder.OptionalParams();
builder.ParamText(P("config"));
builder.Describe(P("Changes current auto config config of the specified"
@ "<feature>. Auto config is a config that is supposed to be"
@ "automatically enabled at the start of the Acedia, unless"
@ "otherwise specified for the loader."));
builder.Option(P("all"))
.Describe(F("Affects subcommand {$TextEmphasis showconf} by making it"
builder.Option(P("all"));
builder.Describe(F("Affects subcommand {$TextEmphasis showconf} by making it"
@ "show all available configs."));
builder.Option(P("save"))
.Describe(F("Affects subcommand {$TextEmphasis editconf} by making it"
builder.Option(P("save"));
builder.Describe(F("Affects subcommand {$TextEmphasis editconf} by making it"
@ "also save all pending changes."));
announcer = ACommandFeature_Announcer(
_.memory.Allocate(class'ACommandFeature_Announcer'));
}
protected function Executed(CallData arguments, EPlayer instigator)
{
protected function Executed(
CallData arguments,
EPlayer instigator,
CommandPermissions permissions
) {
local bool saveFlag, allFlag;
announcer.Setup(none, instigator, othersConsole);
@ -637,6 +640,6 @@ private function HashTable GetCurrentSelectedConfigData()
return GetCurrentConfigData(selectedConfigName);
}
defaultproperties
{
defaultproperties {
preferredName = "feature"
}

30
sources/Commands/ACommandGod.uc

@ -46,21 +46,21 @@ protected function Finalizer()
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(P("god")).Group(P("gameplay"))
.Summary(P("Command for making player immortal."));
builder.RequireTarget()
.Describe(P("Gives targeted players god status, making them"
builder.Group(P("gameplay"));
builder.Summary(P("Command for making player immortal."));
builder.RequireTarget();
builder.Describe(P("Gives targeted players god status, making them"
@ "invincible."));
builder.SubCommand(P("list"))
.Describe(P("Reports godhood status of targeted players."));
builder.SubCommand(P("strip"))
.Describe(P("Strips targeted players from the godhood status."));
builder.Option(P("demi"))
.Describe(P("This flag makes targeted players \"demigods\" instead -"
builder.SubCommand(P("list"));
builder.Describe(P("Reports godhood status of targeted players."));
builder.SubCommand(P("strip"));
builder.Describe(P("Strips targeted players from the godhood status."));
builder.Option(P("demi"));
builder.Describe(P("This flag makes targeted players \"demigods\" instead -"
@ "they still cannot die, but they can take any non-lethal"
@ "damage."));
builder.Option(P("unmovable"))
.Describe(P("This flag also prevents targeted players from being"
builder.Option(P("unmovable"));
builder.Describe(P("This flag also prevents targeted players from being"
@ "affected by the momentum trasnferred from damaging attacks."));
announcer = ACommandGod_Announcer(
_.memory.Allocate(class'ACommandGod_Announcer'));
@ -69,8 +69,9 @@ protected function BuildData(CommandDataBuilder builder)
protected function ExecutedFor(
EPlayer target,
CallData arguments,
EPlayer instigator)
{
EPlayer instigator,
CommandPermissions permissions
) {
local GodStatus newGodStatus;
announcer.Setup(target, instigator, othersConsole);
@ -215,6 +216,7 @@ private final function UpdateHealthSignalConnection()
defaultproperties
{
preferredName = "god"
TDAMAGE = 0
stringConstants(0) = "damage"
TMOMENTUM = 1

66
sources/Commands/ACommandInventory.uc

@ -34,57 +34,57 @@ var protected const int TLISTS_SKIPPED;
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(T(TINVENTORY)).Group(P("gameplay"))
.Summary(P("Manages player's inventory."))
.Describe(P("Command for displaying and editing players' inventories."
builder.Group(P("gameplay"));
builder.Summary(P("Manages player's inventory."));
builder.Describe(P("Command for displaying and editing players' inventories."
@ "If called without specifying subcommand - simply displays"
@ "targeted player's inventory."));
builder.RequireTarget();
builder.SubCommand(T(TADD))
.OptionalParams()
.ParamTextList(T(TITEMS))
.Describe(P("This command adds items (based on listed templates) to"
builder.SubCommand(T(TADD));
builder.OptionalParams();
builder.ParamTextList(T(TITEMS));
builder.Describe(P("This command adds items (based on listed templates) to"
@ "the targeted player's inventory."
@ "Instead of templates item aliases can be specified."));
builder.SubCommand(T(TREMOVE))
.OptionalParams()
.ParamTextList(T(TITEMS))
.Describe(P("This command removes items (based on listed templates)"
builder.SubCommand(T(TREMOVE));
builder.OptionalParams();
builder.ParamTextList(T(TITEMS));
builder.Describe(P("This command removes items (based on listed templates)"
@ "from the targeted player's inventory."
@ "Instead of templates item aliases can be specified."));
builder.SubCommand(T(TSET))
.OptionalParams()
.ParamTextList(T(TITEMS))
.Describe(P("This command acts like combination of two commands -"
builder.SubCommand(T(TSET));
builder.OptionalParams();
builder.ParamTextList(T(TITEMS));
builder.Describe(P("This command acts like combination of two commands -"
@ "first removing all items from the player's current inventory and"
@ "then adding specified items. first clears inventory"
@ "(based on specified options) and then "));
builder.Option(T(TEQUIP))
.Describe(F("Affect items currently equipped by the targeted player."
builder.Option(T(TEQUIP));
builder.Describe(F("Affect items currently equipped by the targeted player."
@ "Releveant for a {$TextEmphasis remove} subcommand."));
builder.Option(T(TLIST))
.Describe(P("Include weapons from specified group into the list."))
.ParamTextList(T(TLISTS_NAMES));
builder.Option(T(TAMMO))
.Describe(P("When adding weapons - signals that their"
builder.Option(T(TLIST));
builder.Describe(P("Include weapons from specified group into the list."));
builder.ParamTextList(T(TLISTS_NAMES));
builder.Option(T(TAMMO));
builder.Describe(P("When adding weapons - signals that their"
@ "ammo / charge / whatever has to be filled after addition."));
builder.Option(T(TKEEP))
.Describe(F("Removing items by default means simply destroying them."
builder.Option(T(TKEEP));
builder.Describe(F("Removing items by default means simply destroying them."
@ "This flag makes command to try and keep them in some form."
@ "Success for all items is not guaranteed."));
builder.Option(T(THIDDEN))
.Describe(F("Some of the items in the inventory are"
builder.Option(T(THIDDEN));
builder.Describe(F("Some of the items in the inventory are"
@ "{$TextEmphasis hidden} and are not supposed to be seem by"
@ "the player. To avoid weird behavior, {$TextEmphasis inventory}"
@ "command by default ignores them when affecting groups of items"
@ "(like when removing all items) unless they're directly"
@ "specified. This flag tells it to also affect hidden items."));
builder.Option(T(TFORCE))
.Describe(P("Sometimes adding and removing items is impossible due to"
builder.Option(T(TFORCE));
builder.Describe(P("Sometimes adding and removing items is impossible due to"
@ "the limitations imposed by the game. This option allows to"
@ "ignore some of those limitation."));
builder.Option(T(TALL), P("A"))
.Describe(F("This flag is used when removing items. If user has"
builder.Option(T(TALL), P("A"));
builder.Describe(F("This flag is used when removing items. If user has"
@ "specified any weapon templates - it means"
@ "\"remove all items with these tempaltes from inventory\","
@ "but if user has not specified any templated it simply means"
@ -94,8 +94,9 @@ protected function BuildData(CommandDataBuilder builder)
protected function ExecutedFor(
EPlayer target,
CallData arguments,
EPlayer instigator)
{
EPlayer instigator,
CommandPermissions permissions
) {
local InventoryTool tool;
local ArrayList itemsArray, specifiedLists;
LoadUserFlags(arguments.options);
@ -286,6 +287,7 @@ protected function array<Text> LoadItemsList(
defaultproperties
{
preferredName = "inventory"
TINVENTORY = 0
stringConstants(0) = "inventory"
TADD = 1

38
sources/Commands/ACommandNick.uc

@ -34,30 +34,31 @@ protected function Finalizer()
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(P("nick")).Group(P("gameplay"))
.Summary(P("Changes nickname."));
builder.Group(P("gameplay"));
builder.Summary(P("Changes nickname."));
builder.RequireTarget();
builder.ParamRemainder(P("nick"))
.Describe(P("Changes nickname of targeted players to <nick>."));
builder.Option(P("plain"))
.Describe(P("Take nickname exactly as typed, without attempting to"
builder.ParamRemainder(P("nick"));
builder.Describe(P("Changes nickname of targeted players to <nick>."));
builder.Option(P("plain"));
builder.Describe(P("Take nickname exactly as typed, without attempting to"
@ "treat it like formatted string."));
builder.Option(P("fix"), P("f"))
.Describe(P("In case of a nickname with erroroneous formatting or"
builder.Option(P("fix"), P("f"));
builder.Describe(P("In case of a nickname with erroroneous formatting or"
@ "invalid default color (specified with `--color`),"
@ "try to fix/ignore it instead of simply rejecting it."));
builder.Option(P("color"))
.Describe(P("Color to use for the nickname. In case nickname is already"
@ "colored, this flag will only affects uncolored parts."))
.ParamText(P("default_color"));
builder.Option(P("color"));
builder.Describe(P("Color to use for the nickname. In case nickname is already"
@ "colored, this flag will only affects uncolored parts."));
builder.ParamText(P("default_color"));
announcer = ACommandNick_Announcer(
_.memory.Allocate(class'ACommandNick_Announcer'));
}
protected function Executed(
CallData arguments,
EPlayer callerPlayer)
{
EPlayer callerPlayer,
CommandPermissions permissions
) {
local Text givenName;
local array<FormattingErrorsReport.FormattedStringError> errors;
@ -89,8 +90,9 @@ protected function Executed(
protected function ExecutedFor(
EPlayer target,
CallData arguments,
EPlayer instigator)
{
EPlayer instigator,
CommandPermissions permissions
) {
local Text alteredVersion;
if (!foundErrors || arguments.options.HasKey(P("fix")))
@ -126,6 +128,6 @@ protected function bool TryChangeDefaultColor(BaseText specifiedColor)
return false;
}
defaultproperties
{
defaultproperties {
preferredName = "nick"
}

32
sources/Commands/ACommandSpawn.uc

@ -30,17 +30,17 @@ protected function Finalizer()
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(P("spawn")).Group(P("debug"))
.Summary(P("Spawns new entity on the map."));
builder.ParamText(P("template"),, P("entity"))
.Describe(P("Spawns new entity based on the given template at the point"
builder.Group(P("debug"));
builder.Summary(P("Spawns new entity on the map."));
builder.ParamText(P("template"),, P("entity"));
builder.Describe(P("Spawns new entity based on the given template at the point"
@ "player is currently looking at."));
builder.SubCommand(P("at"))
.ParamText(P("template"),, P("entity"))
.ParamNumber(P("x"))
.ParamNumber(P("y"))
.ParamNumber(P("z"))
.Describe(P("Spawns new entity based on the given template at"
builder.SubCommand(P("at"));
builder.ParamText(P("template"),, P("entity"));
builder.ParamNumber(P("x"));
builder.ParamNumber(P("y"));
builder.ParamNumber(P("z"));
builder.Describe(P("Spawns new entity based on the given template at"
@ "the point, given by the coordinates"));
announcer = ACommandSpawn_Announcer(
_.memory.Allocate(class'ACommandSpawn_Announcer'));
@ -48,8 +48,9 @@ protected function BuildData(CommandDataBuilder builder)
protected function Executed(
CallData arguments,
EPlayer instigator)
{
EPlayer instigator,
CommandPermissions permissions
) {
local Text template;
local Vector spawnLocation;
@ -94,7 +95,8 @@ private final function SpawnInInstigatorSight(
local TracingIterator iter;
iter = _server.kf.world.TracePlayerSight(instigator);
if (iter.LeaveOnlyVisible().HasFinished())
iter.LeaveOnlyVisible();
if (iter.HasFinished())
{
announcer.AnnounceFailedTrace();
return;
@ -119,6 +121,6 @@ private final function SpawnInInstigatorSight(
_.memory.Free(iter);
}
defaultproperties
{
defaultproperties {
preferredName = "spawn"
}

104
sources/Commands/ACommandTrader.uc

@ -38,60 +38,60 @@ protected function Finalizer()
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(T(TTRADER)).Group(P("gameplay"))
.Summary(P("Manages trader time and available traders."))
.Describe(P("Enables of disables trading."))
.ParamBoolean(T(TENABLE));
builder.SubCommand(T(TTIME))
.Describe(F("Changes current trader time if numeric value is specified."
builder.Group(P("gameplay"));
builder.Summary(P("Manages trader time and available traders."));
builder.Describe(P("Enables of disables trading."));
builder.ParamBoolean(T(TENABLE));
builder.SubCommand(T(TTIME));
builder.Describe(F("Changes current trader time if numeric value is specified."
@ "You can also pause trader countdown by specifying"
@ "{$TextEmphasis pause} or turn it back on with"
@ "{$TextEmphasis unpause}."))
.ParamText(T(TTRADER_TIME));
builder.SubCommand(T(TLIST))
.Describe(P("Lists names of all available traders and"
@ "{$TextEmphasis unpause}."));
builder.ParamText(T(TTRADER_TIME));
builder.SubCommand(T(TLIST));
builder.Describe(P("Lists names of all available traders and"
@ "marks closest one to the caller."));
builder.SubCommand(T(TOPEN))
.Describe(P("Opens specified traders."))
.OptionalParams()
.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TCLOSE))
.Describe(P("Closes specified traders."))
.OptionalParams()
.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TAUTO_OPEN))
.Describe(P("Sets whether specified traders are open automatically."))
.ParamBoolean(T(TAUTO_OPEN_QUESTION))
.OptionalParams()
.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TSELECT))
.Describe(P("Selects specified trader."))
.OptionalParams()
.ParamText(T(TTRADER));
builder.SubCommand(T(TBOOT))
.Describe(P("Boots all players from specified traders. If no traders"
@ "were specified - assumes that all of them should be affected."))
.OptionalParams()
.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TENABLE))
.Describe(P("Enables specified traders."))
.OptionalParams()
.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TDISABLE))
.Describe(P("Disables specified traders."))
.OptionalParams()
.ParamTextList(T(TTRADERS));
builder.Option(T(TALL))
.Describe(P("If sub-command targets shops, this flag will make it"
builder.SubCommand(T(TOPEN));
builder.Describe(P("Opens specified traders."));
builder.OptionalParams();
builder.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TCLOSE));
builder.Describe(P("Closes specified traders."));
builder.OptionalParams();
builder.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TAUTO_OPEN));
builder.Describe(P("Sets whether specified traders are open automatically."));
builder.ParamBoolean(T(TAUTO_OPEN_QUESTION));
builder.OptionalParams();
builder.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TSELECT));
builder.Describe(P("Selects specified trader."));
builder.OptionalParams();
builder.ParamText(T(TTRADER));
builder.SubCommand(T(TBOOT));
builder.Describe(P("Boots all players from specified traders. If no traders"
@ "were specified - assumes that all of them should be affected."));
builder.OptionalParams();
builder.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TENABLE));
builder.Describe(P("Enables specified traders."));
builder.OptionalParams();
builder.ParamTextList(T(TTRADERS));
builder.SubCommand(T(TDISABLE));
builder.Describe(P("Disables specified traders."));
builder.OptionalParams();
builder.ParamTextList(T(TTRADERS));
builder.Option(T(TALL));
builder.Describe(P("If sub-command targets shops, this flag will make it"
@ "target all the available shops."));
builder.Option(T(TCLOSEST))
.Describe(P("If sub-command targets shops, this flag will make it also"
builder.Option(T(TCLOSEST));
builder.Describe(P("If sub-command targets shops, this flag will make it also"
@ "target closest shop to the caller."));
builder.Option(T(TIGNORE_DOORS))
.Describe(F("When used with {$TextEmphasis select} sub-command, it will"
builder.Option(T(TIGNORE_DOORS));
builder.Describe(F("When used with {$TextEmphasis select} sub-command, it will"
@ "neither open or close doors."));
builder.Option(T(TIGNORE_PLAYERS), P("I"))
.Describe(P("Normally commands that close doors will automatically boot"
builder.Option(T(TIGNORE_PLAYERS), P("I"));
builder.Describe(P("Normally commands that close doors will automatically boot"
@ "players from inside to prevent locking them in. This flag forces"
@ "this command to leave players inside. However they can still be"
@ "booted out at the end of trading time. Also it is impossible to"
@ -100,8 +100,11 @@ protected function BuildData(CommandDataBuilder builder)
_.memory.Allocate(class'ACommandTrader_Announcer'));
}
protected function Executed(CallData arguments, EPlayer instigator)
{
protected function Executed(
CallData arguments,
EPlayer instigator,
CommandPermissions permissions
) {
local bool newTradingStatus;
announcer.Setup(none, instigator, othersConsole);
@ -632,6 +635,7 @@ protected function WriteTraderTags(ETrader traderToWrite, bool isClosest)
defaultproperties
{
preferredName = "trader"
TLIST = 0
stringConstants(0) = "list"
TOPEN = 1

31
sources/Commands/ACommandUserData.uc

@ -23,21 +23,21 @@ var private array<EPlayer> playerQueue;
protected function BuildData(CommandDataBuilder builder)
{
builder.Name(P("userdata")).Group(P("admin"))
.Summary(P("Allows to read and write custom user data for players."));
builder.Group(P("admin"));
builder.Summary(P("Allows to read and write custom user data for players."));
builder.RequireTarget();
builder.ParamText(P("groupName"))
.OptionalParams()
.ParamText(P("dataName"))
.Describe(F("Reads user data stored for targeted user under group"
builder.ParamText(P("groupName"));
builder.OptionalParams();
builder.ParamText(P("dataName"));
builder.Describe(F("Reads user data stored for targeted user under group"
@ "{$TextEmphasis `groupName`} and name"
@ "{$TextEmphasis `dataName`}. If {$TextEmphasis `dataName`} is"
@ "omitted, the data inside the whole group will be read."));
builder.SubCommand(P("write"))
.ParamText(P("groupName"))
.ParamText(P("dataName"))
.ParamJSON(P("newData"))
.Describe(F("Stores new user data {$TextEmphasis `newData`} for"
builder.SubCommand(P("write"));
builder.ParamText(P("groupName"));
builder.ParamText(P("dataName"));
builder.ParamJSON(P("newData"));
builder.Describe(F("Stores new user data {$TextEmphasis `newData`} for"
@ "targeted user under group {$TextEmphasis `groupName`} and name"
@ "{$TextEmphasis `dataName`}."));
}
@ -45,8 +45,9 @@ protected function BuildData(CommandDataBuilder builder)
protected function ExecutedFor(
EPlayer target,
CallData arguments,
EPlayer instigator)
{
EPlayer instigator,
CommandPermissions permissions
) {
local AcediaObject userData;
local Text groupName, dataName;
@ -123,6 +124,6 @@ private final function WriteUserData(
_.memory.Free(identity);
}
defaultproperties
{
defaultproperties {
preferredName = "userdata"
}

6
sources/Futility_Feature.uc

@ -36,7 +36,7 @@ protected function OnEnabled()
return;
}
for (i = 0; i < allCommandClasses.length; i += 1) {
commandsFeature.RegisterCommand(allCommandClasses[i]);
//commandsFeature.RegisterCommand(allCommandClasses[i]);
}
_.environment.OnFeatureEnabled(self).connect = RegisterAllCommandClasses;
}
@ -52,7 +52,7 @@ protected function OnDisabled()
return;
}
for (i = 0; i < allCommandClasses.length; i += 1) {
commandsFeature.RegisterCommand(allCommandClasses[i]);
//ommandsFeature.RegisterCommand(allCommandClasses[i]);
}
}
@ -65,7 +65,7 @@ private final function RegisterAllCommandClasses(Feature enabledFeature)
return;
}
for (i = 0; i < allCommandClasses.length; i += 1) {
commandsFeature.RegisterCommand(allCommandClasses[i]);
//commandsFeature.RegisterCommand(allCommandClasses[i]);
}
}

10
sources/Tools/PendingConfigsTool.uc

@ -189,7 +189,7 @@ public function PendingConfigToolResult EditConfig(
AcediaObject newValue)
{
local HashTable pendingData;
local JSONPointer pointer;
local MutableJsonPointer pointer;
local PendingConfigToolResult result;
if (pathToValue == none) {
@ -200,7 +200,7 @@ public function PendingConfigToolResult EditConfig(
return PCTE_ConfigMissing;
}
// Set new data
pointer = _.json.Pointer(pathToValue);
pointer = _.json.MutablePointer(pathToValue);
result = SetItemByJSON(pendingData, pointer, newValue);
pointer.FreeSelf();
pendingData.FreeSelf();
@ -208,9 +208,9 @@ public function PendingConfigToolResult EditConfig(
}
private function PendingConfigToolResult SetItemByJSON(
HashTable data,
JSONPointer pointer,
AcediaObject jsonValue)
HashTable data,
MutableJsonPointer pointer,
AcediaObject jsonValue)
{
local Text containerIndex;
local AcediaObject container;

Loading…
Cancel
Save