Error protection and log for Procs

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

Error protection and log for Procs

Postby elcotek » Thu Mar 24, 2016 1:22 am

Hello,

i can't say if this work with the dol source, but i spend a little protection off errors and resulting laags for dol, if an proc spells is on an item but no spell is exist and to find items with his wrong proc spells in your Logs.

after this line in GameLiving;
Code: Select all
// Proc chance is 2.5% per SPD, i.e. 10% for a 3.5 SPD weapon. - Tolakram, changed average speed to 3.5 int procChance = (int)Math.Ceiling(((weapon.ProcChance > 0 ? weapon.ProcChance : 10) * (weapon.SPD_ABS / 35.0)));

Code: Select all
//Error protection and log for Item Proc's Spell procSpell = null; Spell procSpell1 = null; if (this is GamePlayer) { SpellLine line = SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects); if (line != null) { procSpell = SkillBase.FindSpell(weapon.ProcSpellID, line); procSpell1 = SkillBase.FindSpell(weapon.ProcSpellID1, line); if (procSpell == null && weapon.ProcSpellID != 0) { log.Error("- Proc Not Found: " + weapon.ProcSpellID + " " + weapon.Name); } if (procSpell1 == null && weapon.ProcSpellID1 != 0) { log.Error("- Proc1 Not Found: " + weapon.ProcSpellID1 + " " + weapon.Name); } } } // Proc #1 if (procSpell != null && Util.Chance(procChance)) StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), procSpell.ID, false); // Proc #2 if (procSpell1 != null && Util.Chance(procChance)) StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), procSpell1.ID, false);
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Error protection and log for Procs

Postby HunabKu » Thu Mar 24, 2016 7:12 am

Sounds really interesting Elcotek, thanks.
"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: Error protection and log for Procs

Postby elcotek » Thu Mar 24, 2016 3:20 pm

Short Update after test,

please use:
Code: Select all
StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), weapon.ProcSpellID, false); StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), weapon.ProcSpellID1, false);
or you have some errors with Astral proc's:)
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Error protection and log for Procs

Postby HunabKu » Fri Mar 25, 2016 7:24 am

Nice.
Do you do more test or code is ready for commit ?
"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: Error protection and log for Procs

Postby elcotek » Fri Mar 25, 2016 11:37 am

I have this code active on my server, it works atm.
I can create a patch for dol and post here if you whish:)
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Error protection and log for Procs

Postby elcotek » Fri Mar 25, 2016 11:55 am

oki here is the patch for the actual dol source.
Attachments
Error protection and log for Item Proc's.patch
is what the name say.
(2.29 KiB) Downloaded 25 times
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Error protection and log for Procs

Postby Graveen » Fri Mar 25, 2016 9:02 pm

Please use pull request now. Thank you Elcotek. Can you make this PR on your side ? :)

/worship
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: Error protection and log for Procs

Postby elcotek » Sat Mar 26, 2016 9:40 am

I have an Source Forge Account but they say me Authentication are faild, (No more credentials or we tried too many times.), i use TortoiseSVN 1.9.3.2703 to commit, but dont work. :(

I have now created an GitHub Account, but near same result (coult not begin a transaction). :(
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Error protection and log for Procs

Postby HunabKu » Sat Mar 26, 2016 10:53 am

Graveen or Leo need to active your account before. Send them your github account.
"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: Error protection and log for Procs

Postby elcotek » Sat Mar 26, 2016 12:16 pm

I will do, thank you. :)
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: Error protection and log for Procs

Postby Leodagan » Sun Mar 27, 2016 5:27 pm

Code was committed through Github pull request, with some reviews and an automated build ;)

https://github.com/Dawn-of-Light/DOLSharp/pull/10

Github contributions don't need any activation from Graveen or me, you can publish any pull request through github workflow, final merge is up to me or Graveen for now...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Error protection and log for Procs

Postby HunabKu » Mon Mar 28, 2016 11:39 am

Okai better and nice system ;)
"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


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest