Anyone who can do a ServUO linux howto for Windows idiots?

Status
Not open for further replies.

Ravenwolfe

Moderator
ServUO Developer
Hey guys,

I've created a virtual machine install of Ubuntu 12.04 Desktop and I would like to try running a server there. So far, I've managed to accomplish very little.

Could I beg someone to write a quick howto for people who don't know linux very well?

I've found some stuff, but most of it seems to be old info related to RunUO. I've noticed that Vorspire added a compile.MONO.bat file to the last publish, so I'm guessing this has something to do with making a linux install easier but I still don't get it.

I can install linux. I have used apt-get to get Mono.

What do I need to do next? How do I get the client files over? Do I need Wine if I am only going to use Ubuntu as the server and not play on the box? How do I compile and run the server? And lastly, what is a good program in linux to edit the scripts on the server?

Thanks, I think a howto would benefit everyone as I'm finding much better prices on Linux hosts then on Windows hosts.
 

Regnak

Rookie
Hey Ravenwolfe,

Here's a quick how-to, which I will complete later with more deeper information.

First, choose your distribution. I have only worked with Ubuntu so far (well, for running ServUO and RunUO I mean), and it seems to work fine. But you should have no problems with other distros.

Secondly, I would advice to use MONO rather than Wine (Hank would not agree on that ... wine's so tasty ! lol)
I have had bad experiences with Wine, like freezes for no reasons.
To get MONO, pay attention that you need MONO 3.0++. Default MONO from packages comes with a 2.1++
How to install MONO 3.0++ ?
Here's a useful how to :
Add this line to your /etc/apt/sources.list file:
deb http://debian.meebey.net/experimental/mono /

Now update the APT database and install mono-complete from that repository:
apt-get update
apt-get install mono-complete

As a side note, to edit a file on Ubuntu, I use Nano. For example : "nano /etc/apt/sources.list" will help you edit the repository sources. ;)

