How Do i Restrict Atl-Codes From Charater Names and Makeing.

Page 2 of 2 FirstFirst 12
Results 26 to 41 of 41
  1. #26
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by Mambo View Post
    Useless post.. i'm not that stupid that i dont know that.. i'm just asking in which stored procedure..

    SpInserChar?
    Sorry, you said "Where in that table" but i readed "where is that table" ^^. Is at spInsertChar, take a little look at my command:



    Where @Name is my name variable
    altcodehere is the alt code you wanna block

    It gives no error when creating the char, but the char is not created.

  2. #27
    Reverse Engineer ThievingSix is offline
    MemberRank
    Mar 2007 Join Date
    CaliforniaLocation
    901Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    YAY Someone actually took the time to learn how to do it without complaining.

  3. #28
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by ThievingSix View Post
    YAY Someone actually took the time to learn how to do it without complaining.
    lol, i could have done it myself but i was away for the weekend, just now checking all the new messages in RZ

  4. #29
    WowIwasSuperCringeB4 XZeenon is offline
    MemberRank
    Jun 2008 Join Date
    CanadaLocation
    1,405Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    "Applauses for cerealnp" ... Finally someone also get's it. Aha, You can also block other things in char names that offend other users etc.

  5. #30
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by ThievingSix View Post
    YAY Someone actually took the time to learn how to do it without complaining.
    Thx =D, But ive already noticed that it has a bug. It creates a character on the database with a null name.

  6. #31
    RestyleGamerZ FTW Mambo is offline
    MemberRank
    Mar 2008 Join Date
    The NetherlandsLocation
    821Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by cerealnp View Post
    Sorry, you said "Where in that table" but i readed "where is that table" ^^. Is at spInsertChar, take a little look at my command:



    Where @Name is my name variable
    altcodehere is the alt code you wanna block

    It gives no error when creating the char, but the char is not created.
    Sorry for flaming you without reason.. well a lil one.. I was a bit pissed off that day

  7. #32
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by Mambo View Post
    Sorry for flaming you without reason.. well a lil one.. I was a bit pissed off that day
    That's no reason indeed.

  8. #33
    RestyleGamerZ FTW Mambo is offline
    MemberRank
    Mar 2008 Join Date
    The NetherlandsLocation
    821Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by Wizkidje View Post
    That's no reason indeed.
    He read my post wrong :P

  9. #34
    Apprentice Applique is offline
    MemberRank
    Nov 2008 Join Date
    Fort Drum, New YorkLocation
    11Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Easiest way is to create a script in the stored procs which returns a fault when any character besides A-Z a-z or 0-9 is put in. It's a lot less work than coming up with every single alt code imaginable.

  10. #35
    Sultan of Yolo Demantor is offline
    MemberRank
    May 2008 Join Date
    GermanyLocation
    1,266Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by cerealnp View Post
    Thx =D, But ive already noticed that it has a bug. It creates a character on the database with a null name.
    ...anyway, thx,,, can not it be so that it creates the charac ter in the deleted character name with his altcodes?
    Quote Originally Posted by Applique View Post
    Easiest way is to create a script in the stored procs which returns a fault when any character besides A-Z a-z or 0-9 is put in. It's a lot less work than coming up with every single alt code imaginable.
    ..how is this ?

  11. #36
    Account Upgraded | Title Enabled! cerealnp is offline
    MemberRank
    Apr 2006 Join Date
    BrazilLocation
    441Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by Mambo View Post
    Sorry for flaming you without reason.. well a lil one.. I was a bit pissed off that day
    No problem =D

    Quote Originally Posted by Demantor View Post
    ...anyway, thx,,, can not it be so that it creates the charac ter in the deleted character name with his altcodes?
    No, it create an character entry at the databse with a blank name, but the character doesnt appear at the acc ingame. I really dunno why this bug is happening

    Quote Originally Posted by Demantor View Post
    ..how is this ?
    I think it will be something like

    Code:
    if @name not like '[a,z]' ... ...
    but i really dont know, its a little bit out of my amazing programming knowledge

  12. #37
    Account Upgraded | Title Enabled! Asumi is offline
    MemberRank
    Aug 2008 Join Date
    209Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    You still flamed if you like it or not...

  13. #38
    RestyleGamerZ FTW Mambo is offline
    MemberRank
    Mar 2008 Join Date
    The NetherlandsLocation
    821Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    Quote Originally Posted by Asumi View Post
    You still flamed if you like it or not...
    Useless post? Nvm.

    Ontopic: How about that error.. we don'tg et one atm!

  14. #39
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    This is also usefull i think:
    it will create an function, that checks if the entered string contains only letters and numbers
    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 a~z,A~Z and 0 to 9

    Thank me if you found this helpfull

  15. #40
    Reverse Engineer ThievingSix is offline
    MemberRank
    Mar 2007 Join Date
    CaliforniaLocation
    901Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    You should allow underscores as well.

  16. #41
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: How Do i Restrict Atl-Codes From Charater Names and Makeing.

    This characters are allowed
    Code:
    :;<=>?@[/]^_`



Page 2 of 2 FirstFirst 12

Advertisement