Page 1 of 1
SVN Rev: 3559
PostPosted: Tue Oct 13, 2015 12:23 pm
by HunabKu
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.
Re: SVN Rev: 3559
PostPosted: Wed Oct 14, 2015 4:58 pm
by Graveen
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
Re: SVN Rev: 3559
PostPosted: Wed Oct 14, 2015 4:59 pm
by Graveen
.. and add mono target of course (and/or MONODEBUG, MONORELEASE)
Re: SVN Rev: 3559
PostPosted: Wed Oct 14, 2015 10:03 pm
by Leodagan
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 ?
Re: SVN Rev: 3559
PostPosted: Thu Oct 15, 2015 6:25 am
by HunabKu
I sending you by pm an example.
Re: SVN Rev: 3559
PostPosted: Thu Oct 15, 2015 7:36 am
by Leodagan
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 ?
Re: SVN Rev: 3559
PostPosted: Thu Oct 15, 2015 8:06 am
by HunabKu
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 ?
Re: SVN Rev: 3559
PostPosted: Thu Oct 15, 2015 9:20 am
by Leodagan
I'm not an expert in anything except reading docs
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 ?
Re: SVN Rev: 3559
PostPosted: Thu Oct 15, 2015 10:18 am
by Leodagan
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