RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

script to disallow duplicate character names

Malaperth

Wanderer
script to disallow duplicate character names

I have made a script that will not allow duplicate character names.

Unfortunately, the call to my code must be placed in a very unintuitive spot.

I tried placing checking code in many places in CharacterCreation.cs, but when I placed it above the WelcomeTimer call, I either got a NullReferenceException or the prompt never showed to the player at all.

I have placed the reference to my code in WelcomeTimer.cs.

If someone can get it to work in a sensible place, I would appreciate letting me know where and how it works.

The archive contains a copy of my script (which has instructions in the header) and a sample WelcomeTimer.cs.
 

Attachments

  • CheckDupeCharName.zip
    2.2 KB · Views: 253

Dawn

Wanderer
Ok I tried it and think again that a list of disallowed names would be a good idea because I could change my name with this script to a name that is disallowed in the NameVerification.cs

Furthermore a list of names where duplicates are allowed would be great, too.

But nevertheless this is a good script and I will use it for my shard with some modification in it. Ty
 

Malaperth

Wanderer
I can't be sure, but it would seem to me that there is something amiss in NameVerification.cs. I call that script exactly like it is called in many other places in RunUO. I did not try all the names in the disallowed list, but the few biggies that I did try were caught and not allowed. However, I have not looked through all accounts.

If you make any modifications that you think would be useful to others, please post the script. Sharing is good :)
 

A_Li_N

Knight
Nice idea. And since you said share your mods, I took the liberty of moding it. Here's my take on it.

This supports a list of disallowed names (prety much a custom name verification) and also an 'allowed dupe' list.

No distro mods needed, although it'll check each time a player logs in. I might try to optimize it in a couple days.
 

Attachments

  • NameCheck.zip
    980 bytes · Views: 204

hollysong

Wanderer
this script is so pretty but there was a bug accept the numbers(1234567 etc.) at names i cant test all of the characters (%&+^! etc.) but cant accept the different languages chars (İşüğçö etc.). good works.

thanx for good jobs.
 

A_Li_N

Knight
hollysong said:
this script is so pretty but there was a bug accept the numbers(1234567 etc.) at names i cant test all of the characters (%&+^! etc.) but cant accept the different languages chars (İşüğçö etc.). good works.

thanx for good jobs.
Interesting...the NameVerification should catch numbers. I'll look and see what's up in a few.
 

arul

Sorceror
Use RawName property instead of Name, because Name changes when player casts incognito and someone might exploit it..
 

A_Li_N

Knight
hollysong said:
this script is so pretty but there was a bug accept the numbers(1234567 etc.) at names i cant test all of the characters (%&+^! etc.) but cant accept the different languages chars (İşüğçö etc.). good works.

thanx for good jobs.
CharacterCreation (distro)
Code:
if ( !NameVerification.Validate( name, 2, 16, true, true, true, 1, NameVerification.SpaceDashPeriodQuote ) )
NameCheck
Code:
if( !NameVerification.Validate( name, 2, 16, true, true, true, 1, NameVerification.SpaceDashPeriodQuote ) )
NameVerification
Code:
public static bool Validate( string name, int minLength, int maxLength, bool allowLetters, bool allowDigits, bool noExceptionsAtStart, int maxExceptions, char[] exceptions )

As you can see, you can use letters and digits for names at startup (at least according to NameVerification)

*Updated to use RawName instead of Name*
 

hollysong

Wanderer
i said there was a bug in the "dupe name checker" script not in the base runuo scripts (a little cominication problem :D ) i will try combine "dupe name checker" and "name verification" if i can succes i think i made a good work :) thanks for your helps and comments :)
 

A_Li_N

Knight
hollysong said:
i said there was a bug in the "dupe name checker" script not in the base runuo scripts (a little cominication problem :D ) i will try combine "dupe name checker" and "name verification" if i can succes i think i made a good work :) thanks for your helps and comments :)
Oh, so if someone has the name of 1234, and someone else types that in, it'll let them have the name as well?
 

DevXLX

Sorceror
Alin, how does it work exactly?
If a new player picks a name which is already taken on the server, does he become "Generic" player instead by default?
And if so, is there an easy way he can get a new rename, without contacting staff. ?
 

A_Li_N

Knight
DevXLX said:
Alin, how does it work exactly?
If a new player picks a name which is already taken on the server, does he become "Generic" player instead by default?
And if so, is there an easy way he can get a new rename, without contacting staff. ?
If a new player chooses a name that is already taken or dissallowed, they will be prompted to change their name.
If they log out or whatnot, trying to get around it, it will set their name to Generic Player (I believe) and it'll then check again when they log in.
 
Top