I would like to limit charcter names but I don't know how to do that.
Rules:
-min 3 chars
-no !@#$%^&*()_.<>:; and stuff like that
-no other custom stuff just the alphanumeric
Here is my procedure:
SET @char_name = RTRIM(@char_name)
DECLARE @char_id int
SET @char_id = 0
-- debug code delete in commercial
IF (GETDATE() < '2004-1-1')
SET @builder = 1
IF @char_name LIKE N' '
BEGIN
RAISERROR ('Character name has space : name = [%s]', 16, 1, @char_name)
RETURN -1
END
-- check user_prohibit
if exists(select char_name from user_prohibit (nolock) where char_name = @char_name)
begin
RAISERROR ('Character name is prohibited: name = [%s]', 16, 1, @char_name)
RETURN -1
end
declare @user_prohibit_word nvarchar(20)
select top 1 @user_prohibit_word = words from user_prohibit_word (nolock) where PATINDEX('%' + words + '%', @char_name) > 0
if @user_prohibit_word is not null
begin
RAISERROR ('Character name has prohibited word: name = [%s], word[%s]', 16, 1, @char_name, @user_prohibit_word)
RETURN -1
end
-- check reserved name
declare @reserved_name nvarchar(50)
declare @reserved_account_id int
select top 1 @reserved_name = char_name, @reserved_account_id = account_id from user_name_reserved (nolock) where used = 0 and char_name = @char_name
if not @reserved_name is null
begin
if not @reserved_account_id = @account_id
begin
RAISERROR ('Character name is reserved by other player: name = [%s]', 16, 1, @char_name)
RETURN -1
end
end
sorry for my bad english, I hope you understand me
Based on all your comments, I realized that you are a complete beginner who doesn't understand anything about programming or even the basic concepts of the Java language.
Go study, gain some basic knowledge about the subject, and after you've studied and acquired at least a minimal understanding, you can come back here and ask for clarifications, and I’ll help you with all your questions. 🤣🤣🤣🤣
@Möbius
You should start a comedy show on television, you're very funny, and for those who know your face as well as I do, I can say you'd make a great clown.
The more you try to explain yourself and claim you're the god of L2j, actually, I believe you think of yourself as this god of L2j, but you forget that in this world, there are many programmers better than you who don't engage in fraudulent scams against people.
just like you are doing
Question
koziolekl
Hello
I would like to limit charcter names but I don't know how to do that.
Rules:
-min 3 chars
-no !@#$%^&*()_.<>:; and stuff like that
-no other custom stuff just the alphanumeric
Here is my procedure:
sorry for my bad english, I hope you understand me
2 answers to this question
Recommended Posts