DOL under linux solving various error

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

DOL under linux solving various error

Postby destiny71 » Sun Mar 09, 2014 3:30 pm

Hi Dol comunity. Im new user and this is my first post. Sorry in advanced for my poor english. I suppose this is a correct section.

During compiling DOL (the last svn release) under linux (ubuntu 13.04) i found this error and solving whit implicit cast but not sure this fix is a best solution.

Error 1
ai/brain/StandardMobBrain.cs(992,70): error CS0172: Type of conditional expression cannot be determined as `int' and `byte' convert implicitly to each other

change line 992 from
Code: Select all
int numAttackers = (attackerGroup == null) ? 1 : attackerGroup.MemberCount;
to
Code: Select all
int numAttackers = (attackerGroup == null) ? 1 : (int)attackerGroup.MemberCount;
Error 2
gameobjects/GameLiving.cs(2939,93): error CS0172: Type of conditional expression cannot be determined as `byte' and `int' convert implicitly to each other
gameobjects/GameLiving.cs(2939,52): error CS1502: The best overloaded method match for `System.Math.Ceiling(decimal)' has some invalid arguments
gameobjects/GameLiving.cs(2939,52): error CS1503: Argument `#1' cannot convert `object' expression to type `decimal'


change line 2939 from
Code: Select all
int procChance = (int)Math.Ceiling(((weapon.ProcChance > 0 ? weapon.ProcChance : 10) * (weapon.SPD_ABS / 35.0)));
Code: Select all
int procChance = (int)Math.Ceiling((((int)weapon.ProcChance > 0 ? (int)weapon.ProcChance : 10) * (weapon.SPD_ABS / 35.0)));
Error 3
gameobjects/GamePlayer.cs(7065,121): error CS0172: Type of conditional expression cannot be determined as `byte' and `int' convert implicitly to each other

change line 7065 from
Code: Select all
int chance = reactiveItem.ProcChance > 0 ? reactiveItem.ProcChance : 10;
to
Code: Select all
int chance = (int)reactiveItem.ProcChance > 0 ? (int)reactiveItem.ProcChance : 10;
Error 4
gameobjects/GamePlayer.cs(7084,121): error CS0172: Type of conditional expression cannot be determined as `byte' and `int' convert implicitly to each other

change line 7084 from
Code: Select all
int chance = reactiveItem.ProcChance > 0 ? reactiveItem.ProcChance : 10;
to
Code: Select all
int chance = (int)reactiveItem.ProcChance > 0 ? (int)reactiveItem.ProcChance : 10;
Now DOL compile and work very well.

-----
Destiny
-------------
Destiny
destiny71
DOL Visitor
 
Posts: 10
Joined: Sun Mar 09, 2014 3:12 pm
Website: http://www.websources.it
Location: Italy

Re: DOL under linux solving various error

Postby Graveen » Sun Mar 09, 2014 4:42 pm

Thank you. Can you give the version of mono you are using ?
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: DOL under linux solving various error

Postby destiny71 » Sun Mar 09, 2014 4:47 pm

Im using monodevelop 3.0.3.2 and Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5ubuntu1) on x86_64
-------------
Destiny
destiny71
DOL Visitor
 
Posts: 10
Joined: Sun Mar 09, 2014 3:12 pm
Website: http://www.websources.it
Location: Italy

Re: DOL under linux solving various error

Postby Leodagan » Mon Mar 10, 2014 8:57 am

It's weird, I didn't run accross these while compiling with Mono 3.2
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: DOL under linux solving various error

Postby destiny71 » Mon Mar 10, 2014 10:32 am

It's weird, I didn't run accross these while compiling with Mono 3.2
I do not think the mono version of Ubuntu is changed from 13:04 to 13:10. (Now in my Ubuntu 13:10: Mono JIT compiler version 2.10.8.1 (2.10.8.1-5ubuntu2 Debian) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. http://www.mono-project.com) and the version of MonoDevelop is always 3.0.3.2

I tried to update with additional Launchpad repository but nothing changed.

----------
Destiny
-------------
Destiny
destiny71
DOL Visitor
 
Posts: 10
Joined: Sun Mar 09, 2014 3:12 pm
Website: http://www.websources.it
Location: Italy

Re: DOL under linux solving various error

Postby Tolakram » Mon Mar 10, 2014 11:20 am

Could it be the warning or error level used? Strict type checking turned on? Something like that?
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: DOL under linux solving various error

Postby destiny71 » Mon Mar 10, 2014 12:05 pm

Could it be the warning or error level used? Strict type checking turned on? Something like that?
Hi Tolakram thanks for reply.

My skill in .net not very high because normaly i programing in other language like Java or C++ but logically do not think depends on the level of error display. Generally the warnings message, not knowing .net very well and might be completely wrong, showing alert message but allow you to complete the compilation process. In my case it gave me a failure of the compilation (stop compilation whitout creating binary file) with a most Warning (19 yellow messages on console) and 6 Errors (messages in red).

If necessary reproduce the error and post a screen for more details.

Edit: Attach screen: http://www.websources.it/wp-content/upl ... 03/dol.png

Original line (992) in StandardMobBrain.cs whitout implicit cast, error message in console and debug/release folder empty
---------------
Destiny
-------------
Destiny
destiny71
DOL Visitor
 
Posts: 10
Joined: Sun Mar 09, 2014 3:12 pm
Website: http://www.websources.it
Location: Italy

Re: DOL under linux solving various error

Postby Leodagan » Mon Mar 10, 2014 1:49 pm

It's weird, I didn't run accross these while compiling with Mono 3.2
I do not think the mono version of Ubuntu is changed from 13:04 to 13:10. (Now in my Ubuntu 13:10: Mono JIT compiler version 2.10.8.1 (2.10.8.1-5ubuntu2 Debian) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. http://www.mono-project.com) and the version of MonoDevelop is always 3.0.3.2

I tried to update with additional Launchpad repository but nothing changed.

----------
Destiny
I'm running Freyad under Mono 3.2 x86_64 on Ubuntu (I don't remember exactly the Ubuntu Release...)

https://launchpad.net/~directhex/+archive/monoxide

My testing server is a Gentoo Linux with self-compiled Mono 3.2, but I admit that I still compile my ByteCode using SharpDevelop under Windows... (.NET 4.5)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: DOL under linux solving various error

Postby destiny71 » Tue Mar 11, 2014 10:39 am

It's weird, I didn't run accross these while compiling with Mono 3.2
I do not think the mono version of Ubuntu is changed from 13:04 to 13:10. (Now in my Ubuntu 13:10: Mono JIT compiler version 2.10.8.1 (2.10.8.1-5ubuntu2 Debian) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. http://www.mono-project.com) and the version of MonoDevelop is always 3.0.3.2

I tried to update with additional Launchpad repository but nothing changed.

----------
Destiny
I'm running Freyad under Mono 3.2 x86_64 on Ubuntu (I don't remember exactly the Ubuntu Release...)

https://launchpad.net/~directhex/+archive/monoxide

My testing server is a Gentoo Linux with self-compiled Mono 3.2, but I admit that I still compile my ByteCode using SharpDevelop under Windows... (.NET 4.5)
Updating Ubuntu at development branch (14.04 Trusty) and now compile whitout problem whit monodevelop 4.0.12 and Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
-------------
Destiny
destiny71
DOL Visitor
 
Posts: 10
Joined: Sun Mar 09, 2014 3:12 pm
Website: http://www.websources.it
Location: Italy

Re: DOL under linux solving various error

Postby Graveen » Wed Mar 12, 2014 8:45 am

thank you for the feedback guys !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest