kubuntUO - RunUO linux for human beings

Wednesday, January 31, 2007

GMCS - Update

Greetings,

I have make a little bit of progress by modifying the compile command. I am now using this...

$ gmcs -out:../runuo.exe -d:MONO -optimize+ -unsafe -r:System.Drawing,System.Web,System.Windows.Forms,System.Xml -nowarn:219 -recurse:*.cs
I have now come to believe that when you compile RunUO on a Linux box, you must compile everything (server, scripts and data folders) all at the same time. Unlike Microsoft, where you compile the server, then the server.exe compiles the scripts and data folders.

This being the case I have had to make the following changes...

Remove the MyRunUO folder from /scripts/engines and modifying the playermobile.cs around line 2953 (see below).
public void InvalidateMyRunUO()
{
if ( !Deleted && !m_ChangedMyRunUO )
{
m_ChangedMyRunUO = true;
#if !MONO
Engines.MyRunUO.MyRunUO.QueueMobileUpdate( this );
#endif
}
}
I also modified the DataPath.cs. I am not sure if this is needed, but for the sake of making sure to find the files, I changed it. Look around line 16. Enter you Wine folder and path to UO.

* private const string CustomPath = @"C:\Program Files\Ultima Online";
*/
private static string CustomPath = @"/home/test/.wine/drive_c/Program Files/EA Games/Ultima Online Mondain's Legacy";

/* The following is a list of files which a required for proper execution:
*
* Multi.idx



It will now compile (using Mono SVN 20070131), after running the MONO RunUO.exe I get the follow error.

[www.runuo.com] Version 2.0, Build 2587.16047
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Scripts: Compiling C# scripts...no files found.
Scripts: Compiling VB.NET scripts...no files found.
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Error:
System.InvalidCastException: Cannot cast from source type to destination type.
at System.TermInfoDriver.WriteConsole (System.String str) [0x00000]
at System.TermInfoDriver.Init () [0x00000]
at System.TermInfoDriver.ReadKey (Boolean intercept) [0x00000]
at System.ConsoleDriver.ReadKey (Boolean intercept) [0x00000]
at System.Console.ReadKey (Boolean intercept) [0x00000]
at Server.Core.Main (System.String[] args) [0x00000]
This exception is fatal, press return to exit

** (RunUO.exe:6444): WARNING **: exception inside UnhandledException handler: Object reference not set to an instance of an object


I still think the section in red is related to the TInput/TOut, not working in Mono. I have submitted this as a bug to the MONO team.

Any suggestions?

-Ravon

2 Comments:

  • Could you compile this with -debug and run with --debug?

    That would help us find out where the invalid cast is happening.

    This is happening inside our new Console code and I would love to fix this before the 1.2.3 release.

    Miguel

    By Blogger mdi, at 9:54 AM  

  • I updated to MONO 1.2.20070131. It now compiles, however, when I run the exe I get the following here (here is the -debug).

    $ gmcs -out:../RunUO.exe -d:MONO -optimize+ -unsafe -debug -r:System.Drawing,System.Web,System.Windows.Forms,System.Data,System.Xml -nowarn:219 -recurse:*.cs

    Compilation succeeded - 5 warning(s)

    $ mono --debug RunUO.exe
    RunUO - [www.runuo.com] Version 2.0, Build 2588.12501
    Core: Running on .NET Framework Version 2.0.50727
    Core: Optimizing for 2 processors
    Scripts: Compiling C# scripts...Error:
    System.Exception: Compiler failed to produce the assembly. Stderr='', Stdout=''
    at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00255] in /home/test/mono/mono-1.2.20070131/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:235
    at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00012] in /home/test/mono/mono-1.2.20070131/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:138
    at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00015] in /home/test/mono/mono-1.2.20070131/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs:127
    at Server.ScriptCompiler.CompileCSScripts (Boolean debug, Boolean cache, System.Reflection.Assembly& assembly) [0x00197] in /home/test/runuo/RunUO-New/RunUO-v2.0-SVN/Server/ScriptCompiler.cs:224
    at Server.ScriptCompiler.Compile (Boolean debug, Boolean cache) [0x00034] in /home/test/runuo/RunUO-New/RunUO-v2.0-SVN/Server/ScriptCompiler.cs:526
    at Server.Core.Main (System.String[] args) [0x00313] in /home/test/runuo/RunUO-New/RunUO-v2.0-SVN/Server/Main.cs:421
    This exception is fatal, press return to exit

    ** (RunUO.exe:5976): WARNING **: exception inside UnhandledException handler: Cannot cast from source type to destination type.


    I updated to MONO 1.2.20070131. It now compiles, however, when I run the exe I get the following here (here is the -debug).

    $ gmcs -out:../RunUO.exe -d:MONO -optimize+ -unsafe -debug -r:System.Drawing,System.Web,System.Windows.Forms,System.Data,System.Xml -nowarn:219 -recurse:*.cs

    Compilation succeeded - 5 warning(s)

    $ mono --debug RunUO.exe
    RunUO - [www.runuo.com] Version 2.0, Build 2588.12501
    Core: Running on .NET Framework Version 2.0.50727
    Core: Optimizing for 2 processors
    Scripts: Compiling C# scripts...Error:
    System.Exception: Compiler failed to produce the assembly. Stderr='', Stdout=''
    at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00255] in /home/test/mono/mono-1.2.20070131/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:235
    at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00012] in /home/test/mono/mono-1.2.20070131/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:138
    at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00015] in /home/test/mono/mono-1.2.20070131/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs:127
    at Server.ScriptCompiler.CompileCSScripts (Boolean debug, Boolean cache, System.Reflection.Assembly& assembly) [0x00197] in /home/test/runuo/RunUO-New/RunUO-v2.0-SVN/Server/ScriptCompiler.cs:224
    at Server.ScriptCompiler.Compile (Boolean debug, Boolean cache) [0x00034] in /home/test/runuo/RunUO-New/RunUO-v2.0-SVN/Server/ScriptCompiler.cs:526
    at Server.Core.Main (System.String[] args) [0x00313] in /home/test/runuo/RunUO-New/RunUO-v2.0-SVN/Server/Main.cs:421
    This exception is fatal, press return to exit

    ** (RunUO.exe:5976): WARNING **: exception inside UnhandledException handler: Cannot cast from source type to destination type.


    -Ravon

    By Blogger Ravon, at 4:24 AM  

Post a Comment

<< Home