RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

RunUO 2.1 -ForceCache command line option, as requested by _Epila_

Lokai

Knight
This thread is a direct response to _Epila_ who requested a core modification that would provide a command line option to force use of the compiled cache, if it exists. I believe this accomplishes this task. The changes are noted in each script. You must know how to compile scripts to use this.

If you are NOT using RunUO 2.1, you can probably add these changes to your scripts by copying the sections noted into your scripts. Should work with most versions, but do not overwrite your original files unless you are using RunUO 2.1.
 

Attachments

  • ForceCache modifications.zip
    8.6 KB · Views: 29
i am running 2.1 when i attempt to compile i get

C:\Users\DP\Desktop\R118\Server>SET PATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0
.50727

C:\Users\DP\Desktop\R118\Server>csc.exe /out:.\RunUO.exe /recurse:*.cs /win32ico
n:runuo.ico /optimize /unsafe /reference:Ultima.dll
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.4927
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

ScriptCompiler.cs(166,26): error CS0177: The out parameter 'assembly' must be
assigned to before control leaves the current method
ScriptCompiler.cs(313,26): error CS0177: The out parameter 'assembly' must be
assigned to before control leaves the current method

C:\Users\DP\Desktop\R118\Server>PAUSE
Press any key to continue . . .
 

Attachments

  • Main.cs
    19.2 KB · Views: 0
  • ScriptCompiler.cs
    20.2 KB · Views: 0

Lokai

Knight
Just noticed this. If anyone else has tried this without luck, try this change:

In ScriptCompiler.cs:


Change this:

//START FORCE CACHE MODIFICATIONS #1
if (Core.ForceCache) return true;
//END FORCE CACHE MODIFICATIONS #1


To this:

//START FORCE CACHE MODIFICATIONS #1
if (Core.ForceCache)
{
assembly = Assembly.LoadFrom( "Scripts/Output/Scripts.CS.dll" );
return true;
}
//END FORCE CACHE MODIFICATIONS #1


i am running 2.1 when i attempt to compile i get

C:\Users\DP\Desktop\R118\Server>SET PATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0
.50727

C:\Users\DP\Desktop\R118\Server>csc.exe /out:.\RunUO.exe /recurse:*.cs /win32ico
n:runuo.ico /optimize /unsafe /reference:Ultima.dll
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.4927
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

ScriptCompiler.cs(166,26): error CS0177: The out parameter 'assembly' must be
assigned to before control leaves the current method
ScriptCompiler.cs(313,26): error CS0177: The out parameter 'assembly' must be
assigned to before control leaves the current method

C:\Users\DP\Desktop\R118\Server>PAUSE
Press any key to continue . . .
 
Top