Once you have MONO 3+, you will be able to compile ServUO with the following command :
Code:
mcs -sdk:4.5 -out:ServUO.exe -d:MONO -d:Framework_4_0 -d:ServUO -optimize+ -unsafe -r:System,System.Configuration.Install,System.Data,System.Drawing,System.EnterpriseServices,System.Management,System.Security,System.ServiceProcess,System.Web,System.Web.Services,System.Windows.Forms,System.Xml,OpenUO.Core.dll,OpenUO.Ultima.dll,OpenUO.Ultima.Windows.Forms.dll,SevenZipSharp.dll -nowarn:219 -recurse:Server/*.cs

Then, you will have to upload the client files to a folder on your server : for example, /opt/uo
Don't forget to change your DataPath.cs to the right folder (or you will experience a crash at startup).

I think that's it for now :)

I'll probably have to update this quick how-to with deeper crash fixes, as it seems there are some fixes to do with the main.cs file so that it is MONO compatible (conditional compiling again ... )

Have fun !

-Rek-
 

pall

Citizen
I get this
Code:
[email protected]:/home/jotur/ServUO# mcs -sdk:4.5 -out:ServUO.exe -d:MONO -d:Framework_4_0 -d:ServUO -optimize+ -unsafe -r:System,System.Configuration.Install,System.Data,System.Drawing,System.EnterpriseServices,System.Management,System.Security,System.ServiceProcess,System.Web,System.Web.Services,System.Windows.Forms,System.Xml,OpenUO.Core.dll,OpenUO.Ultima.dll,OpenUO.Ultima.Windows.Forms.dll,SevenZipSharp.dll -nowarn:219 -recurse:Server/*.cs

Server/Timer.cs(364,22): warning CS0414: The private field `Server.Timer.m_QueueCountAtSlice' is assigned but its value is never used
Server/Persistence/FileQueue.cs(224,34): warning CS0414: The private field `Server.FileQueue.Chunk.offset' is assigned but its value is never used
Server/custom/TileMatrix.cs(36,15): warning CS0414: The private field `Server.TileMatrix.m_Width' is assigned but its value is never used
Server/custom/TileMatrix.cs(36,24): warning CS0414: The private field `Server.TileMatrix.m_Height' is assigned but its value is never used
Server/fix/Main.cs(44,28): warning CS0414: The private field `Server.Core._OpenUOSDK' is assigned but its value is never used
Server/fix/Main.cs(118,32): warning CS0414: The private field `Server.Core._HighRes' is assigned but its value is never used
Server/fix/Main.cs(119,34): warning CS0414: The private field `Server.Core._Frequency' is assigned but its value is never used
Compilation succeeded - 7 warning(s)

and when i do mono ServUO.exe
i get error, any can help me? :S



Code:
[email protected]:/home/jotunserver/ServUO# mono ServUO.exe
----------------------------------------------------------------------------
ServUO - [http://www.servuo.com] Version 0.5, Build 5741.11136
Publish
Core: Optimizing for 4 processors
Core: Unix environment detected
RandomImpl: SimpleRandom (Software)
Scripts: Compiling C# scripts...ScriptCompiler: : /home/jotunserver/ServUO/ServUO.exe (Location of the symbol related to previous warning)
ScriptCompiler: : Scripts/Items/Addons/AddonComponent.cs(231,21): (Location of the symbol related to previous warning)
ScriptCompiler: : Scripts/Items/Addons/AddonComponent.cs(231,21): (Location of the symbol related to previous warning)
ScriptCompiler: : /home/jotunserver/ServUO/ServUO.exe (Location of the symbol related to previous warning)
ScriptCompiler: : /home/jotunserver/ServUO/ServUO.exe (Location of the symbol related to previous warning)
ScriptCompiler: : Scripts/custom/mobiles/vendors/PlayerVendor.cs(1173,15): (Location of the symbol related to previous warning)
ScriptCompiler: : /home/jotunserver/ServUO/ServUO.exe (Location of the symbol related to previous warning)
ScriptCompiler: : /home/jotunserver/ServUO/ServUO.exe (Location of the symbol related to previous warning)
Finished with: 0 errors, 16 warnings
Warnings:
+ Custom Systems/Government System/Vendor/CityContractOfEmployment.cs:
    CS0642: Line 57: Possible mistaken empty statement
+ Custom Systems/Account Deposit Box 1.2/AccountDepositBox.cs:
    CS0108: Line 110: `Server.Items.AccountDepositBox.MaxItems' hides inherited member `Server.Items.Container.MaxItems'. Use the new keyword if hiding was intended
    CS0162: Line 174: Unreachable code detected
+ Custom Systems/Cooking Systems/Apiculture/BeeHive.cs:
    CS0108: Line 97: `Server.Items.BeeHive.OnChop(Server.Mobile)' hides inherited member `Server.Items.AddonComponent.OnChop(Server.Mobile)'. Use the new keyword if hiding was intended
+ Custom Systems/Cooking Systems/Apiculture/BeeHivehouse.cs:
    CS0108: Line 104: `Server.Items.BeeHiveHouse.OnChop(Server.Mobile)' hides inherited member `Server.Items.AddonComponent.OnChop(Server.Mobile)'. Use the new keyword if hiding was intended
+ Custom Systems/Custom Skills TMSS 3.0.3/SkillStone.cs:
    CS0114: Line 201: `Server.Items.SkillStone.GetContextMenuEntries(Server.Mobile, System.Collections.Generic.List<Server.ContextMenus.ContextMenuEntry>)' hides inherited member `Server.Item.GetContextMenuEntries(Server.Mobile, System.Collections.Generic.List<Server.ContextMenus.ContextMenuEntry>)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword
    CS0114: Line 244: `Server.Items.CenterStone.GetContextMenuEntries(Server.Mobile, System.Collections.Generic.List<Server.ContextMenus.ContextMenuEntry>)' hides inherited member `Server.Item.GetContextMenuEntries(Server.Mobile, System.Collections.Generic.List<Server.ContextMenus.ContextMenuEntry>)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword
+ Custom Systems/Government System/Vendor/CityPlayerVendor.cs:
    CS0108: Line 286: `Server.Mobiles.CityPlayerVendor.Dismiss(Server.Mobile)' hides inherited member `Server.Mobiles.PlayerVendor.Dismiss(Server.Mobile)'. Use the new keyword if hiding was intended
+ Custom Systems/Town Houses v2.01/Gumps/Gumps Plus Light/ButtonPlus.cs:
    CS0108: Line 13: `Knives.TownHouses.ButtonPlus.Name' hides inherited member `Server.Gumps.GumpButton.Name'. Use the new keyword if hiding was intended
    CS0108: Line 29: `Knives.TownHouses.ButtonPlus.Invoke()' hides inherited member `Server.Gumps.GumpButton.Invoke()'. Use the new keyword if hiding was intended
+ Custom Systems/Government System/PlayerGovernmentSystem.cs:
    CS0162: Line 635: Unreachable code detected
+ Custom Systems/HairGrowth with FacialHairGrowth/FacialHairGrowth.cs:
    CS0162: Line 105: Unreachable code detected
+ Custom Systems/HairGrowth with FacialHairGrowth/HairGrowth.cs:
    CS0162: Line 165: Unreachable code detected
+ Custom Systems/sistema de bodas y divorcios/Devorce Lawyer/DivorceGump.cs:
    CS0162: Line 186: Unreachable code detected
+ Custom Systems/tiendas campa?a/Chest.cs:
    CS0162: Line 115: Unreachable code detected
+ Services/Quests/Peerless System/PeerlessAltar.cs:
    CS0472: Line 607: The result of comparing value type `System.TimeSpan' with null is always `true'
+ custom/misc/ResourceInfo.cs:
    CS1717: Line 1026: Assignment made to same variable; did you mean to assign something else?
+ custom/mobiles/BaseCreature.cs:
    CS0162: Line 6292: Unreachable code detected
+ Custom Systems/Cooking Systems/Foods/Container Food/ContainerFood.cs:
    CS0649: Line 10: Field `Server.Items.ContainerFood.m_Poisoner' is never assigned to, and will always have its default value `null'
    CS0649: Line 11: Field `Server.Items.ContainerFood.m_Poison' is never assigned to, and will always have its default value `null'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 
Last edited:

Regnak

Rookie
Hey !

It's been a long time I haven't tested ServUO on Linux, but I remember something about adding other types of errors in the NOWARN parameter. Could you try to compile ServUO with this line ?

Code:
mcs -sdk:4.5 -out:ServUO.exe -d:MONO -d:Framework_4_0 -d:ServUO -optimize+ -unsafe -r:System,System.Configuration.Install,System.Data,System.Drawing,System.EnterpriseServices,System.Management,System.Security,System.ServiceProcess,System.Web,System.Web.Services,System.Windows.Forms,System.Xml,OpenUO.Core.dll,OpenUO.Ultima.dll,OpenUO.Ultima.Windows.Forms.dll,SevenZipSharp.dll -nowarn:219,414 -recurse:Server/*.cs

This should remove the number of warnings.

Also, to be able to launch ServUO.exe with Mono, I fear you will have to modify a script inside ServUO.
Look for /Server/ScriptCompiler.cs, and modify it according to this :
Code:
#if !MONO
CompilerResults results = provider.CompileAssemblyFromFile(parms, files);
#else
parms.CompilerOptions = String.Format( "{0} /nowarn:169,219,414,618,429,162,252,849,1717,612,108 /recurse:Scripts/*.cs", parms.CompilerOptions );
CompilerResults results = provider.CompileAssemblyFromFile( parms, "" );
  #endif
(solution found on RunUO Forum ... thx Familiar Realms !! )

The goal is also adding more warnings to the nowarn list.


So :
1/ modify /Server/ScriptCompiler.cs
2/ recompile with the new command line
3/ launch ServUO with mono
4/ cross fingers

Good luck !

-Rek-
 
Status
Not open for further replies.