-
[TUTORIAL] Restrict alt-codes from character names
This is also usefull i think:
it will create an function, that checks if the entered string contains only letters and numbers
First execute this to your DB
Code:
USE [GunzDB]
GO
/****** Object: UserDefinedFunction [dbo].[fnCheckString] Script Date: 11/21/2008 05:23:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fnCheckString](@P_String VARCHAR(500))
RETURNS BIT
AS
BEGIN
DECLARE @V_RetValue BIT
DECLARE @V_Position INT
SET @V_Position = 1
SET @V_RetValue = 0
WHILE @V_Position <= DATALENGTH(@P_String)
AND @V_RetValue = 0
BEGIN
IF ASCII(SUBSTRING(@P_String, @V_Position, 1))
BETWEEN 48 AND 122
SELECT @V_RetValue = 0
ELSE
SELECT @V_RetValue = 1
SET @V_Position = @V_Position + 1
END
RETURN @V_RetValue
END
After that execute this to edit the SpInsertchar stored procedure.
Code:
USE [GunzDB]
GO
/****** Object: StoredProcedure [dbo].[spInsertChar] Script Date: 11/21/2008 05:26:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Object: Stored Procedure dbo.spInsertChar Script Date: 5/10/2007 3:42:11 PM ******/
/* 캐릭터 추가 */
ALTER PROC [dbo].[spInsertChar]
@AID int,
@CharNum smallint,
@Name varchar(24),
@Sex tinyint,
@Hair int,
@Face int,
@Costume int
AS
SET NOCOUNT ON
BEGIN TRAN
IF EXISTS (SELECT CID FROM Character where (AID=@AID AND CharNum=@CharNum) OR (Name=@Name))
BEGIN
ROLLBACK TRAN
return(-1)
END
IF (SELECT dbo.fnCheckString(@Name) as Test)= 1
BEGIN
ROLLBACK TRAN
return (-1)
END
DECLARE @CharIdent int
DECLARE @ChestCIID int
DECLARE @LegsCIID int
DECLARE @MeleeCIID int
DECLARE @PrimaryCIID int
DECLARE @SecondaryCIID int
DECLARE @Custom1CIID int
DECLARE @Custom2CIID int
DECLARE @ChestItemID int
DECLARE @LegsItemID int
DECLARE @MeleeItemID int
DECLARE @PrimaryItemID int
DECLARE @SecondaryItemID int
DECLARE @Custom1ItemID int
DECLARE @Custom2ItemID int
SET @SecondaryCIID = NULL
SET @SecondaryItemID = NULL
SET @Custom1CIID = NULL
SET @Custom1ItemID = NULL
SET @Custom2CIID = NULL
SET @Custom2ItemID = NULL
INSERT INTO Character (AID, Name, CharNum, Level, Sex, Hair, Face, XP, BP, FR, CR, ER, WR,
GameCount, KillCount, DeathCount, RegDate, PlayTime, DeleteFlag)
Values (@AID, @Name, @CharNum, 1, @Sex, @Hair, @Face, 0, 0, 0, 0, 0, 0, 0, 0, 0, GETDATE(), 0, 0)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @CharIdent = @@IDENTITY
/* Melee */
SET @MeleeItemID =
CASE @Costume
WHEN 0 THEN 1
WHEN 1 THEN 2
WHEN 2 THEN 1
WHEN 3 THEN 2
WHEN 4 THEN 2
WHEN 5 THEN 1
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @MeleeItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @MeleeCIID = @@IDENTITY
/* Primary */
SET @PrimaryItemID =
CASE @Costume
WHEN 0 THEN 5001
WHEN 1 THEN 5002
WHEN 2 THEN 4005
WHEN 3 THEN 4001
WHEN 4 THEN 4002
WHEN 5 THEN 4006
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @PrimaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @PrimaryCIID = @@IDENTITY
/* Secondary */
IF @Costume = 0 OR @Costume = 2 BEGIN
SET @SecondaryItemID =
CASE @Costume
WHEN 0 THEN 4001
WHEN 1 THEN 0
WHEN 2 THEN 5001
WHEN 3 THEN 4006
WHEN 4 THEN 0
WHEN 5 THEN 4006
END
IF @SecondaryItemID <> 0 BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @SecondaryItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @SecondaryCIID = @@IDENTITY
END
END
SET @Custom1ItemID =
CASE @Costume
WHEN 0 THEN 30301
WHEN 1 THEN 30301
WHEN 2 THEN 30401
WHEN 3 THEN 30401
WHEN 4 THEN 30401
WHEN 5 THEN 30101
END
/* Custom1 */
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @Custom1ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @Custom1CIID = @@IDENTITY
/* Custom2 */
IF @Costume = 4 OR @Costume = 5
BEGIN
SET @Custom2ItemID =
CASE @Costume
WHEN 0 THEN 0
WHEN 1 THEN 0
WHEN 2 THEN 0
WHEN 3 THEN 0
WHEN 4 THEN 30001
WHEN 5 THEN 30001
END
IF @Custom2ItemID <> 0
BEGIN
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @Custom2ItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @Custom2CIID = @@IDENTITY
END
END
IF @Sex = 0 /* 남자일 경우 */
BEGIN
/* Chest */
SET @ChestItemID =
CASE @Costume
WHEN 0 THEN 21001
WHEN 1 THEN 21001
WHEN 2 THEN 21001
WHEN 3 THEN 21001
WHEN 4 THEN 21001
WHEN 5 THEN 21001
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @ChestCIID = @@IDENTITY
/* Legs */
SET @LegsItemID =
CASE @Costume
WHEN 0 THEN 23001
WHEN 1 THEN 23001
WHEN 2 THEN 23001
WHEN 3 THEN 23001
WHEN 4 THEN 23001
WHEN 5 THEN 23001
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @LegsCIID = @@IDENTITY
END
ELSE
BEGIN /* 여자일 경우 */
/* Chest */
SET @ChestItemID =
CASE @Costume
WHEN 0 THEN 21501
WHEN 1 THEN 21501
WHEN 2 THEN 21501
WHEN 3 THEN 21501
WHEN 4 THEN 21501
WHEN 5 THEN 21501
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @ChestItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @ChestCIID = @@IDENTITY
/* Legs */
SET @LegsItemID =
CASE @Costume
WHEN 0 THEN 23501
WHEN 1 THEN 23501
WHEN 2 THEN 23501
WHEN 3 THEN 23501
WHEN 4 THEN 23501
WHEN 5 THEN 23501
END
INSERT INTO CharacterItem (CID, ItemID) Values (@CharIdent, @LegsItemID)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN (-1)
END
SET @LegsCIID = @@IDENTITY
END
UPDATE Character
SET chest_slot = @ChestCIID, legs_slot = @LegsCIID, melee_slot = @MeleeCIID,
primary_slot = @PrimaryCIID, secondary_slot = @SecondaryCIID, custom1_slot = @Custom1CIID,
custom2_slot = @Custom2CIID,
chest_itemid = @ChestItemID, legs_itemid = @LegsItemID, melee_itemid = @MeleeItemID,
primary_itemid = @PrimaryItemID, secondary_itemid = @SecondaryItemID, custom1_itemid = @Custom1ItemID,
custom2_itemid = @Custom2ItemID
WHERE CID=@CharIdent
IF 0 = @@ROWCOUNT BEGIN
ROLLBACK TRAN
RETURN (-1)
END
COMMIT TRAN
Not that this is just an edited spInsertChar, if you have you own items/exp/bounty or what ever you need to change it youself.
Finally you got the an spInsertChar that only allow :
Code:
This key codes are allowed
0048 = 0 0049 = 1
0050 = 2 0051 = 3
0052 = 4 0053 = 5
0054 = 6 0055 = 7
0056 = 8 0057 = 9
0058 = : 0059 = ;
0060 = < 0061 = =
0062 = > 0063 = ?
0064 = @ 0065 = A
0066 = B 0067 = C
0068 = D 0069 = E
0070 = F 0071 = G
0072 = H 0073 = I
0074 = J 0075 = K
0076 = L 0077 = M
0078 = N 0079 = O
0080 = P 0081 = Q
0082 = R 0083 = S
0084 = T 0085 = U
0086 = V 0087 = W
0088 = X 0089 = Y
0090 = Z 0091 = [
0092 = \ 0093 = ]
0094 = ^ 0095 = _
0096 = ` 0097 = a
0098 = b 0099 = c
0100 = d 0101 = e
0102 = f 0103 = g
0104 = h 0105 = i
0106 = j 0107 = k
0108 = l 0109 = m
0110 = n 0111 = o
0112 = p 0113 = q
0114 = r 0115 = s
0116 = t 0117 = u
0118 = v 0119 = w
0120 = x 0121 = y
0122 = z
Thank me if you found this helpfull
-
Re: [TUTORIAL] Restrict alt-codes from character names
Ty! But if people still use something which is restricted it still gets created but then as NULL?
-
Re: [TUTORIAL] Restrict alt-codes from character names
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
Mambo
Ty! But if people still use something which is restricted it still gets created but then as NULL?
DELETE FROM Character WHERE Name = '';
-
Re: [TUTORIAL] Restrict alt-codes from character names
-
Re: [TUTORIAL] Restrict alt-codes from character names
-
Re: [TUTORIAL] Restrict alt-codes from character names
-
Re: [TUTORIAL] Restrict alt-codes from character names
-
Re: [TUTORIAL] Restrict alt-codes from character names
I will update the function, soon, the make it better and add an way to allow or disallow some characters.
-
Re: [TUTORIAL] Restrict alt-codes from character names
awesome tutorial Rotana :D
-
Re: [TUTORIAL] Restrict alt-codes from character names
Thanks Rotana, Your rule :).
-
Re: [TUTORIAL] Restrict alt-codes from character names
-
Re: [TUTORIAL] Restrict alt-codes from character names
wow its hard so many codes
-
Re: [TUTORIAL] Restrict alt-codes from character names
Why does anyone want to restrict it? It makes your name look cool
-
Re: [TUTORIAL] Restrict alt-codes from character names
Offtopic: Why in every thread I see you in, NIRVANAdylan, do you either always go directly against the thread, have to prove someone wrong, or gloat about something that you know?
-
Re: [TUTORIAL] Restrict alt-codes from character names
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
ThievingSix
Offtopic: Why in every thread I see you in, NIRVANAdylan, do you either always go directly against the thread, have to prove someone wrong, or gloat about something that you know?
Because most of the stuff which gets released here, is actually useless stuff, Not saying this is completely useless, but there's more bigger things people have to worry about in their servers, not just restricting people from the creativity involving their username. There's bigger things that need addressing, e.g. stopping hackers from hurting gaming communities.
-
Re: [TUTORIAL] Restrict alt-codes from character names
thx i was waiting for that
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
NIRVANAdylan
Because most of the stuff which gets released here, is actually useless stuff, Not saying this is completely useless, but there's more bigger things people have to worry about in their servers, not just restricting people from the creativity involving their username. There's bigger things that need addressing, e.g. stopping hackers from hurting gaming communities.
The stuff you find here are customisations for gunz servers. If you like it you use it. That's basicly it. If you dont have anything useless to say, just say nothing.
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
CobraCom
The stuff you find here are customisations for gunz servers. If you like it you use it. That's basicly it. If you dont have anything useless to say, just say nothing.
I hope you mean useFULL and not useLESS
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
NIRVANAdylan
Because most of the stuff which gets released here, is actually useless stuff, Not saying this is completely useless, but there's more bigger things people have to worry about in their servers, not just restricting people from the creativity involving their username. There's bigger things that need addressing, e.g. stopping hackers from hurting gaming communities.
I know that you can create characters with multi-line names, and I believe this stops it, so it does have a use, asides from stopping so-called "creativity."
-
Re: [TUTORIAL] Restrict alt-codes from character names
This can also be done by editing the system.mrs -> abuse.txt
Just add all known alt-codes to it...
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
mcsic
This can also be done by editing the system.mrs -> abuse.txt
Just add all known alt-codes to it...
yes but the abuse.txt can easily be edited if your files are not encrypted.
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
wesman2232
yes but the abuse.txt can easily be edited if your files are not encrypted.
+ a simple dll cracks this!
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
NIRVANAdylan
Because most of the stuff which gets released here, is actually useless stuff, Not saying this is completely useless, but there's more bigger things people have to worry about in their servers, not just restricting people from the creativity involving their username. There's bigger things that need addressing, e.g. stopping hackers from hurting gaming communities.
1) Alt Codes in names are annoying, and makes it harder to ban hackers.
2) Very few are able to make an antihack.
3) You will never be able to block hackers completely.
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
Mr.Lucifer
1) Alt Codes in names are annoying, and makes it harder to ban hackers.
2) Very few are able to make an antihack.
3) You will never be able to block hackers completely.
We know this!, but this blocks alt codes!, maybe not all, there are hundreds atl codes, but it is even better without it.:)
-
Re: [TUTORIAL] Restrict alt-codes from character names
Uhh, yes this blocks all(I think, I didn't look at the procedure). Instead of blocking them, it only allows A..Z,a..z,0..9,-,_
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
ThievingSix
Uhh, yes this blocks all(I think, I didn't look at the procedure). Instead of blocking them, it only allows A..Z,a..z,0..9,-,_
This key codes are allowed
Code:
0048 = 0 0049 = 1
0050 = 2 0051 = 3
0052 = 4 0053 = 5
0054 = 6 0055 = 7
0056 = 8 0057 = 9
0058 = : 0059 = ;
0060 = < 0061 = =
0062 = > 0063 = ?
0064 = @ 0065 = A
0066 = B 0067 = C
0068 = D 0069 = E
0070 = F 0071 = G
0072 = H 0073 = I
0074 = J 0075 = K
0076 = L 0077 = M
0078 = N 0079 = O
0080 = P 0081 = Q
0082 = R 0083 = S
0084 = T 0085 = U
0086 = V 0087 = W
0088 = X 0089 = Y
0090 = Z 0091 = [
0092 = \ 0093 = ]
0094 = ^ 0095 = _
0096 = ` 0097 = a
0098 = b 0099 = c
0100 = d 0101 = e
0102 = f 0103 = g
0104 = h 0105 = i
0106 = j 0107 = k
0108 = l 0109 = m
0110 = n 0111 = o
0112 = p 0113 = q
0114 = r 0115 = s
0116 = t 0117 = u
0118 = v 0119 = w
0120 = x 0121 = y
0122 = z
-
Re: [TUTORIAL] Restrict alt-codes from character names
0094 = ^
0063 = ?
:P i would block those.
-
Re: [TUTORIAL] Restrict alt-codes from character names
this may sound a bit noobish but what part of the 2 srcipts stop them
-
Re: [TUTORIAL] Restrict alt-codes from character names
omg this is nice for [g]osu but i dont need this great job rotana!
-
Re: [TUTORIAL] Restrict alt-codes from character names
Could you tell us how to disable individual ASCII characters?
Example: ^, ? and space (ASCII 032).
-
Re: [TUTORIAL] Restrict alt-codes from character names
i already new this but never got a chance to release it , thanks anyways.
-
Re: [TUTORIAL] Restrict alt-codes from character names
Why dont u make one code for block ^ Things so the hackers cant make nick color :P
Nice idea hmm?
-
Re: [TUTORIAL] Restrict alt-codes from character names
Quote:
Originally Posted by
Kyuma
Why dont u make one code for block ^ Things so the hackers cant make nick color :P
Nice idea hmm?
http://forum.ragezone.com/f311/datab...or-sign-546762
You can speak loudly..
-
Re: [TUTORIAL] Restrict alt-codes from character names
:| hope someone release that xD
-
Re: [TUTORIAL] Restrict alt-codes from character names
nice tut but i done all it worked fine but the last one sais incorrect systax from the key word "key" could somone please tell me how to correct it?
-
Re: [TUTORIAL] Restrict alt-codes from character names
Where can I find the "admin" restriction? Because It won't let me use that name.
-
Re: [TUTORIAL] Restrict alt-codes from character names
Thanks system, saved me some time =)
Thanked you
Ooh also how can I make it some up with the disallowed character message, ATM it just makes it do nothing :p
-
Re: [TUTORIAL] Restrict alt-codes from character names
Good job works like a charm 10/10.
-
Re: [TUTORIAL] Restrict alt-codes from character names
How can I use this function to restrict alt-codes from clan names?
-
Re: [TUTORIAL] Restrict alt-codes from character names
execute it in a sql Query
-
Re: [TUTORIAL] Restrict alt-codes from character names
If i execute this, it will restrict alte-Codes only from character creation, I tried to use the function editing SpCreateClan but fails.
-
Re: [TUTORIAL] Restrict alt-codes from character names
Rotane where is the "dbo.fnCheckString" located at? because When i EXECUTE the codes there it shows me this error.
"Msg 2714, Level 16, State 3, Procedure fnCheckString, Line 41
Já existe um objeto com nome 'fnCheckString' no banco de dados."
What do i do? Thanks
-
Re: [TUTORIAL] Restrict alt-codes from character names
Same problem cant find dbo.fnCheckString
-
Re: [TUTORIAL] Restrict alt-codes from character names