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

35
sources/Commands/ACommandDosh.uc

@ -29,23 +29,23 @@ protected function Finalizer()
protected function BuildData(CommandDataBuilder builder) protected function BuildData(CommandDataBuilder builder)
{ {
builder.Name(P("dosh")).Group(P("gameplay")) builder.Group(P("gameplay"));
.Summary(P("Changes amount of money.")); builder.Summary(P("Changes amount of money."));
builder.RequireTarget(); builder.RequireTarget();
builder.ParamInteger(P("amount")) builder.ParamInteger(P("amount"));
.Describe(P("Gives (or takes if negative) players a specified <amount>" builder.Describe(P("Gives (or takes if negative) players a specified <amount>"
@ "of money.")); @ "of money."));
builder.SubCommand(P("set")) builder.SubCommand(P("set"));
.ParamInteger(P("amount")) builder.ParamInteger(P("amount"));
.Describe(P("Sets player's money to a specified <amount>.")); builder.Describe(P("Sets player's money to a specified <amount>."));
builder.Option(P("min")) builder.Option(P("min"));
.ParamInteger(P("minValue")) builder.ParamInteger(P("minValue"));
.Describe(F("Players will retain at least this amount of dosh after" builder.Describe(F("Players will retain at least this amount of dosh after"
@ "the command's execution. In case of conflict, overrides" @ "the command's execution. In case of conflict, overrides"
@ "'{$TextEmphasis --max}' option. `0` is assumed by default.")); @ "'{$TextEmphasis --max}' option. `0` is assumed by default."));
builder.Option(P("max"), P("M")) builder.Option(P("max"), P("M"));
.ParamInteger(P("maxValue")) builder.ParamInteger(P("maxValue"));
.Describe(F("Players will have at most this amount of dosh after" builder.Describe(F("Players will have at most this amount of dosh after"
@ "the command's execution. In case of conflict, it is overridden" @ "the command's execution. In case of conflict, it is overridden"
@ "by '{$TextEmphasis --min}' option.")); @ "by '{$TextEmphasis --min}' option."));
announcer = ACommandDosh_Announcer( announcer = ACommandDosh_Announcer(
@ -55,8 +55,9 @@ protected function BuildData(CommandDataBuilder builder)
protected function ExecutedFor( protected function ExecutedFor(
EPlayer target, EPlayer target,
CallData arguments, CallData arguments,
EPlayer instigator) EPlayer instigator,
{ CommandPermissions permissions
) {
local int oldAmount, newAmount; local int oldAmount, newAmount;
local int amount, minValue, maxValue; 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) protected function BuildData(CommandDataBuilder builder)
{ {
builder.Name(P("feature")).Group(P("admin")) builder.Group(P("admin"));
.Summary(P("Managing features.")) builder.Summary(P("Managing features."));
.Describe(P("Command for managing features and their configs.")); builder.Describe(P("Command for managing features and their configs."));
builder.SubCommand(P("enable")) builder.SubCommand(P("enable"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.OptionalParams() builder.OptionalParams();
.ParamText(P("config")) builder.ParamText(P("config"));
.Describe(P("Enables specified <feature>. If <config> isn't specified -" builder.Describe(P("Enables specified <feature>. If <config> isn't specified -"
@ "choses the \"default\" one, making new config with default" @ "choses the \"default\" one, making new config with default"
@ "settings if it doesn't exist.")); @ "settings if it doesn't exist."));
builder.SubCommand(P("disable")) builder.SubCommand(P("disable"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.Describe(P("Disables specified <feature>.")); builder.Describe(P("Disables specified <feature>."));
builder.SubCommand(P("showconf")) builder.SubCommand(P("showconf"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.OptionalParams() builder.OptionalParams();
.ParamText(P("config")) builder.ParamText(P("config"));
.Describe(P("Show given <config> for the given <feature>.")); builder.Describe(P("Show given <config> for the given <feature>."));
builder.SubCommand(P("editconf")) builder.SubCommand(P("editconf"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.ParamText(P("config")) builder.ParamText(P("config"));
.ParamText(P("variable_path")) builder.ParamText(P("variable_path"));
.ParamJSON(P("value")) builder.ParamJSON(P("value"));
.Describe(P("Changes a value inside given <config> of the given" builder.Describe(P("Changes a value inside given <config> of the given"
@ "<feature> by setting value at JSON path <variable_path> to" @ "<feature> by setting value at JSON path <variable_path> to"
@ "the JSON value <value>. Changes won't be immediately applied to" @ "the JSON value <value>. Changes won't be immediately applied to"
@ "the game and kept as pending.")); @ "the game and kept as pending."));
builder.SubCommand(P("saveconf")) builder.SubCommand(P("saveconf"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.ParamText(P("config")) builder.ParamText(P("config"));
.Describe(P("Saves pending changes for the given <config> of the given" builder.Describe(P("Saves pending changes for the given <config> of the given"
@ "<feature>.")); @ "<feature>."));
builder.SubCommand(P("newconf")) builder.SubCommand(P("newconf"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.ParamText(P("config")) builder.ParamText(P("config"));
.Describe(P("Creates new config for the given <feature>.")); builder.Describe(P("Creates new config for the given <feature>."));
builder.SubCommand(P("removeconf")) builder.SubCommand(P("removeconf"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.ParamText(P("config")) builder.ParamText(P("config"));
.Describe(P("Removes specified <config> of the specified <feature>.")); builder.Describe(P("Removes specified <config> of the specified <feature>."));
builder.SubCommand(P("autoconf")) builder.SubCommand(P("autoconf"));
.ParamText(P("feature"),, P("feature")) builder.ParamText(P("feature"),, P("feature"));
.OptionalParams() builder.OptionalParams();
.ParamText(P("config")) builder.ParamText(P("config"));
.Describe(P("Changes current auto config config of the specified" builder.Describe(P("Changes current auto config config of the specified"
@ "<feature>. Auto config is a config that is supposed to be" @ "<feature>. Auto config is a config that is supposed to be"
@ "automatically enabled at the start of the Acedia, unless" @ "automatically enabled at the start of the Acedia, unless"
@ "otherwise specified for the loader.")); @ "otherwise specified for the loader."));
builder.Option(P("all")) builder.Option(P("all"));
.Describe(F("Affects subcommand {$TextEmphasis showconf} by making it" builder.Describe(F("Affects subcommand {$TextEmphasis showconf} by making it"
@ "show all available configs.")); @ "show all available configs."));
builder.Option(P("save")) builder.Option(P("save"));
.Describe(F("Affects subcommand {$TextEmphasis editconf} by making it" builder.Describe(F("Affects subcommand {$TextEmphasis editconf} by making it"
@ "also save all pending changes.")); @ "also save all pending changes."));
announcer = ACommandFeature_Announcer( announcer = ACommandFeature_Announcer(
_.memory.Allocate(class'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; local bool saveFlag, allFlag;
announcer.Setup(none, instigator, othersConsole); announcer.Setup(none, instigator, othersConsole);
@ -637,6 +640,6 @@ private function HashTable GetCurrentSelectedConfigData()
return GetCurrentConfigData(selectedConfigName); return GetCurrentConfigData(selectedConfigName);
} }
defaultproperties defaultproperties {
{ preferredName = "feature"
} }

30
sources/Commands/ACommandGod.uc

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

66
sources/Commands/ACommandInventory.uc

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

38
sources/Commands/ACommandNick.uc

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

32
sources/Commands/ACommandSpawn.uc

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

104
sources/Commands/ACommandTrader.uc

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

31
sources/Commands/ACommandUserData.uc

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

6
sources/Futility_Feature.uc

@ -36,7 +36,7 @@ protected function OnEnabled()
return; return;
} }
for (i = 0; i < allCommandClasses.length; i += 1) { for (i = 0; i < allCommandClasses.length; i += 1) {
commandsFeature.RegisterCommand(allCommandClasses[i]); //commandsFeature.RegisterCommand(allCommandClasses[i]);
} }
_.environment.OnFeatureEnabled(self).connect = RegisterAllCommandClasses; _.environment.OnFeatureEnabled(self).connect = RegisterAllCommandClasses;
} }
@ -52,7 +52,7 @@ protected function OnDisabled()
return; return;
} }
for (i = 0; i < allCommandClasses.length; i += 1) { 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; return;
} }
for (i = 0; i < allCommandClasses.length; i += 1) { for (i = 0; i < allCommandClasses.length; i += 1) {
commandsFeature.RegisterCommand(allCommandClasses[i]); //commandsFeature.RegisterCommand(allCommandClasses[i]);
} }
} }

6
sources/Tools/PendingConfigsTool.uc

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

Loading…
Cancel
Save