RR11 to RR13 Name Fix

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

RR11 to RR13 Name Fix

Postby Crazys » Fri Sep 12, 2014 4:19 pm

Bug Reported
http://www.dolserver.net/viewtopic.php?f=64&t=22075

Changes Gender in game player to PlayerGender ( was not recognizing correctly in references).
Corrected locations in GamePlayer to call PlayerGender to use eGender types.
Corrected prior name handling again
Corrected RR Title and added in RR13 Title.
Corrected RR13 Hib Names
Tested on current server.
Attachments
RR11toRR13NamePatch.patch
(24.26 KiB) Downloaded 41 times
Crazys
Contributor
 
Posts: 346
Joined: Tue Nov 07, 2006 10:18 pm

Re: RR11 to RR13 Name Fix

Postby Leodagan » Mon Sep 15, 2014 6:58 am

I've read it and it looks good :)

You removed some silly reference to DBCharacter, that's good, a GameObject may have reference to their DBObject creating them but it shouldn't be needed for such display (imagine you would like to script a player bot, with these kind of references the GamePlayer is not enough "standalone")

But You shouldn't change an Object Public Property Name that lightly, this doesn't look it will do what you expect !

Removing public override of Gender will prevent most of script for using the correct GamePlayer Gender (like when NPCs talk to you !) I didn't trace your code to see if the base.Gender is set from other loading method or constructors, but that seem wrong anyway !

Gender is not only the Player property but a GameLiving property, it must provide game interface expecting Gender to be set with a correct value !

A good improvement apart from that would be to exclude all "Gender" Logic for title out of the GamePlayer Class, maybe making an extension Class ?
Well that's optional, I'm a bit annoyed by the size of some basic class like GameLiving, GameNPC, GamePlayer, but it's not a priority ;)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: RR11 to RR13 Name Fix

Postby Tolakram » Mon Sep 15, 2014 12:28 pm

Specifically:

public override eGender Gender
+ public eGender PlayerGender

Why remove the override? Why does Player need a specific Gender method.

And a big pet peeve of mine. Why did you not make this virtual? If I needed to use this in D2 I would have to modify the core to virtualize this so I could override in my version.

It's not horrible or anything, just needs a few tweaks. :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: RR11 to RR13 Name Fix

Postby Crazys » Mon Sep 15, 2014 1:16 pm

Specifically:

public override eGender Gender
+ public eGender PlayerGender

Why remove the override? Why does Player need a specific Gender method.

And a big pet peeve of mine. Why did you not make this virtual? If I needed to use this in D2 I would have to modify the core to virtualize this so I could override in my version.

It's not horrible or anything, just needs a few tweaks. :)
Still getting a grasp on all the handling of virtual vs override vs none
I switched it from an override to its own name because I kept getting bleeding issues into lower levels and db levels for gender that was giving me incorrect values. When swapping over to PlayerGender it all synced up nicely.
I'll probably take a 2nd look into this once the rest of the bugs calm down to see why it was bleeding. May need to change a few values in the DB handling to get rid of gender and make it like m_gender possibly stop the bleeding.
Crazys
Contributor
 
Posts: 346
Joined: Tue Nov 07, 2006 10:18 pm


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest