`AssociativeArray` by design does not manage keys, automatically
deallocating them, like it can with stored values. This patch adds a
parameter to `Empty()` method that allows it to deallocate all of the
used keys when deallocation all of the values.
As a side effect this patch also fixes a bug that broke
`AssociativeArray` after using `Empty()` method.
There wasn't actually any need for `InitializeStatic()` method. In fact
it could lead to problems. Now calling `StaticCosntructor()` is allowed
instead.
Adds additional methods fo rconsole output, also changing how the old
one worked: now most methods do not output player's name in front of the
message, but `Say()` method was added if such behavior is needed.
Additionally fixed issue with `PlayerController` actor being stored
inside `ConsoleWriter` object before.
Now all objects only have to calculate their hash code once and it's
value will be stored for later `GetHashCode()` calls, since has code is
not suppoed to change during their lifetime anyway.
Now `LoggerAPI`, instead of simply loggin messages by itself, uses
logger objects (deriving from `Logger` class) to output log messages for
it (previous way of logging by `Log()` method is available by
`ConsoleLogger`).
Multiple loggers can be configured per each log level, which can be done
via config.
Added more conversion methods from primitive types (`bool`, `byte`,
`int`, `float`) into `Text` and `MutableText` into the standart
`TextAPI`. Made `JSONAPI` use these methods instead.
This is a giga commit, something that should not really be done with
git, but I messed up.
This commit brings a great amount of changes, most important is
reworking `TextAPI` and alsmost complete replacement of `string` with
`Text`/`MutableText`.
Another huge change is introduction of command system that allows to
define commands in a centralized manner, handles auto-parsing of
their parameters and auto generates help info.
Lastly, JSON data types were replaced with new
`DynamicArray`/`AssociativeArray` that are better designed and more
generic.
Refactors `User` to simply store persistent data, while making `APlayer`
represent a connecte playr with appropriate links to `User` and (in
future) his in-game pawn representation.
To avoid needless creation of `APlayerID` classes we need to provide a
separate static method `GetSteamDataFromSteamID64()` that will generate
raw `SteamData` that we can then compare to existing instances of
`APlayerID`.
`GetActiveConnections()` by default returns all connections currently
recorded in `ConnectionService`, which might include broken player
connections, if player disconnected recently and it still was not
properly handled.
Optional parameter was added to clean connections before returning them,
which might cause a change in state of `ConnectionService`.
When `ConnectionService` was before killed and respawned it would cause
a new connection events for every online player, regardless of whether
they were generated before.
Now list of registered players is also saved in default variables for
`ConnectionService` and quick restart will not cause any issues.
Some of the broadcasting events only properly work with full injection
method (`BHIJ_Root`) and some additional work was required to implement
them for `BHIJ_Registered`.
Althought support for `HandleText()` and `HandleLocalized()` events
cannot be perfect with `BHIJ_Registered`, current method should work
good enough for most cases.