Hello!
I'm a software developer and having the build-run-buildscripts process is just an annoyance. I'd rather build the scripts as part of the (existing) Makefile. I see two options:
- A command line option to compile the scripts before the server is started (I don't think this is supported)
- Move the scripts directly to the "server" code and compile them directly in the executable.

I don't care about being able to edit the scripts once the server is started, I'll have a deployment pipeline for that purpose. What I do care though is getting compile-time errors for the scripts when I compile, instead of when I run the server.

I'd like to also add some automated testing for some core part of my scripts, as such having those in the traditional build pipeline of a C# software makes things easier.

Did anyone achieve this already and have some well-known gotchas to mention before I attempt this feat completely clueless? :eek::p
 
If you haven't changed anything in the scripts, they don't get compiled again. If you have a live server and a development server, they'll get compiled once on the live one when you deploy changes and you know they're ok because you tested it on the other box first. Compiling might add 15-20 seconds max to the startup time on any relatively decent box.

If you really want to recompile the exe every time you change a script, you can do it that way too, as you described. Move the scripts into the server core and compile. All the scripts will be present and the exe will start without compiling anything else at runtime.

Some people do their work in Visual Studio to test their changes in real time. I'm not that advanced; I use an ancient plain text editor (Programmer's File Editor) and test my changes by starting the server!
 
If you haven't changed anything in the scripts, they don't get compiled again. If you have a live server and a development server, they'll get compiled once on the live one when you deploy changes and you know they're ok because you tested it on the other box first. Compiling might add 15-20 seconds max to the startup time on any relatively decent box.

If you really want to recompile the exe every time you change a script, you can do it that way too, as you described. Move the scripts into the server core and compile. All the scripts will be present and the exe will start without compiling anything else at runtime.

Some people do their work in Visual Studio to test their changes in real time. I'm not that advanced; I use an ancient plain text editor (Programmer's File Editor) and test my changes by starting the server!

Thanks for the input.
I don't have a problem with re-compiling (it doesn't recompile the project from scratch either. It just restarts), I'd rather do most of the coding before performing an actual interactive test (going in-game and try if the thing works), by checking if the flow works with some automated testing first.

If all it's necessary is just to move the Scripts inside the Server directory, well that's great!

I'm kind of hyped being back into ultima online server development after so many years... :oops:
 
Last edited:
if you just want to see if you have any errors? Why not use an IDE? Then you can see it befor you compile at all
 
if you just want to see if you have any errors? Why not use an IDE? Then you can see it befor you compile at all

I think I have been misunderstood, there are multiple things I want to do, but the main one is actually running automated tests, which on top of my mind I can't think of how to run them without compiling the scripts first
 
Well you can also compile it via visual studio and have the exe + the scripts dll compiled that way? It would be in Scripts/obj or Scripts/Output depending
 
Well you can also compile it via visual studio and have the exe + the scripts dll compiled that way? It would be in Scripts/obj or Scripts/Output depending

That works great from my point of view.
Do I have to do anything special to compile the scripts as a DLL? The existing Makefile doesn't seem to do it (I'm using VS Code, not visual studio, so things might differ)
 
hmm the makefile itself does not compile the scripts folder no, not sure if you can reference the exe file since you need the server files as a dependency for the script folder. The sln file is actually set up that way (besides or some reason wanting to use the scripts project as main project to run the whole thing). Never really used vs code since it felt .. lacking? But I updated it recently and it feels better now..

That being said, not sure if you can go with it this way (without vs code / studio) unless you rewrite it.Also rider has trial version right? .. :p
 
hmm the makefile itself does not compile the scripts folder no, not sure if you can reference the exe file since you need the server files as a dependency for the script folder. The sln file is actually set up that way (besides or some reason wanting to use the scripts project as main project to run the whole thing). Never really used vs code since it felt .. lacking? But I updated it recently and it feels better now..

That being said, not sure if you can go with it this way (without vs code / studio) unless you rewrite it.Also rider has trial version right? .. :p

I develop on Ubuntu, that's why I'm not using Visual Studio. I can test with Monodevelop, but I'd rather have a functioning Makefile so that I don't need the full IDE just to compile the project.

But thanks, you gave me what I was looking for, the Makefile and the sln/csproj file are maintained differently, so I need to alter it for sure.
I'm not too concerned of that, I will start altering the Makefile and see where I can go with that. If it gets too tedious, I'll check the project in Visual Studio.

I wouldn't be surprised either if I find some utilities that help defining a Makefile or something similar out of the project files.
 
Back