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!

Linux again, but it is getting close to run

Sabaoth

Wanderer
Linux again, but it is getting close to run

Hi there,

a few days ago a new mono version was released and it solves many Problems. My System is a Suse 10.2 running mono 2.5.

In the Fixes for Linux threat are some hints how to modify Scripts...

I use latest RunUO SVN with the modified Server Scripts collected by RavenTUS without his Utility.cs, that one works nativly.

The Server runs stable and there are no crashes, but the dropping into the tiles problem still exists. If anyone got an Idea how to solve, or is interested in solving with me, let me know! I figured out that all if mono lines in the tilematix.cs and tilematrixpatch.cs aren't needed anymore except the "private static byte[] m_Buffer;" line.

If you would like to join me in building up a runnable version on linux add me on icq: 74-591-632

so far

Saba

I attached my working runuo.exe file, start with "mono runuo.exe"
 

Attachments

  • runuo.rar
    186.7 KB · Views: 48

Sabaoth

Wanderer
So I got some ideas right now, getting the stuff to run. I'm not sure about that, but pm me or add me on icq to talk about that and maybe getting a great step foreward!
 

RavonTUS

Sorceror
Greetings,

I think the problem is in TileMatrixPatch (PatchLand & PatchStatics) and TileMatrix (ReadStaticBlock & ReadLandBlock). I think Mono does not like way it is using ".get_SafeFileHandle()".

There is a "IF MONO" section, however, I wonder if it might be coded incorrectly...

Code:
                        fixed (Tile* pTiles = tiles)
                        {
#if !MONO
		_lread( fsData.SafeFileHandle.DangerousGetHandle(), pTiles, 192 );
#else
        if (m_Buffer == null || 192 > m_Buffer.Length)
            m_Buffer = new byte[192];

        fsData.Read(m_Buffer, 0, 192);

        fixed (byte* pbBuffer = m_Buffer)
        {
            Tile* pBuffer = (Tile*)pbBuffer;
            Tile* pEnd = pBuffer + 64;
            Tile* pCur = pTiles;

            while (pBuffer < pEnd)
                *pCur++ = *pBuffer++;
        }
#endif
                        }

                        matrix.SetLandBlock(x, y, tiles);
                    }

Sorry, my skills in this section of coding is poor.

I think it is this section of code because of the Moma report...

-Ravon
 

Attachments

  • MomaError.jpg
    MomaError.jpg
    66.7 KB · Views: 60

RavonTUS

Sorceror
Sabaoth,

I am not a my Linux PC and cannot test my latest idea...

Try replacing these two files in the server folder and re-compile. Then see if you can walk correctly.


-Ravon
 

Attachments

  • Tile.zip
    5.5 KB · Views: 12

Sabaoth

Wanderer
Using this Scripts I get compile error during .exe compilation:

Server/TileMatrix.cs(487,21): error CS0246: The type or namespace name `GCHandle ' could not be found. Are you missing a using directive or an assembly reference ?
Server/TileMatrix.cs(591,17): error CS0246: The type or namespace name `GCHandle ' could not be found. Are you missing a using directive or an assembly reference ?
Compilation failed: 2 error(s), 0 warnings
 

RavonTUS

Sorceror
Greetings,

The IF MONO code is used to determine what OS you are using. It works like this...

Code:
#if MONO
    SAY ("This is a Linux PC with MONO");
#else
    SAY ("This is a Windows PC with .NET");
#endif

Or you can reverse it like this...

Code:
#if !MONO
    SAY ("This is a Windows PC with .NET");
#else
    SAY ("This is a Linux PC with MONO");
#endif

You use this because not all .NET code works with MONO, since MONO is still in development.

NOW, let us put it to good use and try these two files I updated. I still have not tested them (I have not had time still to setup my Linux PC). Replace your current TileMatrix.cs and TileMatrixPatch.cs and then recompile.

-Ravon
 

Attachments

  • TileMatrix.cs
    18.5 KB · Views: 6
  • TileMatrixPatch.cs
    9.3 KB · Views: 6

RavonTUS

Sorceror
Greetings,

I have my Linux PC us and running now - kubutu 7.04 with Mono 1.2.5. When I compile I get the following error, which I had not gotten before. Any one know if it is a bug, or something I am doing wrong...

