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!

Script cache hashing

MarciXs

Sorceror
Script cache hashing

Hi,

I haven't done anything with RunUO for quite a bit of time now. Mostly because I've lost interest in Ultima Online itself, I do like to work on things and RunUo is really a great place to do so.
I've been working on a script, and while it is possible to create it without touching the core, i just don't like the way it fits in.
So, I was working on the core a little , and I happen to change things that are used by scripts, that have already been compiled into the cache dll. But since the Core just checks for script modifications(last file change date) it kept on crashing, it took me few minutes to understand the cause of it, but at first it wasn't really close to what was going on.
It kept throwing me MissingMethodException. So I was going through the scripts until I realized it.
So anyhow,
based on this experience It would be nice if you added some sort of validation of the core that compiles the scripts as well. Here is my version of it , very quick one, I wasn't really thinking about anything but to make it work.
In ScriptCompiler.cs
private static byte[] GetHashCode(..) method
after
bin.Write(debug);
I've added
Version ver = Core.Assembly.GetName().Version;
string version = String.Format("{0}{1}{2}{3}", ver.Major, ver.Minor, ver.Build, ver.Revision);
bin.Write(version);

So whenever I rebuild my core I know it will have to recompile the scripts as well. which gives me a thought of maybe even adding .NET version to it as well, but dunno.

Just my thoughts on it.
 
all you have to do is go into the script directory and delete the files in the "output" directory in there
that foreces it to do a recompiling

just remember to do it after doing a core update :)
 

Jeff

Lord
Or, don't do what lord_greywolf says, and save some time and just start the server with "-nocache"...
 
did not know about that little extra to add in there

is there a list someplace that shows all the arguments we can start runuo with?
 

Jeff

Lord
Code:
                public static void Main( string[] args )
                {
                        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler( CurrentDomain_UnhandledException );
                        AppDomain.CurrentDomain.ProcessExit += new EventHandler( CurrentDomain_ProcessExit );

                        for( int i = 0; i < args.Length; ++i )
                        {
                                if ( Insensitive.Equals( args[i], "-debug" ) )
                                        m_Debug = true;
                                else if ( Insensitive.Equals( args[i], "-service" ) )
                                        m_Service = true;
                                else if ( Insensitive.Equals( args[i], "-profile" ) )
                                        Profiling = true;
                                else if ( Insensitive.Equals( args[i], "-nocache" ) )
                                        m_Cache = false;
                                else if ( Insensitive.Equals( args[i], "-haltonwarning" ) )
                                        m_HaltOnWarning = true;
                                else if ( Insensitive.Equals( args[i], "-vb" ) )
                                        m_VBdotNET = true;
                        }
 
thank you on that, is there a place that explains them
the nocache was explained here lol
and debug most know
haltonwarning is previous obvious

the vb one though - does that means you have to0 have a vb vile, or it ignores them completely or what
and profiling is?
and service is?

those 3 can be a little ambigious depending on how you look at them
 

Jeff

Lord
Lord_Greywolf;817373 said:
thank you on that, is there a place that explains them
the nocache was explained here lol
and debug most know
haltonwarning is previous obvious

the vb one though - does that means you have to0 have a vb vile, or it ignores them completely or what
and profiling is?
and service is?

those 3 can be a little ambigious depending on how you look at them

You'd have to look at the code, i dont know off hand.
 

Ravenal

Knight
Jeff;817363 said:
Code:
                public static void Main( string[] args )
                {
                        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler( CurrentDomain_UnhandledException );
                        AppDomain.CurrentDomain.ProcessExit += new EventHandler( CurrentDomain_ProcessExit );

                        for( int i = 0; i < args.Length; ++i )
                        {
                                if ( Insensitive.Equals( args[i], "-debug" ) )
                                        m_Debug = true;
                                else if ( Insensitive.Equals( args[i], "-service" ) )
                                        m_Service = true;
                                else if ( Insensitive.Equals( args[i], "-profile" ) )
                                        Profiling = true;
                                else if ( Insensitive.Equals( args[i], "-nocache" ) )
                                        m_Cache = false;
                                else if ( Insensitive.Equals( args[i], "-haltonwarning" ) )
                                        m_HaltOnWarning = true;
                                else if ( Insensitive.Equals( args[i], "-vb" ) )
                                        m_VBdotNET = true;
                        }

basically

-debug= allows debugging much eaiser of course many know what this does
-service=makes your server become a service based, such as no console is shown during this... And that you have added this to your service lists.
-profile=this is a diagnostic basically statisics to help you determine any speed leaks or what not when things are excuting... for example you'll notice there is Packet Profile, Timer Profile and what not etc.
-haltonwarning=this is of course tells the compiler to halt on warnings rather than just continue to compile (if i am wrong then someone will correct me)
-vb=when you have this, the compiler will attempt to find vb scripts and compile them, if you have any VB.NET Scripts you have to have this argument applied...
 
thanks

question on the vb - i never have it on, but it always checks for them and says non found, so that is why i was wondering on it
 

Jeff

Lord
Soteric;817421 said:
This option was added in RC-2 or later if I'm not mistake. You are using the older version

It was added June 17th 2006 SVN Revision 28. RC2 was released 02-07-2008, 11:12 AM. I think it was added well before RC2 :)
 
well that i would defentely have as an option, mine is not that old - svn 28 - long time ago lol

it checking for them and not finding any is different than it checking and finding some and then doing sowemthing with them lol
maybe it checks and does not care since there is none - i think i have seen 1 vb script writen for runuo on these boards
 

Jeff

Lord
The only downside to vb script is the C# scripts cant reference anything made in them due to the compilation order.
 
Top