Cyro
How does one typically handle complex program flow?
Not strictly, I suppose I purpose my classes differently. My remote connection handler already has some internal logic, I just wanted to use a more robust workflow management system than if/else blocks all over, checking if things are disposed, if this step failed so now jump to this step but only if xyz condition is met, etc.
45 replies
How does one typically handle complex program flow?
You think that might be a good method to the madness?
I was kind of second-guessing it and thinking maybe it was dumb and I'd have like a dozen C# experts saying "NOOOO" when they laid eyes upon it - I'm trying to do it a proper way and not hack/slash this time around, so maybe I'm getting a little paranoid about the "proper-ness" of my code - but if that's a valid pattern that people use I might see about exploring it
45 replies
How does one typically handle complex program flow?
My closest approximation thus far is kind of mimicking stateless's program structure such that I can make states, but each state is a function that conditionally returns the next state to transition to.
The problem with that being skipping states if certain conditions are met (e.g. not looping back to "Is Connected?" for example if the connection was already made)
45 replies
How does one typically handle complex program flow?
A few of the states are linear A -> B -> C states, but at some point the program should loop back on itself with conditions that determine the next state.
Canton's way seems like a perfectly valid way to handle this for specifically this type of program, but I guess I'd say I definitely want something I can plug more states into to add more complex flow down the line if need be
45 replies
How does one typically handle complex program flow?
Structuring it such that the server connects first might reduce the awkwardness of needing to traverse the "Is connected?" stage again if the user simply just wants to run another script.
When the lack of recovery is mentioned, does that mean the connection failure simply terminating the program without a "Retry?" case?
45 replies
Searching for the best way to dynamically load and unload assemblies in .NET Framework
Currently I see two paths:
- Load an already-compiled assembly into memory - this is easy in .NET 8 but not easy in .NET 4.7.2. Namely because AppDomains require tooling to communicate, and also forcefully abort code running inside of them which is very unhealthy
- Compile a C# script at runtime with roslyn. Ideally I'd like to be able to just code a normal C# project and load it at runtime, but roslyn is only really usable to me if I can write in C# 12 on .NET Framework 4.7.2
27 replies
Searching for the best way to dynamically load and unload assemblies in .NET Framework
Would this not require that any code I write be tooled specifically to interact with this RPC? I'm looking for something I wouldn't need to hard code for. For instance, you can get the currently running world of the game by doing
Engine.Current.WorldManager.FocusedWorld
. I'd like to be able to do this transparently without needing to explicitly pipe Engine, or the world manager, or the world into the module. I'd have to do that for every little thing I'd wanna access if I'm not mistaken. I'd like to be able to just have a Run()
function that gets poked and have the code be written normally27 replies
Searching for the best way to dynamically load and unload assemblies in .NET Framework
I realize I could use roslyn/csharpanalysis to dynamically compile code on the host from plaintext sent over the network, but the fact that I have to juggle a couple .NET versions means that - to my understanding - the available language versions (i.e. C# 12) aren't available for .NET 4.7.2 like they would be in a normal IDE
27 replies
Searching for the best way to dynamically load and unload assemblies in .NET Framework
The overall goal is to compile an assembly, send it through something like a TCP socket (with authentication because I don't want to create an RCE :p) and run code on a host environment. In essence, a live scripting environment
27 replies