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!

Don't understand how the core works.

pepolshet

Sorceror
Don't understand how the core works.

I have made a big core modification and I don't understand how can I make ScriptCompiler compile a script and then add its class in the core. If I selected Compile on Network.cs (my own script) it compiles fine and ScriptCompiler compiles it from the scripts folder but when I change the script in the scripts folder it doesn't have any effect (except ScriptCompiler detected errors), but if I select None instead of Compile it just throws me errors.

I am using VS2010.
 

Lokai

Knight
pepolshet;839128 said:
I have made a big core modification and I don't understand how can I make ScriptCompiler compile a script and then add its class in the core. If I selected Compile on Network.cs (my own script) it compiles fine and ScriptCompiler compiles it from the scripts folder but when I change the script in the scripts folder it doesn't have any effect (except ScriptCompiler detected errors), but if I select None instead of Compile it just throws me errors.

I am using VS2010.

Not sure what you mean here. Can you post the scripts you changed?
 

pepolshet

Sorceror
I changed almost every script but that's irrelevant, this is the code that causes problems:

Code:
            while (!ScriptCompiler.Compile(m_Debug, m_Cache))
            {
                Console.WriteLine("Scripts: One or more scripts failed to compile or no script files were found.");

                if (m_Service)
                    return;

                Console.WriteLine(" - Press return to exit, or R to try again.");

                if (Console.ReadKey(true).Key != ConsoleKey.R)
                    return;
            }
            ScriptCompiler.Invoke("Configure");
            ScriptCompiler.Invoke("Initialize");
            IniFile read = new IniFile("Config/Settings.ini");
            using (Server.Network.NetworkBase game = new Server.Network.NetworkBase())
            {
                game.Initallize(read.IniReadValue("GlobalSettings", "IP"), read.IniReadValue("GlobalSettings", "Port"));
            }

That is from my Core class, now NetworkBase is a class that I want to be outside the executable in the /scripts folder but if I wont include it with the executable I will get an error, if I will the NetworkBase.cs in the /scripts folder wont matter, ScriptCompiler will detect an error but if I add a
Code:
Console.WriteLine("Test");
inside of it, "Test" will not show on the console.

Thanks for your help, Max.
 

pepolshet

Sorceror
Ok I figured it out.
Does anyone knows what might cause this? I am using 2.0 framework.
Code:
Errors:
 + Accounting/AccessRestrictions.cs:
    CS0234: Line 3: The type or namespace name 'Net' does not exist in the names
pace 'System' (are you missing an assembly reference?)
    CS0234: Line 4: The type or namespace name 'Net' does not exist in the names
pace 'System' (are you missing an assembly reference?)
 

Lokai

Knight
pepolshet;839270 said:
Ok I figured it out.
Does anyone knows what might cause this? I am using 2.0 framework.
Code:
Errors:
 + Accounting/AccessRestrictions.cs:
    CS0234: Line 3: The type or namespace name 'Net' does not exist in the names
pace 'System' (are you missing an assembly reference?)
    CS0234: Line 4: The type or namespace name 'Net' does not exist in the names
pace 'System' (are you missing an assembly reference?)


In Visual Studio, go to References, right-click on 'System' and select 'Properties', then look for the Runtime Version in the Properties pane. It should read something like "v2.0.50727". If yours reads something different, you may have compiled the core with an incompatible version of System.
 
Top