Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 09-15-2004, 04:10 PM   #1 (permalink)
Forum Novice
 
Join Date: Jul 2003
Posts: 111
Talking NameChangeDeed

Today, one of my player page me say the NameChangeDeed didn't work. So, I look in to the code. Then I found ..................................................

Ok, Anyway, before my player crying for lots token weast (hmmm, because .......you know. ) , I am try to complete this NameChangeDeed.

Install :

Just replace your exist NameChangeDeed.cs come from clean RunUO 1.0RC0 build. (Better backup it, before you do this).

Have Fun !!!

PS: This version support English and Traditional Chinese prompt. You can extend it to support more language very easy.



== Update 01 =============
Add some check (very few, but ...... better then not thing)..
just replace exist file.
Attached Files
File Type: cs NameChangeDeed.cs (3.4 KB, 67 views)
lincy is offline   Reply With Quote
Old 09-16-2004, 07:37 AM   #2 (permalink)
 
Join Date: Feb 2003
Posts: 44
Default

hmm, you're not checking at all the name content, and wether or not it's allowed (containing forbidden strings and stuff like that), basicaly a player could rename to "GM xxx" i think. and maybe do some even nastier things.
- dont know if it's needed or not, but you're not checking the length of the name either.
i'm not home so i can't access my scripts. but if u need i can give a quick fix later.
chro is offline   Reply With Quote
Old 09-16-2004, 07:55 AM   #3 (permalink)
 
Join Date: Oct 2003
Location: Ankara / Turkey
Age: 42
Posts: 125
Default

Hi, to add some controls for name change, I try like this.

Quote:
using System;
using Server.Network;
using Server.Prompts;
using Server.Mobiles;
using Server.Misc;
using Server.Items;

namespace Server.Items
{
public class NameChangeDeed : Item
{

[Constructable]
public NameChangeDeed() : base( 0x14F0 )
{
base.Weight = 1.0;
base.Name = "a name change deed";
}

public NameChangeDeed( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

writer.Write( (int) 0 ); // version
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );

int version = reader.ReadInt();
}

public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
from.SendMessage( "Enter your desired name." );
from.Prompt = new RenamePrompt( from );
this.Delete();
}
}

private class RenamePrompt : Prompt
{
private Mobile m_from;

public RenamePrompt( Mobile from )
{
m_from = from;
}

public override void OnResponse( Mobile from, string text )
{
text = text.Trim();
if ( !NameVerification.Validate( text, 3, 16, true, false, true, 0, NameVerification.SpaceDashPeriodQuote ) ) return;

from.Name = text;
from.SendMessage( "You will be hence forth known as {0}", text );
}
}
}
}
WebSiter is offline   Reply With Quote
Old 09-16-2004, 02:42 PM   #4 (permalink)
Forum Novice
 
Join Date: Jul 2003
Posts: 111
Default

Quote:
Originally Posted by chro
hmm, you're not checking at all the name content, and wether or not it's allowed (containing forbidden strings and stuff like that), basicaly a player could rename to "GM xxx" i think. and maybe do some even nastier things.
- dont know if it's needed or not, but you're not checking the length of the name either.
i'm not home so i can't access my scripts. but if u need i can give a quick fix later.
well, I don't care what player will change their name. But, yes, you are right. Do more some name check was an good way.

PS:because all my player are local player. so...... they only use very sample name. ex. NBA, NOKIA, NEC, SONY, CAR, GO GO GO ,I am newbid, Yahoo, Julia, David..... heeee
lincy is offline   Reply With Quote
Old 09-16-2004, 03:31 PM   #5 (permalink)
 
Join Date: Feb 2003
Posts: 44
Default

Quote:
Originally Posted by lincy
well, I don't care what player will change their name. But, yes, you are right. Do more some name check was an good way.

PS:because all my player are local player. so...... they only use very sample name. ex. NBA, NOKIA, NEC, SONY, CAR, GO GO GO ,I am newbid, Yahoo, Julia, David..... heeee
hehe ok well so u don't realy need that i guess, but as it's posted here, u never know who'll take u script and use it and then get prety mad because of the abuses
chro is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5