Commit Graph

7 Commits (a2d86a9fa495ed08435bb0393aaf5fae188b68df)

Author SHA1 Message Date
ffarahmand-DPS 606de5427b
Fixes debug console autocomplete issues (#4223)
* Fixed a crash caused by large autocomplete results in the debug console. A fixed vector was growing beyond its allocated size.

Signed-off-by: ffarahmand-DPS <ffarahmand@digitalpilgrims.com>

* Fixes printing duplicate autocomplete results, caused by looping over multiple CVARs registered with the same name. Also adds an erase to prevent undefined behavior.

Signed-off-by: ffarahmand-DPS <ffarahmand@digitalpilgrims.com>

* Adds a test case for autocomplete duplication in the event of multiple cvars existing under the same name. Two matching cvars are created and checked against the number of matches produced by autocomplete.

Signed-off-by: ffarahmand-DPS <ffarahmand@digitalpilgrims.com>

* Added two safety checks and made a pointer const as per reviewer feedback.

Signed-off-by: ffarahmand-DPS <ffarahmand@digitalpilgrims.com>
4 years ago
lumberyard-employee-dm 586678a5f9
Added a deferred queue to the AZ Console class (#3298)
* Added a deferred queue to the AZ Console class

An AZ Console instance will now store any console commands that could be
dispatched from a configuration file into a deferred queue, that can be
invoked later.

This can be used to defer execution of console commands in configuration files such as
.cfg, .setreg and .setregpatch files that are defined in gem modules that
have not been loaded yet.
The defered execution can then be invoked at any point later in the
application

Updated the Component Application CreateCommon function to invoke deferred console commands
after all the gems have loaded

fixes #2062

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Fixed variable shadowing in the Console Deferred Command Test

Updated commit for the ClearDeferredQueue function to just mention
clearing the queue

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Filtered out execution of the ConsoleRootCommandKey as a console command

The AZ::Console notification handler is tracking changes to the fields
of "/Amazon/AzCore/Runtime/ConsoleCommands" and it's children.

Now the "/Amazon/AzCore/Runtime/ConsoleCommands" field is the
ConsoleRootCommandKey and not an actual console command so it shouldn't
attempt to be invoked

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Moved the execution of deferred console commands after linking deferred
functors

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Moved the execution of deferred console commands into CreateModuleClass
hook

Any module that loads using the ModuleManager system will attempt to
execute any deferred console commands to allow newly registered commands
from that module to be dispatched.

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
Steve Pham 38261d0800
Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago
Steve Pham b4a2edec6a
Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
5 years ago
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 5 years ago
lumberyard-employee-dm 0b35d27833
Added support to the AZ Console to be notified when the Settings Registry modifies a particular path (#691)
* Updated the SettingsRegistry CommandLineArgumentSettings delimiter function to no longer work on a character basis, but on a line basis.
This provides more control by the user to determine how to the argument into the JSON pointer and JSON value parts

Added function o the Settings Registry to specify the JSON Apply Patch settings to use when performing a JSON Patch/Merge Patch operation

Fixed the SettingsRegistryImpl::CommandLineArgument function to properly set unsigned 64-bit values into the SettingsRegistry by checking the ERRNO of strtoll and strtoull

* Updated the reporting of the JSON Patching operations to supply a JSON pointer of the patched element to the Issue Reporting callback when the patch operation is successful. This allows using the Issue Reporting callback as a notification system when field is updated during a patch operation

* Added support to the AZ Console to be able to run Console Commands based
on notifications from the Settings Registry when a field underneath the
"/Amazon/AzCore/Runtime/ConsoleCommands" object is modified.

This takes advantage of the Settings Registry RegisterNotifier API to
determine when a field is modified as well as the JSON Merger
JsonApplyPatchSettings Issue Reporting Callback to determine when a
field is modified or updated.

As a Side Note also fixed an issue with the AZ Console incorrectly
converting unsigned 64-bit types using strtoll

* Making the Console constructor which accepts an AZ::SettingsRegistryInterface explicit

* Updating string format calls which use *.s for formatting string_views, to use the AZ_STRING_ARG macro

* Addressed typos in comments around the SettingsRegistry AZ Console functions

* Fixed the SettingsRegistryTest that look for an empty value

* clang 6.0.0 constexpr build fix. For some reason clang cannot make a constexpr AZStd::string_view out of a constexpr AZStd::fixed_string despite there being a valid constexpr operator AZStd::string_view

* Mac build fix

* SettingsRegistryTest.MergeSettingsFolder_ConflictingSpecializations_ReportsErrorAndReturnsFalse test fix on Mac

* Updated the LoadSettingsFile test to validate running a console with 0 arguments

Replace the static_cast in the ConsoleTypeHelpers.inl code to convert a str to long long with an aznumeric_cast

* Added printf logging to the ConsoleCommandKeyNotificationHandler to determine if the console commands are being performed on the Jenkins Linux node

* Fixed Dangling string_view reference in the ConsoleCommandKeyNotificationHandler that was causing command execution from a file to fail.

Renamed the second TestFreeFunc function in the ConsoleTests.cpp to validate thath the first TestFreeFunc function is being tested

* Updated the Component Application AZ Console to use the SettingsRegistry as the backend when loading config and Settings Rgistry json files
5 years ago
alexpete a10351f38d Initial commit 5 years ago