Commit Graph
65 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 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
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
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
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 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
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 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
Pieter-Jan Briers 7a6d6c83b1 CVar.CONFIDENTIAL flag.
Hides CVar values from completion results.
2022-08-10 00:40:30 +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
41e9d9b08b Client profiling system (#2783)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-05-14 15:08:46 +10:00
Pieter-Jan BriersandGitHub c7027c6e00 ACZ manifest delta downloads (#2698) 2022-04-14 17:15:54 +02:00
de4d255841 Analyzer to enforce classes to be either [Virtual], abstract, or sealed. (#2469)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-02-05 19:31:58 +01:00
1afeac4b95 fix(server): specify default culture for float.Parse (#2307)
Co-authored-by: Acruid <shatter66@gmail.com>
2021-12-13 11:27:16 +01:00
ShadowCommanderandGitHub 45d4a67ff4 Fix replicated cvars not copying overrides from cmd line (#2329) 2021-12-12 16:17:19 -08:00
Vera Aguilera PuertoandGitHub 52d669e032 Fixes exceptions on shutdown. (#2219) 2021-11-11 17:39:25 +01:00
04d029b9a2 Add test pooling (#2146)
* Add test pooling and global test setup

* WIP test pooling changes

* Make asynchronous tests the default again

* Finish fixing tests, make test threads background threads

* Un-pool tests with custom cvars

* Fix not changing FailureLogLevel cvar on instance return

* Fix error when overriding already overriden cvar

* Don't pool some physics integration tests

* Unpool engine tests, the technology just isn't there yet

* Remove explicit Pool = false from physics tests

* Change default pooling setting to false

* Didn't need this anyway

* Remove ConfigurationManager.ResetOverrides

* Bring back enum cvar override parsing

* Make integrationInstances name clearer > notPooledInstaces
Make clients ready and servers ready internal

* Add logging test instances

* Give more info on ran tests

* Show total clients and servers in test output

* Wipe LayerMap on SpriteComponent.AfterDeserialize

* Fix server not properly kicking clients

* Rider shut

* Make all test metrics report totals

* Format tests ran better

* Replace Console.WriteLine with TestContext.Out.WriteLine

* Fix two server test pooling info prints using total clients instead of total servers

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2021-11-06 11:18:18 +01:00
Pieter-Jan Briers 47af668cda Fix overriding unregistered-but-known config vars.
The default value would be set to 0 as a placeholder from when the config var is first tracked as unregistered, which means that when we try to override it tries to parse it as an int always.
2021-07-29 20:29:08 +02:00
Pieter-Jan Briers 719ea26a31 IConfigurationManager.UnsubValueChanged. 2021-07-20 17:26:52 +02:00
Vera Aguilera Puerto 0dac17ae5e ConfigurationManager.OnValueChanged's invokeImmediately now accounts for overriden values correctly. 2021-03-17 20:22:44 +01:00
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00
Pieter-Jan Briers 69daaca399 Remove CVar.SECURE and replace auth CVars with env variables. 2021-02-09 01:50:42 +01:00
AcruidandGitHub cd3a85ea04 Replicated CVars (#1489) 2021-01-13 10:02:08 +01:00
Pieter-Jan Briers 849be86455 Add launchauth command to bootstrap login tokens for connecting to live servers. 2021-01-10 23:55:01 +01:00
Pieter-Jan Briers 797fa9cffa Fix server failing to start due to non-int LogLevel enum. 2020-12-10 15:22:29 +01:00
Pieter-Jan Briers 4c72103a97 Do not load SECURE cvars from config file.
To avoid funny business by content.
2020-12-04 11:27:41 +01:00
Pieter-Jan Briers 6d78d05520 Do not write unmodified cvars to config file. 2020-12-04 11:23:15 +01:00
Pieter-Jan Briers 953120aa76 Move various config manager APIs to internal. 2020-12-04 11:15:09 +01:00
Pieter-Jan Briers c28761d5c0 Fix setting cvars with overrides. 2020-11-26 01:11:36 +01:00
b8e5b47e7a Use 'new' expression in places where the type is evident for the engine (#1415)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-11-26 00:16:55 +01:00