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.
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.