SVN Rev: 3559

View and discuss the latests SVN commits, to ensure the best efficiency in our work.

Moderators: Support Team, Developer Team

SVN Rev: 3559

Postby HunabKu » Tue Oct 13, 2015 12:23 pm

Author : Hunab Ku

Patched ScriptMgr to choose if using Mono or not because when using it, the code actualy block the SriptLoaded event
- Added a ServerProperty named USE_MONO in ServerProperties.cs
- Modified ScriptMgr.cs for use old code if don't use Mono.

/DOLSharp/trunk/GameServer/gameutils/ScriptMgr.cs
/DOLSharp/trunk/GameServer/serverproperty/ServerProperties.cs

--------------------------------------------------------------------------------
I had suprised my scripted mobs don't load with the last svn revision, so i tried each and founded the 3407 code block it.
So i modified it for works but can use the Serverproperty USE_MONO to activate or not using Mono.
WARN : If you activate USE_MONO, you can only use database for loading Mobs.
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: SVN Rev: 3559

Postby Graveen » Wed Oct 14, 2015 4:58 pm

Can't you define a new target instead of a SP ? it is more logical

Target: debug
Target: release
Target: mono

Then you can include/exclude code with preprocessor
Code: Select all
#if !MONO // My non-mono compliant code here #endif
You also have conditionnal method definition (but it seems not better in our case):
Code: Select all
[ Conditional("MONO")] private void MyStuff() { } [ Conditional("DEBUG")] private void MyStuff() { }
/cheer ;)
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: SVN Rev: 3559

Postby Graveen » Wed Oct 14, 2015 4:59 pm

.. and add mono target of course (and/or MONODEBUG, MONORELEASE)
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: SVN Rev: 3559

Postby Leodagan » Wed Oct 14, 2015 10:03 pm

I would rather check what is the real problem with mono here ?

We don't use such specific code that we can't find a solution for both Microsoft and Mono Runtime...

According to Hunabku fix it's more a "path discovery" problem rather than a mono problem

Removing the filter for "obj" subdirectory using a microsoft runtime is pretty much a wrong behavior !

Typically here I made a "IgnoreCase" Check for "Obj" or "obj" subdirectories to prevent matching pre-compiled object files, this could bring some problems using a Linux Filesystem which can handle case sensitive names...

HunabKu, could you explain how you stored your custom mobs objects for them not showing in game with previous code ?
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Rev: 3559

Postby HunabKu » Thu Oct 15, 2015 6:25 am

I sending you by pm an example.
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: SVN Rev: 3559

Postby Leodagan » Thu Oct 15, 2015 7:36 am

Well an example script will allow me to test this... (like 10 000 things I need to test...)

But I would like to have your experience with this trouble :)

How did you come with this patch ? Why did you keep previous behavior in case of "USE_MONO == 1" and made a new behavior for the "else case" where it should "not be mono" ?

In what directory are you custom script stored ? the code you change only filter some directory (not even files...) so your change must have something to do with colliding directories...

Did you test the missing Scripted NPC with Mono on Linux or other System ?
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Rev: 3559

Postby HunabKu » Thu Oct 15, 2015 8:06 am

I tested all svn revisions for finding what block scripted mobs to be launched.
I found the 3407 and up block it.
I juste patched for developpers can use scripted mobs if they want, like me.
I'm not an expert about mono .net implementation, so i can't works on.
Can you ?
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: SVN Rev: 3559

Postby Leodagan » Thu Oct 15, 2015 9:20 am

I'm not an expert in anything except reading docs :D

That means if we target what is the difference of Behavior between Mono and .NET I will find the specs of each implementation, read them, and come with some solution that works for both runtime :)

revision 3407 was just reverting the actual change you made...

And it's really a fix just about "directory" paths, so if you have any trouble it's with some path being filtered on some specific Runtime...

What is the names of your Game Server Scripts Directories ? Did you store some scripts in an "OBJ" directory ?
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Rev: 3559

Postby Leodagan » Thu Oct 15, 2015 10:18 am

Ok after talking with HunabKu, this is not something that breaks with Mono, but with .NET and Assuming the existing code was meant for "Mono"...

So this "Mono" Fix is probably not needed...

And I actually tried to reproduce HunabKu trouble and his example Mob is clearly showing on my setup with the "obj" filter !

So I'm pretty sure this is some platform oriented trouble, even if the directory filter is pretty lame :) (it can match obj, OBJ, Obj, oBj, ObJ... you got the point...)

I'll try to see with HunabKu how he triggered this
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” DOL SVN Commits

Who is online

Users browsing this forum: No registered users and 1 guest