Jump to content

[alt.patch in 7166] Minor Tweak: game/ObjectMgr.h


Guest jpmythic

Recommended Posts

This makes the IsReservedName() call work better as it currently will ONLY match exact...

Which means if you have a ReservedName of [ admin ] , only attempts at using ( admin )

will flag it, any other values like: (Admin , ADMIN, aDmin, etc.. ) will not flag up with current implementation..

       bool IsReservedName(const std::string& name) const
       {
            std::string tempStr;
        tempStr.assign(name);
       std::transform(tempStr.begin(), tempStr.end(), tempStr.begin(), tolower);
              return m_ReservedNames.find(tempStr) != m_ReservedNames.end();
       }

Really a simple fix, convert em all to LowerCase, and ONLY enter values in the DB in lowercase

Thus ANY attempt to use a ReservedName is caught...

Sheesh :D

Of course you could always get really fancy and do a Comparision with it checking if the ReservedName

is Within the name being checked, thus MrAdmin would flag on [ admin ] as being reserved...

I'll leave that excersise to you to work out :cool:

Link to comment
Share on other sites

function used not only for player names,

but also for pet names and charter guild names

player names always before this function call converted in form "Name"

pet and charter not converted.

But patch incorrect: name is utf8 string and like code will only work with latin1 symbols

[added]In [7166] i add version with proper utf8 support base at your original idea.

Link to comment
Share on other sites

  • 3 months later...

Yep, very complex system, I spotted that later (utf8)

just hadnt gotten back to this post yet.

Glad it was sorted with utf8.

I had spotted the bit about pet and guild names

(Which is why i did this), just forgot to mention this.

The whole reason I ended up looking at it was for an Additional

little feature of a Guild Rename Deed and I didnt want screwed up names on the system.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use