NetState.cs
Code:
CS1502: Line 535: The best overloaded method match for `Server.Utility.Intern(string)' has some invalid arguments

m_Address = [COLOR="Red"]Utility.Intern[/COLOR](((IPEndPoint)m_Socket.RemoteEndPoint).Address);

If I remove Utility.Intern it continues to compile However, this statement is used all over the place and I really do not like the idea of taking it out.

-Ravon

NEVERMIND, Something bad in one of my scripts.
 

Sabaoth

Wanderer
Hi There,

so I have had the same Problem. If you use the original utility.cs from the actual runuo 2.0 svn it is just fine, your modified version didn't work for me either.
 

Mark

Knight
The server is playable with the latest stable mono release with only a handful of changes. There are still some problems however (particularly with code that uses emitter and anonymous methods).

I will commit some changes to SVN when I have the time and post a few tips.

EDIT: Looks like mono has some serious flaws with some Deserialize calls. It will take some hacking to make them work.
 

Mark

Knight
SVN 231 'works' with mono without modification.

There are several points to keep in mind:
1. gmcs must be in your path when you start the server.
2. If the core executable changes, the Scripts/Output/ folder must be deleted (or the cached library must be invalidated). It appears when Mono builds the script library it has a hard dependancy on the core that built it.
3. Conditional commands are hit or miss due to their advanced use of Emitter.
4. Deserialize fails on ReadStrongMobileList()
5. You will need to add a line to your etc/mono/config file:
Code:
<dllmap dll="zlib32" target="libz.so" />

$ svn update .
At revision 231.

$ ~/mono-1.2.5/bin/gmcs -d:MONO -unsafe+ -optimize+ -t:exe -out:RunUO.exe -recurse:Server/*.cs

$ PATH=~/mono-1.2.5/bin ~/mono-1.2.5/bin/mono RunUO.exe
 

Mark

Knight
Regarding the deserialize issue:

Code:
$ PATH=~/mono-1.2.5/bin ~/mono-1.2.5/bin/mono RunUO.exe
RunUO - [www.runuo.com] Version 2.0, Build 2806.28250
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 4 processors
Scripts: Compiling C# scripts...done (cached)
Scripts: Compiling VB.NET scripts...no files found.
Scripts: Verifying...done (2107 items, 500 mobiles)
Enter the Ultima Online directory:
> /home/mark/uo/
Regions: Loading...done
World: Loading...
** ERROR **: file mini.c: line 4661 (mono_method_to_ir): assertion failed: (mono_method_signature (cmethod)->is_inflated)
aborting...
Stacktrace:

  at (wrapper managed-to-native) System.Object.__icall_wrapper_compile_generic_method (object,intptr,intptr,intptr) <0x00004>
  at (wrapper managed-to-native) System.Object.__icall_wrapper_compile_generic_method (object,intptr,intptr,intptr) <0xffffffff>
  at Server.BinaryFileReader.ReadStrongMobileList () <0x00020>
  at Server.Mobile.Deserialize (Server.GenericReader) <0x002d2>
  at Server.Mobiles.PlayerMobile.Deserialize (Server.GenericReader) <0x00034>
  at Server.World.Load () <0x016c5>
  at Server.ScriptCompiler.Compile (bool,bool) <0x002d8>
  at Server.Core.Main (string[]) <0x00865>
  at (wrapper runtime-invoke) Server.Core.runtime_invoke_void_string[] (object,intptr,intptr,intptr) <0xffffffff>

It looks like mono chokes on our generic method List<T> ReadStrongMobileList<T>(), which is called by ReadStrongMobileList() (in the form of ReadStrongMobileList<Mobile>()).

Regardless, it shouldn't be much trouble to get this working on your own. It isn't something I want to modify in the repository yet.
 

Sabaoth

Wanderer
IT works! finally! Good job. So here is your serialization.cs build by raventus, it solves your errors!
 

Attachments

  • Serialization.cs
    35.6 KB · Views: 31

Mark

Knight
Sabaoth;709797 said:
IT works! finally! Good job. So here is your serialization.cs build by raventus, it solves your errors!

It works with a bit of hacking, but I do not like changing serialization api between platforms.
 

Sabaoth

Wanderer
the serialization.cs contains the "if !mono" content, so you can implement it without errors to windows shards...
 

Mark

Knight
Sabaoth;709805 said:
the serialization.cs contains the "if !mono" content, so you can implement it without errors to windows shards...

Yes, but with /d:MONO it removes ReadItem<T>() call and replaces with ReadItemG<T>() which must be accounted for in other Deserialize methods (like ChampionSpawn.cs and GauntletSpawner.cs).
 

Mark

Knight
The major issue now is object conditionals ([area delete where balron) and other fancy commands.
 

Sabaoth

Wanderer
so here are modified ChampionSpawn.cs and GauntletSpawner.cs, should also work on windows and works fine on mono...
compile with:
gmcs -out:../runuo.exe -d:MONO -optimize+ -unsafe -r:System,System.Configuration.Install,System.Data,System.Drawing,System.EnterpriseServices,System.Management,System.Runtime.Remoting,System.Runtime.Serialization.Formatters.Soap,System.Security,System.ServiceProcess,System.Web,System.Web.Services,System.Windows.Forms,System.Xml -nowarn:219 -recurse:Server/*.cs
 

Attachments

  • ChampionSpawn.cs
    30.9 KB · Views: 18
  • GauntletSpawner.cs
    21.6 KB · Views: 16
Top