Commit Graph
231 Commits
Author SHA1 Message Date
DrSmugleafandGitHub a589f1473b Add partial prototypes, for defining and modifying prototype data with the same ID in different files (#6923) 2026-08-20 15:39:25 -07:00
pathetic meowmeowandGitHub bbfd27d78f XamlX upgrade (#6288) 2026-07-24 19:00:35 +10:00
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
740c562ca3 Import tensors and add methods to sbox (#6450)
* Import tensors and add methods to sbox

* might be a good idea to expose pseudo-ctors
also nuke spans as tey're too much to review rn

* nuke buffers

* nuke unconsumable types

* hilarious

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2026-05-08 11:57:19 +02:00
ff4edd0423 Allow static abstract through the sandbox + INumber (#6432)
* Allow `static abstract`.

* Allow BigInteger + INumber family of interfaces and classes.

* Spurious test fail.

* Further sandbox additions..

* Release notes.

* Fix typo

---------

Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2026-05-05 19:02:15 +02:00
MoonyandGitHub 8279e2ce26 Allow content to serialize YAML, add missing StringReader/StringWriter. (#6480) 2026-03-24 20:38:43 -04:00
PJB3005 ec0c667c33 Add System.StringComparer to sandbox
Fixes #6081
2026-02-05 21:32:59 +01:00
PJB3005 75d0c29973 Add OrderedDictionary to sandbox whitelist
Fixes #6411
2026-02-05 16:38:01 +01:00
PJB3005 2722448474 Don't compile new sandbox code outside TOOLS
Fix build
2026-01-31 09:11:24 +01:00
PJB3005 8449015cf8 Locate references to bad compiler generated methods in sandbox
Should help pinpoint issues from params arrays and similar.
2026-01-30 10:19:57 +01:00
PJB3005 dd41a7ce44 Use hard links for macOS app bundles
Avoid needing to get executable path from MainModule, which broke the game when run with the dotnet command instead of the bin's apphost. Fixes tests.
2025-12-31 18:46:46 +01:00
PJB3005 d43c3f2caf Merge remote-tracking branch 'origin/master' into 25-11-01-cef-update 2025-12-27 01:50:23 +01:00
PJB3005 bb81d88653 Add [NotContentImplementable] to shared interfaces 2025-12-20 16:49:35 +01:00
PJB3005 20d97ff855 Add ExtensionMarkerAttribute to sandbox
Necessary for C# 14 extension members
2025-12-04 19:08:20 +01:00
PJB3005 602d7833a1 Initial macOS WebView support
This is a gigantic kerfuffle because Chromium expects a very specific directory & app bundle layout. Have to change a bunch of resource loading code to account for content development being launched from an app bundle, and also had to make automatic MSBuild tooling & a python script to generate such an app bundle
2025-11-09 00:06:16 +01:00
e49515956a Add a basic loading screen! (#6003)
* Added basic loading screen

* Make it look better!

* I forgor xD

* Fix test fails

* Add comment

* Removed unused import

* Only write to file if the number of sections changed

* Servers can now have their own settings

* Minor optionzation and rare colors

* Remove some of the cvars

* debug only loading messages

* Added a few more steps

* Only one section at a time

* nullable section name

* Lock out functions if finished

* Get rid of saving the ccvar

* Cleanup

* Forgot!

* A few tweaks

* Disable vsync

* remove colors

* remove outdated vsync functions

* Silly me xD

* What I get for trying to be clever... ;(

* Better seconds display

* Simplify drawing logic + it looks better

* Type does not need to be partial

* Make interface to expose to content

* Use correct define to gate showing debug info

Should be TOOLS instead of DEBUG

* Use appropriate exception type in BeginLoadingSection

* Fix exception when closing window during loading screen

Would try to stop the main loop before it exists.

* Rename CVars, put debug info behind CVar instead of conditional compilation.

* Add to RELEASE-NOTES.md

* Add UI scaling support

* Make ILoadingScreenManager fully internal

Didn't realize content can't touch it as it'd break the total amount of sections

* Don't re-enable vsync manually, GameController does it at the end of init

* Add command to show top load time usage.

* Improve verbosity of debug time tracking

More steps and some steps named better

---------

Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-10-30 00:38:59 +01:00
PJB3005 e788325cdb Expose more StringBuilder overloads to sandbox
Just some stuff that got added in the years. Spans, interpolated string handlers.
2025-10-26 23:09:59 +01:00
PJB3005 9a0e3b6b02 dmetamem now sorts results, no longer outputs to log to avoid interleaving 2025-10-26 23:09:37 +01:00
PJB3005 37eabbabc2 Add MetadataUpdateHandlerAttribute to sandbox 2025-10-26 22:53:06 +01:00
AmyandGitHub d3a9199b8e my hatred for yaml is building (#6226) 2025-10-15 23:28:47 +02:00
Nikita (Nick)andGitHub a8a73e28f4 Fix casing in Sandbox.yml (2 characters changed) (#6243)
* Fix casing in DateOnly property in Sandbox.yml

* another typo
2025-10-04 17:08:59 +02:00
PJB3005 e5983a9ec1 Add DateOnly and TimeOnly to sandbox
Added in .NET 6
2025-10-02 19:02:28 +02:00
Leon FriedrichandGitHub 3c30ed749c Fix yaml hotreloading (#6239)
* Fix yaml hotreloading

* ToRelativeSystemPath removes the leading /
2025-09-28 19:00:56 +02:00
PJB3005 d22280f177 Validate that content assemblies have a limited list of names.
Also, only read assemblies once from disk

(cherry picked from commit 443a8dfca65be7d60c4bd46181b4c749b4756114)
2025-09-26 13:40:38 +02:00
PJB3005 c8db7f98db Move IResourceManager.GetContentRoots() to be internal, make it return strings instead
Previous API shouldn't have been content-accessible. It also returned OS paths over ResPath which is incorrect.
2025-09-23 15:07:58 +02:00
SkyeandGitHub 51bbc5dc45 Fix resource loading on non-Windows platforms (#6201) 2025-09-16 11:10:30 +02:00
PJB3005 d4f265c314 Fix incorrect path combine in DirLoader and WritableDirProvider
This (and the other couple past commits) reported by Elelzedel.
2025-09-14 14:49:14 +02:00
PJB3005 16fc48cef2 Hide IWritableDirProvider.RootDir on client
This shouldn't be exposed.
2025-09-14 14:49:13 +02:00
PJB3005 745d0e5532 Add WeakReference<T> to sandbox 2025-09-07 00:17:07 +02:00
Kyoth25fandGitHub 67ccaec418 Add UnicodeCategory to sandbox (#6181) 2025-09-04 11:30:53 +02:00
AmyandGitHub 83109b08e9 Add hashing lib to sandbox (#6167)
* box  your sand

* I only need this one anyway
2025-08-25 22:12:07 +02:00
DrSmugleafandGitHub e195ac4ce6 Add ImmutableArrayExtensions All to sandbox.yml (#6110) 2025-07-28 16:05:05 +02:00
DrSmugleafandGitHub 36f9df3079 Add System.Text.StringBuilder Insert(int, string) to sandbox.yml (#5955) 2025-05-21 11:20:10 +02:00
PJB3005 c43b7b16c0 Add CancellationTokenRegistration to sandbox 2025-05-05 00:45:05 +02:00
IProduceWidgetsandGitHub 93bb7b1532 Sandbox whitelist for calendar stuff. (#5888) 2025-04-24 12:46:41 +02:00
B_KirillandGitHub adf0b6ae78 Fix CA2264 in Resource Manager (#5870) 2025-04-20 05:02:16 +02:00
metalgearslothandGitHub 41ea10083d Fix ResPath CanonPath (#5452)
* Fix ResPath CanonPath

Apparently this is supposed to standardise to / but this isn't always the case. Alternatively we could just assert for performance reasons I'm good with either. The comment as written says this should happen.

* assert

* Fix bad respath input

* review
2025-03-08 15:02:46 +11:00
SlamBamActionmanandGitHub a1a7ea92d9 Add Regex.Count and StringBuilder.set_Chars to sandbox whitelist (#5717) 2025-03-01 22:42:19 +01:00
Tobias BergerandGitHub 2e0d18aeaf Fix wrong parameters for Regex.Escape in Sandbox whitelist (#5688) 2025-02-22 18:08:28 +01:00
PJB3005 c463fc5e78 Make source generators emit EditorBrowsable(Never)
This hides the generated types from intellisense if you have the relevant option in Rider enabled.

Good because honestly these just bloat IntelliSense, and if you want to show them there's an IDE setting for it.
2025-01-18 01:23:35 +01:00
Pieter-Jan BriersandGitHub dfc4894c8b Dependencies update & cleanup (#5590)
* Dependencies update & cleanup

Fixes security vuln warnings etc

* Remove ILReader dependency

RIP in piss FastAccessors.
2025-01-08 02:19:27 +01:00
PJB3005 6c8b863731 Add string split with ROS<char> to sandbox 2025-01-06 03:08:28 +01:00
Pieter-Jan BriersandGitHub 87a5745519 SDL3 (#5583)
* Start converting SDL2 backend to SDL3.

Game starts, but a lot of stuff is broken. Oh well.

* Fix text input

SDL3 changed the API somewhat, for the better. Changes all over UI/Clyde/SDL3 layer.

* Fix mouse buttons being broken

* Remove records from SDL3 WSI

The fact that this shaved 2-3% off Robust.Client.dll is mindboggling. Records are so bad.

* Set Windows/X11 native window properties

* Fix window resize events getting wrong size

oops

* Remove "using static" from SDL3 WSI

Seriously seems to hurt IDE performance, oh well.

* Apparently I never called CheckThreadApartment().

* Add STAThreadAttribute to sandbox

Necessary for content start

* Set window title on creation properly.

* Load window icons

* Fix GLFW NoTitleBar style handling

Yeah this PR is supposed to be about SDL3, so what?

* Implement more window creation settings in SDL3

Mostly the ones that need a lot of platform-specific stuff to work.

* Make fullscreen work properly in SDL3.

* File dialogs with SDL3

Removes need for swnfd.

* Fix some TODOs

* Fix WebView build
2025-01-03 18:42:57 +01:00
Pieter-Jan Briers 3086fc446c Sandbox error reference locator now works with generic method calls
This means resolving the MethodSpec table entry for it.
2024-11-22 18:06:33 +01:00
slarticodefastandGitHub fa9030e59c correct sandbox whitelist for Regex.Matches Method (#5513) 2024-11-12 21:48:39 +01:00
AmyandGitHub 350fa8736d add ref readonly to sandbox (#5506) 2024-10-30 02:49:25 +01:00
Pieter-Jan Briers 9505cb68df Add SwitchExpressionException to sandbox
Fixes #5450
2024-10-07 19:05:17 +02:00
Leon FriedrichandGitHub 3b243e487d Add required keyword attributes to sandbox whitelist (#5474)
* Add `required` keyword attributes to sandbox

* Release notes
2024-09-30 16:00:24 +02:00
6396ec472d XAML hot reloading (#5350)
* Move RobustXaml to a shared package

In a near-future change, I'll make it possible to optionally link to
this from Robust.Client, which will allow JIT compiling XAML.

Also upgrade it to a version of .NET that supports nullability
annotations.

* Re-namespace packages

* Add a JIT compiler, plus hooks that call into it

In Debug, after this change, all XAML will be hot reloaded once every
time an assembly is reloaded.

The new code is compiled with SRE and is _not_ sandboxed -- this is not
suitable to run against prod.

In Release, the hot reload path is totally skipped, using the same trick
as SmugLeaf used in an earlier attempt to implement this functionality.

* Hot reload: watcher

This is a bit of a horror, but there's not in-engine support for
identifying the source tree or the XAML files in it.

* Put everything dangerous behind conditional comp

* Code cleanup, docs

* Fix a bad comment

* Deal a little better with crashes in the watcher

* Make reload failures Info, since they're expected

They were previously causing the integration tests to flag, even though
"a few types fail hot reloading because they're internal" is expected
behavior.

* Fix an unnecessary null check

I removed the ability for CompileCore to return null.

* injectors: null! strings, default primitives

* Tidy documentation (thanks, PJB!)

* Reinstate netstandard2.0, abolish Pidgin

* Internal-ize all of Robust.Xaml

* Add a cautionary note to Sandbox.yml

* Shuffle around where conditional compilation occurs

* Privatize fields in XamlImplementationStorage

* Internalize XamlJitDelegate

* Inline some remarks. No cond. comp in Robust.Xaml

* Use file-scoped namespaces

They aren't allowed at Language Level 8.0. (which I arbitrarily picked
for Robust.Xaml because it's the oldest one that would work)

* Bump language level for R.Xaml, file namespaces

* Force hot reloading off for integration tests

* Fix bizarre comment/behavior in XamlImplementationStorage

* Consistently use interfaces, even in generated code

* Update Robust.Client/ClientIoC.cs

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
2024-08-27 02:16:57 +02:00
StalenandGitHub d7aa5daf6a Add decimal type to sandbox whitelist (#5396) 2024-08-27 01:35:42 +02:00