Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Mono

Server Support on Mono Forum dedicated to RunUO 2.0 on Mono.

Reply
 
Thread Tools Display Modes
Old 09-03-2007, 02:51 PM   #1 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Talking 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"
Attached Files
File Type: rar runuo.rar (186.7 KB, 44 views)

Last edited by Sabaoth; 09-03-2007 at 03:39 PM.
Sabaoth is offline   Reply With Quote
Old 09-03-2007, 03:08 PM   #2 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

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!
Sabaoth is offline   Reply With Quote
Old 09-04-2007, 01:03 PM   #3 (permalink)
Forum Expert
 
RavonTUS's Avatar
 
Join Date: Aug 2004
Location: in a house.
Age: 39
Posts: 582
Send a message via ICQ to RavonTUS Send a message via AIM to RavonTUS
Default

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
Attached Images
File Type: jpg MomaError.jpg (66.7 KB, 56 views)
__________________

Will RunUO work on Linux? Yes
RavonTUS is offline   Reply With Quote
Old 09-04-2007, 01:59 PM   #4 (permalink)
Forum Expert
 
RavonTUS's Avatar
 
Join Date: Aug 2004
Location: in a house.
Age: 39
Posts: 582
Send a message via ICQ to RavonTUS Send a message via AIM to RavonTUS
Default

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
Attached Files
File Type: zip Tile.zip (5.5 KB, 8 views)
__________________

Will RunUO work on Linux? Yes
RavonTUS is offline   Reply With Quote
Old 09-04-2007, 02:22 PM   #5 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

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

Quote:
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
Sabaoth is offline   Reply With Quote
Old 09-04-2007, 04:19 PM   #6 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

So I am still learning in coding, but I don't understand this line:

Quote:
#if MONO
private static byte[] m_Buffer;
#endif
it is dead code, because correct it would be usually

Quote:
#if !MONO
private static byte[] m_Buffer;
#endif
but that causes an error

Last edited by Sabaoth; 09-12-2007 at 06:26 PM.
Sabaoth is offline   Reply With Quote
Old 09-06-2007, 07:34 AM   #7 (permalink)
Forum Expert
 
RavonTUS's Avatar
 
Join Date: Aug 2004
Location: in a house.
Age: 39
Posts: 582
Send a message via ICQ to RavonTUS Send a message via AIM to RavonTUS
Default

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
Attached Files
File Type: cs TileMatrix.cs (18.5 KB, 4 views)
File Type: cs TileMatrixPatch.cs (9.3 KB, 4 views)
__________________

Will RunUO work on Linux? Yes
RavonTUS is offline   Reply With Quote
Old 09-06-2007, 08:31 AM   #8 (permalink)
Forum Expert
 
Join Date: Mar 2004
Location: Germany
Age: 22
Posts: 298
Default

Usually it is as simple as compiling with the -d:MONO parameter .... (or something like this) ....
__________________
RunUO RemoteAdmin - Control your shard remotely and keep an eye on the page queue
MulEditor - Modify gump, art, tiledata, multimap, localization files and map/statics.
CentrED - A Client/Server based multi-user map editor.
floppydisc is offline   Reply With Quote
Old 09-06-2007, 09:15 AM   #9 (permalink)
Forum Expert
 
RavonTUS's Avatar
 
Join Date: Aug 2004
Location: in a house.
Age: 39
Posts: 582
Send a message via ICQ to RavonTUS Send a message via AIM to RavonTUS
Default

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 = Utility.Intern(((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.
__________________

Will RunUO work on Linux? Yes

Last edited by RavonTUS; 09-06-2007 at 12:13 PM. Reason: FIGURED IT OUT
RavonTUS is offline   Reply With Quote
Old 09-06-2007, 12:39 PM   #10 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

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.
Sabaoth is offline   Reply With Quote
Old 09-06-2007, 11:34 PM   #11 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

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.

Last edited by Mark; 09-07-2007 at 12:35 AM.
Mark is offline   Reply With Quote
Old 09-07-2007, 04:42 PM   #12 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

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

Last edited by Mark; 09-07-2007 at 04:55 PM.
Mark is offline   Reply With Quote
Old 09-07-2007, 04:45 PM   #13 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

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.
Mark is offline   Reply With Quote
Old 09-07-2007, 06:27 PM   #14 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

IT works! finally! Good job. So here is your serialization.cs build by raventus, it solves your errors!
Attached Files
File Type: cs Serialization.cs (35.6 KB, 26 views)
Sabaoth is offline   Reply With Quote
Old 09-07-2007, 06:53 PM   #15 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

Quote:
Originally Posted by Sabaoth View Post
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.
Mark is offline   Reply With Quote
Old 09-07-2007, 06:55 PM   #16 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

the serialization.cs contains the "if !mono" content, so you can implement it without errors to windows shards...
Sabaoth is offline   Reply With Quote
Old 09-07-2007, 06:58 PM   #17 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

Quote:
Originally Posted by Sabaoth View Post
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 is offline   Reply With Quote
Old 09-07-2007, 06:59 PM   #18 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

The major issue now is object conditionals ([area delete where balron) and other fancy commands.
Mark is offline   Reply With Quote
Old 09-07-2007, 07:04 PM   #19 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

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.Ma nagement,System.Runtime.Remoting,System.Runtime.Se rialization.Formatters.Soap,System.Security,System .ServiceProcess,System.Web,System.Web.Services,Sys tem.Windows.Forms,System.Xml -nowarn:219 -recurse:Server/*.cs
Attached Files
File Type: cs ChampionSpawn.cs (30.9 KB, 17 views)
File Type: cs GauntletSpawner.cs (21.6 KB, 15 views)

Last edited by Sabaoth; 09-07-2007 at 07:11 PM.
Sabaoth is offline   Reply With Quote
Old 09-07-2007, 07:13 PM   #20 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

There is an issue in AdminGump when searching for accounts as well.
Mark is offline   Reply With Quote
Old 09-07-2007, 07:17 PM   #21 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

Fixed another possible issue in TileMatrixPatch.cs SVN 232
Mark is offline   Reply With Quote
Old 09-07-2007, 07:23 PM   #22 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

so plz post your fixed tilematrix.cs, thats easier than doing the svn thing for me.
Here are some files fixed for mono that might cause errors. Every file should work fine on windows as well!
rename Common.map to common.map, because of case sensitivy. So I got no probs with my admin gump right now, what are the problems?
Attached Files
File Type: cs Accounts.cs (2.4 KB, 15 views)
File Type: cs CommunicationCrystals.cs (16.0 KB, 16 views)
File Type: cs AccountPrompt.cs (1.4 KB, 14 views)
File Type: cs AutoSave.cs (5.5 KB, 13 views)
File Type: cs DataPath.cs (2.5 KB, 14 views)
Sabaoth is offline   Reply With Quote
Old 09-07-2007, 07:27 PM   #23 (permalink)
Forum Administrator
 
Join Date: Jan 2003
Location: Northern Virginia
Posts: 1,528
Default

Pick Accounts on the left then hit search with empty fields.
Mark is offline   Reply With Quote
Old 09-07-2007, 07:31 PM   #24 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

so you are right, crashes the server....
Sabaoth is offline   Reply With Quote
Old 09-07-2007, 07:37 PM   #25 (permalink)
Newbie
 
Join Date: Jul 2006
Posts: 22
Default

so you are right, crashes the server.... but reload doesn't even take a second^^ really performance improvements to sunuo or runuo 1.0!
Sabaoth is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes