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!

Lokai Versioning (Workbench Mod)

Lokai

Knight
Lokai Versioning (Workbench Mod)

LOKAI Versioning.

NEW!

Just added to this post 2 new downloads, one for 1.0, and another for 2.0 RC2 (or SVN 286.)

Both use the new system discussed later in this thread. When you start your Server with one or more of the switches, it will look for files with *.cs extensions located in folders called Scripts.LV1, Scripts.LV2, etc. It will only compile the ones you have selected with switches enabled. I recommend you use the attached Lokai RunUO Menu.bat batch file, which will make running the Server easier, since it will turn on the switches for you.

One Note: "debug" and other modes used in the batch file were NOT tested with the 1.0 version, so use caution on those other switches.

CHANGE LOG:

4/7/2008
Added RunUO 1.0 Lokai Versioning system. Tested.
Added Lokai Versioning for RunUO 2.0 RC2. Tested.

8/15/2007
Lokai RunUO Menu. Batch file to process various switches.

11/17/2009
Added Lokai Versioning SVN 346.zip to the downloads.

This concept is really an expansion of the idea put forth by Ashlar, in:

http://www.runuo.com/forums/other/72338-2-0-workbench-scripts-wb-dll-faster-compile-times.html

The idea is to compile the scripts in separate entities so that compile time is less. This is particularly useful for people that make hundreds of small changes to scripts, and compile the Server each time to make sure it works.

This idea expands on that, and introduces a new concept, which for lack of a better term, I call "Lokai Versioning" for simplicity. With this modification, you can choose at Run-time which scripts to include or exclude based on which extensions they have.

LV1 scripts have .lv1 extensions, etc.

When run, here are examples of what you might see, depending on what parameters you pass to the Compiler:

Server.exe -LV1 -LV2 -LV3 -LV4 -LV5 said:
RunUO - [www.runuo.com] Version 2.0, Build 2745.21656
Core: Running on .NET Framework Version 2.0.50727
Core: Running with arguments: -lv1 -lv2 -lv3 -lv4 -lv5
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...done (cached)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Compiling Lokai Version-1 C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling Lokai Version-2 C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling Lokai Version-3 C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling Lokai Version-4 C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling Lokai Version-5 C# scripts...done (0 errors, 0 warnings)
Scripts: Verifying...done (2705 items, 743 mobiles)
Regions: Loading...done
World: Loading...done (0 items, 0 mobiles) (0.05 seconds)

Server.exe -LV2 -LV4 -LV5 said:
RunUO - [www.runuo.com] Version 2.0, Build 2745.22469
Core: Running on .NET Framework Version 2.0.50727
Core: Running with arguments: -lv2 -lv4 -lv5
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...done (cached)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Compiling Lokai Version-2 C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling Lokai Version-4 C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling Lokai Version-5 C# scripts...done (0 errors, 0 warnings)
Scripts: Verifying...done (2678 items, 742 mobiles)
Regions: Loading...done
World: Loading...done (0 items, 0 mobiles) (0.01 seconds)
 

Attachments

  • Server.zip
    10.1 KB · Views: 67
  • Lokai Runuo Menu.zip
    1.2 KB · Views: 65
  • RunUO-1.0 Lokai Versioning.zip
    8.1 KB · Views: 22
  • Lokai Versioning RC2.zip
    10.4 KB · Views: 47
  • Lokai Versioning SVN 346.zip
    10.6 KB · Views: 38

Lokai

Knight
Oh, sorry, just a note, this is designed for SVN 187, you will need to make some mods to make it work with SVN's lower than probably around 181.
 

Setharnas

Sorceror
Lokai, this is a really interesting thing and I actually wonder why it has found so little attention so far. What I'd be interested in, though, is if it could be modified in a way that does not use different file extensions, but different paths instead? Like:

RunUO Server\Scripts
RunUO Server\Scripts.LV1
RunUO Server\Scripts.LV2

It should be somewhat less bothersome than constantly having to rename the file extensions (even though I agree that this bother is quite insignificant compared to the possible advantages of the system itself).
 

Lokai

Knight
Setharnas;696704 said:
Lokai, this is a really interesting thing and I actually wonder why it has found so little attention so far. What I'd be interested in, though, is if it could be modified in a way that does not use different file extensions, but different paths instead? Like:

RunUO Server\Scripts
RunUO Server\Scripts.LV1
RunUO Server\Scripts.LV2

It should be somewhat less bothersome than constantly having to rename the file extensions (even though I agree that this bother is quite insignificant compared to the possible advantages of the system itself).

I did consider this possibility. If you have ideas on how to implement it, I would like to hear them. In the meantime, I will see what I can come up with.
 

Setharnas

Sorceror
Lokai;696888 said:
I did consider this possibility. If you have ideas on how to implement it, I would like to hear them. In the meantime, I will see what I can come up with.

How about this? (untested, will do so in a moment, but you can take a look at it right away)

*Edit*
Works, it loads a bunch of scripts I put into MyServer\Scripts.LV1 and I can use commands defined in them. :)


To clarify what I did: I merged your main.cs and scriptcompiler.cs with mine, then added an additional overload to the GetScripts method in scriptcompiler. This is needed because the standard one is set to only load from \Scripts. Finally, I modified your Lokai Version 1 - 5 regions so they would use *.cs again, and additionally call GetScripts with the parameter "Scripts.LV1" to "Scripts.LV5".

Now I expect anyone who can think of a reason why this should not be done to please tell me so. :D
 

Attachments

  • ScriptCompiler.cs
    44.9 KB · Views: 22
