Commit Graph
94 Commits
Author SHA1 Message Date
83c2a1be11 [Dependency] source generator part 2 (#6550)
* [Dependency] source generator

No more reflection, no more codegen at runtime

Also various changes to Roslyn helpers to make this easier to write.

Requires all types with dependencies to be partial and not have readonly dependency fields. An analyzer enforces this at warning level, the previous injection strategies have remained in the code *for now* as a fallback.

No fallback is available for [field: Dependency] properties, due to a Roslyn bug.

Code Fixes exist. We love Roslyn

* Apply dependencies generator changes to all code

* Release notes

* Preprocessor got hands

* Handle nullable dependencies

These are bad but gotta deal with it.

* Apply suggestions from code review

Co-authored-by: Moony <moony@hellomouse.net>

* Fine, let's not use collection expressions

---------

Co-authored-by: Moony <moony@hellomouse.net>
2026-05-08 12:38:33 +02:00
PJB3005 bb81d88653 Add [NotContentImplementable] to shared interfaces 2025-12-20 16:49:35 +01:00
4747e5a05a Add and update a lot of documentation (#6337)
* Serialization docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* ECS docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* scattered docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* Fixes

---------

Co-authored-by: Moony <moonheart08@users.noreply.github.com>
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-12-15 20:26:17 +01:00
PJB3005 034728258c Add config rollback system
This is intended for content-side settings menus, so we can show users a "does this look correct" prompt after changing sensitive settings like graphics or UI, without risking an untimely config save *storing* broken CVar config.
2025-10-22 14:09:40 +02:00
PJB3005 b0fec0fd76 CVars defined in [CVarDefs] can now be private or internal. 2025-10-22 14:06:33 +02:00
735ef09d42 Better unsubscription for multiple ConfigurationManager subscriptions (#6115)
* feat: new method or aggregating multiple config changed subscriptions into one disposable object or more slim unsubscribing code

* refactor: moved nested private class declaration to bottom of class

* refactor: reusing stateful object in tests is not smart

* fix: invalid code for forming new array during InvokeList.Remove call

* refactor: extracted new sub-multiple builder into configuration manager extensions

* refactor: remove unused code

* refactor: removed UnSubscribeActionsDelegates

* refactor: whitespaces and renaming

---------

Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
2025-08-02 18:35:38 +02:00
PJB3005 4bd7aa16c1 Config no longer logs a warning when saved in integration test
Supersedes #6108

See https://github.com/space-wizards/space-station-14/issues/39196
2025-08-02 17:54:09 +02:00
974c1e827d Change a bunch of static Loc.GetString calls to be properly resolved (#6010)
* Add Loc shortcut to LocalizedCommands

* Fix static methods in commands

---------

Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-07-22 20:33:43 +02:00
0fc6f2bce6 Config load fail is now an error instead of a warning (#6070)
* Config load fail is now an error instead of a warning

* Update RELEASE-NOTES.md

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2025-07-06 20:28:49 +02:00
SimonandGitHub 0c41a041e3 Move ParseObject method into a public class for content to use (#5674) 2025-02-14 14:21:22 +11:00
PJB3005 347d240fae Add API for creating mock configuration managers in unit tests. 2025-01-05 23:27:59 +01:00
Leon FriedrichandGitHub 2b0ecd7166 Fix cvar type errors (#5212) 2024-06-05 18:18:49 +10:00
Pieter-Jan Briers 3c378640dd Add cvar_subs command
Dumb little thing, just wanted to test something.
2024-05-31 02:00:53 +02:00
ElectroJr 709c7bc808 Fix cvar type cast 2024-05-24 18:57:46 +12:00
Leon FriedrichandGitHub a48a353939 Add IConfigurationManager.OnCvarValueChanged event (#5161)
* Add `IConfigurationManager.OnCvarValueChanged` event

* Prevent CVars from changing type

* Allow double registrations?

* Turn debug asserts into exceptions

* We should really just start using generics if we can

* Re-use CVarChangeInfo

* Explicit old value

* Rename `OnCvarValueChanged` to `OnCVarValueChanged`

* internal constructor
2024-05-24 14:04:56 +10:00
Pieter-Jan Briers 4b193bad26 Add non-generic GetCVar.
Surprised we didn't have this.
2024-04-11 02:25:40 +02:00
Pieter-Jan Briers 84360c653d Add better environment variable config system
ROBUST_CVARS had multiple issues:

* Not composable, i.e. two independent systems can't easily layer CVars to set as they all have to go into one var
* Not sanitary, there's no way to store things that have a ";" in them because it'd always get used as separator.

This adds a new ROBUST_CVAR_* system. For example I can set ROBUST_CVAR_game__hostname=foobar to set a CVar via a single env var. A double underscore ("__") is replaced with a period to make the CVar names safe for environment variables.

Also made Robust.Shared.Configuration.EnvironmentVariables internal because wtf that should not be public no.
2024-04-04 02:24:57 +02:00
Pieter-Jan BriersandGitHub 5c635c09b4 Replay int overflows, fixed again (#4878)
* Reapply "Fix replay int overflow issues." (#4802)

This reverts commit 32049e34f2.

* IConfigurationManager.LoadDefaultsFromTomlStream now does required type conversions.

This fixes scenarios like loading of `long` CVars.
2024-01-31 17:17:28 +01:00
Pieter-Jan Briers 816a535a92 Fix obsoletion warnings for BinaryFormatter stuff
This became an outright warning in .NET 8. Into the trash, never used it.
2023-12-15 19:37:13 +01:00
Jordan DominionandGitHub f24d18f470 Allow for ushort CVars (#4493) 2023-10-17 16:44:18 -07:00
Kevin ZhengandGitHub af4e3e5e1c Remove personally-identifiable file paths from client logs (#4267) 2023-08-24 18:56:48 +02:00
DrSmugleafandGitHub b6879869d6 Add support for long values in CVars (#4299) 2023-08-24 00:57:09 +02:00
e71f1cc8a5 Warning fixes (#4160)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-07-01 22:02:12 +10:00
Leon FriedrichandGitHub 9d4105abc7 Add support for client-side replays (#4122) 2023-06-19 03:23:46 +10:00
Pieter-Jan Briers 23abb6177d Fixes for resource manager, roots and ResPath.
`ResPath.RelativeTo()` now considers non-rooted paths relative to `.`
This fixes some things like `MemoryContentRoot`'s `FindFiles()` implementation.

Fix `IContentRoot.GetEntries()` default implementation (used by all content roots except `DirLoader`) not working at all.

Made `ResourceManager.ContentGetDirectoryEntries()` report content root mount paths as directories.

Added tests for all of the above.
2023-06-03 12:23:28 +02:00
Leon FriedrichandGitHub 4a8be4fc9e Try fix cvar toml type parsing (#3681)
fix https://github.com/space-wizards/RobustToolbox/issues/3680
2023-01-16 19:11:09 +11:00
Leon FriedrichandGitHub f3364a196c Client-, shared-, and server-side ConfigurationManager (#3477) 2022-12-31 04:04:49 +11:00
b5747f7003 Fix bug where config files could be corrupted (#3590)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Co-authored-by: Eoin Mcloughlin <helloworld@eoinrul.es>
2022-12-18 15:49:17 +01:00
Pieter-Jan Briers ec26ef1e42 Check for CVar typos in server startup.
We now check the list of CVars to see if there's any unregistered CVars specified (i.e. in config, but not actually registered by the code). This would probably indicate a typo.

Only doing this on the server for now. The client may share config files from multiple codebases and end up with unknown CVars from there. This is probably fine, since those would be applied more automatically and not prone to config file typos as much.
2022-12-16 23:24:53 +01:00
Pieter-Jan Briers a16731c957 Make config write exception safe.
Also changelog for 0688cd0202
2022-12-14 00:08:09 +01:00
ErrantandGitHub 0688cd0202 Fix Configuration write error (#3576) 2022-12-13 23:51:50 +01:00
Pieter-Jan BriersandGitHub 3f86f5f5dd Rename game.maxplayers to net.max_connections, raise to 256. (#3552) 2022-12-03 11:51:37 +01:00
Pieter-Jan Briers 86ffed9afb LoadDefaultsFromTomlStream to load CVars as CVar default overrides. 2022-12-01 22:40:19 +01:00
Leon FriedrichandGitHub f856ac0efa Misc replay related engine changes (#3508) 2022-11-28 12:11:44 +11:00
Leon FriedrichandGitHub 7e9f3dd5e6 Fix replicated & archived client-settable cvars (#3454) 2022-11-23 11:11:19 +11:00
1646297039 Remove most static IoCManager. accesses from engine. (#3466)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-11-15 22:00:28 +11:00
Ygg01andGitHub 108e270f9e Localize commands (#3374) 2022-11-06 03:00:57 +11:00
Leon FriedrichandGitHub 6a8266af7e Revert "Revert "PVS & client state handling changes"" (#3152) 2022-08-21 08:30:28 +10:00
Leon FriedrichandGitHub 9cd8adae93 Revert "PVS & client state handling changes" (#3151) 2022-08-21 05:27:16 +10:00
Leon FriedrichandGitHub b4358a9e33 PVS & client state handling changes (#3000) 2022-08-21 03:40:18 +10:00
Pieter-Jan Briers 7a6d6c83b1 CVar.CONFIDENTIAL flag.
Hides CVar values from completion results.
2022-08-10 00:40:30 +02:00
metalgearslothandGitHub 6feb8b69ee Bump cfg log level to info (#2996) 2022-07-01 02:04:58 +10:00
Pieter-Jan Briers 26cdae6877 cvar command shows completion hint showing cvar value.
Like in source!
2022-06-11 13:24:15 +02:00
Pieter-Jan Briers c96eae620c Fix GetRegisteredCVars including unregistered CVars. 2022-06-11 13:23:35 +02:00
Pieter-Jan Briers 3c5618364c Move ValueList<T> to Robust.Shared.Collections 2022-05-28 15:34:46 +02:00
Pieter-Jan BriersandGitHub e3b26e80bf Sync CurTime base. (#2858) 2022-05-28 13:03:42 +02:00
Pieter-Jan BriersandGitHub 5057c91dcd Console command completions v1. (#2817)
* Console command completions v1.

I think it works™️

* Unify cvar commands

* Handle no-completions-at-all better.

* Don't crash if you tab complete while no completions available.

* Always show hints if available

* Properly null completion hint over the wire

* Unify help command, localize it.

* Clean up + localize cvar command.

* Remove debug logging

* List command unified & localized.

* Remove server completions debug logging

* Remote execute command.

Had to make everything async for this.

* Don't lower case enums or bools
Why

* GC commands converted and localized.

* Fix remote command completions.

Whoops

* Kick command completions

* lsasm unified & localized.

* Revert "Don't lower case enums or bools"

This reverts commit 2f825347c3.

* ToString gc_mode command enums instead of trying to fix Fluent.

Ah well.

* Unify szr_stats

* Unify log commands, completions

* Fix compile

* Improve completion with complex cases (quotes, escapes)

* Code cleanup, comments.

* Fix tab completion with empty arg ruining everything.

* Fix RegisteredCommand completions

* Add more complex completion options system.

* Refactor content directory entries into a proper resource manager API.

* Implement GetEntries for DirLoader

* Make type hint darker.

* Exec command autocomplete, pulled play global sound code out to engine.
2022-05-17 13:07:25 +10:00
41e9d9b08b Client profiling system (#2783)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-05-14 15:08:46 +10:00
Pieter-Jan Briers 45d906ba7e Deprecate CreateNetMessage<T>. 2022-04-15 18:47:42 +02:00
Pieter-Jan BriersandGitHub c7027c6e00 ACZ manifest delta downloads (#2698) 2022-04-14 17:15:54 +02:00