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!

please help compile latest svn :)

delete123

Wanderer
please help compile latest svn :)

hello!

i want to compile the latest svn under linux but don't get it to run. i read all threads here in mono forum - they are no help.

my system is ubuntu 8.10 with mono 1.9.1 and i am interested in:
a) out of the box solution
b) latest svn
c) no downgrading
d) fixing orgies reduced to a minimum

my steps were as follows:
1) getting latest svn from
Code:
http://svn.runuo.com/repos/runuo/devel/
2) with no knowledge of C# applications (but wanting to learn it), i tried the following on command line in subdirectory "Server"
a)
gmcs -recurse:*.cs
result:
errors claiming sth. about unsafe code

b)
gmcs -recurse:*.cs -unsafe
result:
error about some convert TInput to TOutput stuff

c)
looking in the forum, found a fix for "Utility.cs"

replace:
Code:
		public static List<TOutput> CastConvertList<TInput, TOutput>( List<TInput> list ) where TOutput : TInput

		{

			return list.ConvertAll<TOutput>( new Converter<TInput, TOutput>( delegate( TInput value ) { return (TOutput)value; } ) );

		}

to:
Code:
		public static List<TOutput> CastConvertList<TInput, TOutput>( List<TInput> list )
			where TInput : class			
			where TOutput : class

		{

			return list.ConvertAll<TOutput>( new Converter<TInput, TOutput>( delegate( TInput value ) { return value as TOutput; } ) );

		}

d)
again like under b):
gmcs -recurse:*.cs -unsafe
result:
some variables, methods and fields are "never used"
BUT
Compilation succeeded - 64 warning(s)

-> great!

e)
recognizing that the .exe file has an inproper name, thus tuning the gmcs to:
gmcs -recurse:*.cs -unsafe -out:runuo.exe

f)
now i have a runuo.exe. wow!

3) starting the new .exe with
"mono runuo.exe"
resulting in:
Code:
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

4) moving runuo.exe to ../
"mv runuo.exe .."
because the Scripts dir is located there

5) cd ..
mono runuo.exe
result:
Code:
RunUO - [www.runuo.com] Version 2.0, Build 3328.19179
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Core: Unix environment detected
Scripts: Compiling C# scripts...ScriptCompiler: :   at Mono.CSharp.Expression.CloneTo (Mono.CSharp.CloneContext clonectx, Mono.CSharp.Expression target) [0x00000] 
ScriptCompiler: :   at Mono.CSharp.Expression.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]

[B]... some lines prefixed with "ScriptCompiler" ...[/B]

done (0 errors, 1050 warnings)

Warnings:
 + Items/Misc/TribalBerry.cs:
    CS0219: Line 40: The variable `version' is assigned but its value is never used

[B]... about 1000 messages of this type ...[/B]

Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
Exiting...done

6) /me :(

7) /askforhelp

8) suggestion: make it sticky and build a tutorial around it so stuff is not spreaded in x threads?
 

delete123

Wanderer
i recompiled like this: "gmcs -recurse:*.cs -unsafe -d:MONO -out:runuoMONO.exe"

result is:

Code:
RunUO - [www.runuo.com] Version 2.0, Build 3328.20091
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Core: Unix environment detected
Scripts: Compiling C# scripts...ScriptCompiler: :   at Mono.CSharp.Expression.CloneTo (Mono.CSharp.CloneContext clonectx, Mono.CSharp.Expression target) [0x00000] 
ScriptCompiler: :   at Mono.CSharp.Expression.Clone (Mono.CSharp.CloneContext clonectx) [0x00000] 

... some lines prefixed with "ScriptCompiler" ...

done (0 errors, 0 warnings)
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

looks much better, but still the scripts seem to fail to compile.
 

Sathallrin

Sorceror
Go to Scripts/Misc/Emitter.cs

Right after this line:
Code:
public delegate void Callback();

Add this (Should be added after line 496):
Code:
#if MONO
		private static bool GenericComparator( Type type, object obj )
		{
			return ( type.IsGenericType )
				&& ( type.GetGenericTypeDefinition() == typeof( IComparable<> ) )
				&& ( type.GetGenericArguments()[0].IsAssignableFrom(obj as Type) );
		}
#endif


Now around line 538 change:
Code:
				Type[] ifaces = active.FindInterfaces( delegate( Type type, object obj )
				{
					return ( type.IsGenericType )
						&& ( type.GetGenericTypeDefinition() == typeof( IComparable<> ) )
						&& ( type.GetGenericArguments()[0].IsAssignableFrom( active ) );
				}, null );
To:
Code:
#if MONO
				Type[] ifaces = active.FindInterfaces( GenericComparator, active );
#else
				Type[] ifaces = active.FindInterfaces( delegate( Type type, object obj )
				{
					return ( type.IsGenericType )
						&& ( type.GetGenericTypeDefinition() == typeof( IComparable<> ) )
						&& ( type.GetGenericArguments()[0].IsAssignableFrom( active ) );
				}, null );
#endif
 

delete123

Wanderer
thank you, the new 312 has your changes inbuilt.

it works. ;)

now i have another problem: i want to let encrypted clients connect so users do not need third party tools.

but im trying the search. ;)
 
Top