sounds like a winer to me

let us know if you have any problems at all with it
the more we can spread out some of this stuff the better ;)
 

Setharnas

Sorceror
Yes, m'lord, I really hope this will help you with your own server. Just be aware that the same limits still apply as with the original idea: you can't have anything in the main script assembly that depends on something loaded in a later one. So, any script package that is completely self-contained (except for inheriting from objects from the main assembly) can be put completely into a Scripts.LV1-5 folder.

Practical example: I have Nerun's distro installed (who hasn't :eek:). This includes a GMHidingStone, the one from CEO IIRC. I had gotten a newer version of that, and this was among the scripts I put into the LV1 folder for a test. Of course, when RunUO tried to compile the main assembly, it error'd out - because it depended on an object that would only be included in a later assembly. As long as you're sure that doesn't happen, you're golden.

Oh, and so far it's limited to five custom folders, but that should be sufficient for most servers, I guess.
 

Lokai

Knight
Setharnas;696916 said:
...
Oh, and so far it's limited to five custom folders, but that should be sufficient for most servers, I guess.

This is what I was thinking also. Five should be plenty, except for those that REALLY want the ultimate VERSIONING system, where they can keep track of EVERY change they make, and revert to one at any point in time. (ugh :p)
 

Lokai

Knight
Setharnas;696909 said:
How about this? (untested, will do so in a moment, but you can take a look at it right away)

*Edit*
Works, it loads a bunch of scripts I put into MyServer\Scripts.LV1 and I can use commands defined in them. :)


To clarify what I did: I merged your main.cs and scriptcompiler.cs with mine, then added an additional overload to the GetScripts method in scriptcompiler. This is needed because the standard one is set to only load from \Scripts. Finally, I modified your Lokai Version 1 - 5 regions so they would use *.cs again, and additionally call GetScripts with the parameter "Scripts.LV1" to "Scripts.LV5".

Now I expect anyone who can think of a reason why this should not be done to please tell me so. :D

Did you make any changes to Main.cs? Because, if so, you did not post that one.
 

Setharnas

Sorceror
Nope, main.cs is still as you put it in the zip. I felt I should not redistribute a new archive because my meager contribution consisted of just one slightly modified method, so I won't claim any credit for it. I wouldn't even have thought of the whole thing if not for you and Ashlar. :)
 

Lokai

Knight
I like it.

I created a new Project Tool to read the files from the separate Scripts folders. I have attached it here, including my modified source files.
 

Attachments

  • ProjectTool.zip
    8.7 KB · Views: 28
  • ProjectTool Source.zip
    10.5 KB · Views: 24

Setharnas

Sorceror
Neat thing, but I have stumbled over a small error. When I tried to open the .csproj file your tool created from my scripts, my VS 2005 error'd out. What it seems to have hiccup'd on was a "&" character (the given position points to a space right after that) in a scriptfolder path.

The error was (paraphrased from german):

The project file "Scripts.csproj" could not be read.
{path}\Scripts.csproj(122,94): The project file could not be loaded. An error occured while analysing 'EntityName'. Line 122, position 94.
 

Lokai

Knight
Setharnas;697035 said:
Neat thing, but I have stumbled over a small error. When I tried to open the .csproj file your tool created from my scripts, my VS 2005 error'd out. What it seems to have hiccup'd on was a "&" character (the given position points to a space right after that) in a scriptfolder path.

The error was (paraphrased from german):

The project file "Scripts.csproj" could not be read.
{path}\Scripts.csproj(122,94): The project file could not be loaded. An error occured while analysing 'EntityName'. Line 122, position 94.

You have a script with an '&' in the name? Try changing the name of that file. I did not get any errors with it, and it's actually the same Project Tool that has been used on these forums quite a lot, just modified for my Version folders.
 

Setharnas

Sorceror
Scripts\Custom\FS Animal Taming Systems Gen2\Advanced Pet System\Gump & Menus

Not even a thing I made myself. ;) But I haven't used that tool before, rather made my own project file for my server. So, I've never had this error before either.
 

Lokai

Knight
Lokai RunUO Menu

Just added to first post this little Batch file utility.

It lets you select debug or service mode, in addition to turning on any combination of switches, all in a cool little batch file menu.

Here are some screen shots:
 

Attachments

  • Lokai1.jpg
    Lokai1.jpg
    36.7 KB · Views: 102
  • Lokai2.jpg
    Lokai2.jpg
    57.1 KB · Views: 92
  • Lokai3.jpg
    Lokai3.jpg
    38.3 KB · Views: 78
probably would - but i would:

1) make back ups 1st
2) look to see the simular calls made in the 1.0 version, and if different way of being done - modify it to match

but can always try it - woprse case is it fubars on you and you have to undo it
 

Lokai

Knight
NEW!

Just added to the top post 2 new downloads, one for 1.0, and another for 2.0 RC2 (or SVN 286.)

Both use the new system discussed earlier in this thread. When you start your Server with one or more of the switches, it will look for files with *.cs extensions located in folders called Scripts.LV1, Scripts.LV2, etc. It will only compile the ones you have selected with switches enabled. I recommend you use the attached Lokai RunUO Menu.bat batch file, which will make running the Server easier, since it will turn on the switches for you.
One Note: "debug" and other modes used in the batch file were NOT tested with the 1.0 version, so use caution on those other switches.
 

Iomega0318

Sorceror
You are the best, I had been unsuccessful in my attempts anyways lol...

**EDIT**

When I download the files they are like corrupt or something and aren't working.. anyone else having this issue?
 
Top