Felladrin submitted a new resource:

Unique Character Names - Ensures that no player character has the same name as another.

Unique Character Names

This is a plug&play script that grants every player character have a unique name. The verification is made on character login, and if the name is already in use, the character is renamed to 'Generic Player' and a gump is displayed asking for a new name.

View attachment 4902

The system checks the account creation date to see who took the name before. So the first who used the name won't be asked to change it.

To install, just drop...

Read more about this resource...
 
I remember there being one issue with this in the past. Someone put a fix but I can not seem to find it.

The issue is = any staff named, example GM Tasanar will be prompted on login to change their name as it is invalid. Maybe a check to ignore any accesslevel above player?
 
Is it possible, without edits to anything else, to make it so when this gump is open it freezes you in place until it is closed?
 
I love this system and use it to enforce a unique name society!

Found a HUGE BUG though.

Log in with a double name or unacceptable name.

Click Okay right away WITH OUT TYPING IN A NEW NAME

You are now known as "" (no name at all)

The second you log out the server will then delete your character since you do not have a name.
[doublepost=1469566055][/doublepost]I have re-uploaded with the fix to prevent this for those who use this. Or you can add the simple change yourself.

Code:
if (HasValidName(m))
          {
                 m.SendMessage(66, "Your name has been changed! You are now known as '{0}'.", m.RawName);
          }

Find that and add && m.RawName != ""

So it looks like this

Code:
if (HasValidName(m) && m.RawName != "")
          {
              m.SendMessage(66, "Your name has been changed! You are now known as '{0}'.", m.RawName);
          }
 

Attachments

  • UniqueCharacterNames.cs
    4 KB · Views: 29
Last edited:
Another bug I found with this is

Code:
 foreach (Mobile otherPlayer in World.Mobiles.Values)
                if (otherPlayer is PlayerMobile && otherPlayer != m && otherPlayer.RawName != null && m.RawName != null && otherPlayer.RawName.ToLower() == m.RawName.ToLower() && m.CreationTime > otherPlayer.CreationTime)
                    return false;

The problem lies in

Code:
m.CreationTime > otherPlayer.CreationTime

A player creates a character early on but for whatever reason gets stuck with the "Generic Player" name. He now returns years later, he can pick any name he wants since his creation time was before the other players, regardless of who had the name first.

If I simply remove the

Code:
m.CreationTime > otherPlayer.CreationTime

Since I have had this operating since day one, this should remove said issue, correct? Thanks for any insight.
 
I was wondering if anyone using this could read my top post and let me know. I usually do not bump but have waited about 5 months on this one! :)
 
Another bug I found with this is

Code:
 foreach (Mobile otherPlayer in World.Mobiles.Values)
                if (otherPlayer is PlayerMobile && otherPlayer != m && otherPlayer.RawName != null && m.RawName != null && otherPlayer.RawName.ToLower() == m.RawName.ToLower() && m.CreationTime > otherPlayer.CreationTime)
                    return false;

The problem lies in

Code:
m.CreationTime > otherPlayer.CreationTime

A player creates a character early on but for whatever reason gets stuck with the "Generic Player" name. He now returns years later, he can pick any name he wants since his creation time was before the other players, regardless of who had the name first.

If I simply remove the

Code:
m.CreationTime > otherPlayer.CreationTime

Since I have had this operating since day one, this should remove said issue, correct? Thanks for any insight.


But if he had the name first. No one else should be allowed to make their name to his.



Side note: for anyone using this you should change the gump to not letting it close. Its set to true right now so players could essentially always have the name Generic Player by just canceling the gump every time they login.
 
But if he had the name first. No one else should be allowed to make their name to his.



Side note: for anyone using this you should change the gump to not letting it close. Its set to true right now so players could essentially always have the name Generic Player by just canceling the gump every time they login.


No, it is looking for character creation time.

Say you made a character day 1 but the name was taken so it named you "generic player".

Another player logs in day 2 and names himself BOB.

You log in again on day 10, since you are generic player you get the name change gump again.

You pick BOB. It checks and sees your character was created before his, which in theory it was and now you become BOB and on his next login he losses it.
 
That is the flaw. Since I have been running this since the very first start of going public on my shard, I simply removed the part I pointed out about creation time.
 
It might work. dunno never tested it. U could just test it on a test server. And if it doesn't work properly you could just write a second check again without the creation time check in it.
 
Back