alchemy

Member
ServUO Version
Publish 57
Ultima Expansion
Mondain's Legacy
Dear all,

I have a strange behavior, using the latest ServUO release.
When I change something in ./Scripts, let's say for example MapDefinition.cs, I have to recompile all using _winrelease.bat instead of just running ServUO.exe and get the recompiliation of my scripts changes.

ServUO.exe does not capture my mofifications in ./Scripts

Do you have a suggestions to overcome this?

Alchemy
 
You have Pub 57 listed? Is that accurate or are you using Pub 58? Because with pub 58, you do require a recompile unlike 57 where it is done on start up!
 
Hello voxpire,

I already tried to switch to "False" or "True" or "false" or "true" the only parameter called "Dynamic" of the compiler config, which do the same behavior: touching a file does not trigger the re-compilation of the file. I've tried on another WIndows machine with other dotnet, same result unfortunately.


Compiler.cfg:
# Forces scripts to be compiled at runtime.
# This is a legacy feature that was originally provided by the core.
Dynamic=True

My case seems weird...

Even adding this in the Scripts.csproj didn't make the compiler detected the touched file:
C#:
    <ItemGroup> <Compile Include="**/*.cs" /> </ItemGroup>
 
Last edited:
Both versions have a Compiler.cfg
Maybe I am confused, I know they have to be compiled to start, but with 57, we can edit a script and it is applied on next restart, no need to recompile, where as 58, we need to recompile to implement the script edits! Did you change 57 to work like 58?
 
Hello Wilson,

Indeed, I have the pubs57 (even my directory name is ServUO-pub57)

To make sure the few scripts changes I've done doesn't interact with the identified incident, I've redo from scratch with a clean download, compiled all and start server.

Then I touched the Scripts/MapDefinitions.cs by adding a console text message "xxx".

Launching again ServUO the changed cs didn't get compiled.

Recompiling all by using _winrelease.bat, the change happens and the console text message "xxx" came.

C#:
    public class MapDefinitions
    {
        public static void Configure()
        {
            System.Console.WriteLine("XXX");

I'm very surprise I am the only one reprting this on Windows (tested on a W10 and W11, 2 different hw) since the Pub57 has been released. Maybe a dotnet consideration I missed? Or no one uses Pub57 on Windows since?


INI:
C:\>dotnet --list-sdks
9.0.305 [C:\Program Files\dotnet\sdk]

C:\>dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 

Attachments

  • capture.png
    capture.png
    56 KB · Views: 8
Last edited:
You can try deleting Scripts.dll from the root folder, sometimes DotNET has cache issues when attempting to rebuild projects that have changed.

I would also recommend moving the root folder off the desktop to a more suitable path like C:/Shard/ - to avoid any file access and security issues.

For Compiler.cfg the option must be enabled.
 
Thank you Voxpire for your recommendation, I moved the server out of user profile.
Deleting the Scripts.dll break ServUO.exe that goes in error, as the file is not found and it does not want to rebuild it. Actually, the Scripts.dll was built though the _winrelease.bat and not ServUO.exe.

**BUT** this helped me to figure out more investigation:

In fact, the new "Scripts.dll" has been rebuilt with the change, but it is placed in Scripts/bin/Release,
while ServUO.exe take the "Scripts.dll" copy generated by _winrelease.bat that is at the same directory level than ServUO.exe.
This copy is done during the _winrelease.bat process, I do not know why.

If I overwrite Scripts.dll in the ServUO.exe directory with the Scripts/bin/Release/Scripts.dll the change is ok.

Now I have to figure out how to change ServeUO.exe to get the right scripts.dll after compiling, and not that copy. Maybe a .sln problem?

(Hope I'm clear... am I? :) )
 
Last edited:
The temporary workaround I setup that is working is to modify this:
ScriptCompiler.cs (line 63):
                _ = assemblies.Add(Assembly.LoadFrom("Scripts.dll"));
By this:
ScriptCompiler.cs (line 63):
                _ = assemblies.Add(Assembly.LoadFrom("./Scripts/bin/Release/Scripts.dll"));
Then reluild ServUO and everythin,g runs fine for me in release mode on Windows at least.


Maybe the outpath property condition is not met when in ServUO.exe ScriptCompiler.cs?
C#:
    <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
        <OutputPath>..\</OutputPath>
        <DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
        <DebugType>none</DebugType>
    </PropertyGroup>
 

Active Shards

  • Unchained
    Custom (Classic)
    • Players
    • 153 Online
    • 273 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 87 Online
    • 190 Peak
  • UO Eventine
    Custom (Classic)
    • Players
    • 82 Online
    • 137 Peak
  • Insane UO
    Endless Journey
    • Players
    • 72 Online
    • 105 Peak
  • UO: New Renaissance
    Custom (Classic)
    • Players
    • 28 Online
    • 85 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 27 Online
    • 30 Peak
  • Pandora
    Custom (Modern)
    • Players
    • 19 Online
    • 32 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 19 Online
    • 172 Peak
  • Arth
    Custom (Modern)
    • Players
    • 19 Online
    • 34 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 17 Online
    • 48 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back