Fixing the delete character bug [ 2008 files ]

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Apprentice Wertex011 is offline
    MemberRank
    Mar 2011 Join Date
    7Posts

    Fixing the delete character bug [ 2008 files ]

    Hi there.

    I left gunz along time ago, But i'm coming back, working for gunz private servers.

    There is a bug with deleting the character, " You cant delete your character because it contains cash items, clan. bla bla "

    Well, I was watching the spDeleteChar procedure. and Phoenix you missed one thing. [ I'm not being ego, i'm just saying what he did ]

    The original spdeletechar
    Code:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    /* 캐릭터 삭제 */  
    ALTER  PROC [dbo].[spDeleteChar]  
     @AID  int,  
     @CharNum smallint,  
     @CharName varchar(24)  
    AS  
    DECLARE @CID  int  
    DECLARE @CashItemCount int  
      
    SELECT @CID=CID FROM Character WITH (nolock) WHERE AID=@AID and CharNum=@CharNum  
    IF (@CID IS NULL)  
    BEGIN  
     return (-1)  
    END  
      
    SELECT @CashItemCount=COUNT(*) FROM CharacterItem(nolock) WHERE CID=@CID AND ItemID>=50000  
      
    IF (@CashItemCount > 0) OR  
       (EXISTS (SELECT TOP 1 CLID FROM ClanMember WHERE CID=@CID))  
    BEGIN  
     return (-1)  
    END  
      
    BEGIN TRAN
    
    UPDATE Character SET CharNum = -1, DeleteFlag = 1, Name='', DeleteName=@CharName  
    WHERE AID=@AID AND CharNum=@CharNum AND Name=@CharName  
    IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN
     ROLLBACK TRAN
     RETURN (-1)
    END
    
    INSERT INTO CharacterMakingLog(AID, CharName, Type, Date)
    VALUES(@AID, @CharName, '삭제', GETDATE())
    IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN
     ROLLBACK TRAN
     RETURN (-1) 
    END
      
    COMMIT TRAN
    SELECT 1 AS Ret
    The one that i've made
    Code:
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    /* 캐릭터 삭제 */  
    ALTER  PROC [dbo].[spDeleteChar]  
     @AID  int,  
     @CharNum smallint,  
     @CharName varchar(24)  
    AS  
    DECLARE @CID  int  
    DECLARE @CashItemCount int  
      
    SELECT @CID=CID FROM Character WITH (nolock) WHERE AID=@AID and CharNum=@CharNum  
    IF (@CID IS NULL)  
    BEGIN  
     return (-1)  
    END  
      
    SELECT @CashItemCount=COUNT(*) FROM CharacterItem(nolock) WHERE CID=@CID AND ItemID>=add here all donators,events etc cashitems id search it at your zitem  
      
    IF (@CashItemCount > 1) OR  
       (EXISTS (SELECT TOP 1 CLID FROM ClanMember WHERE CID=@CID))  
    BEGIN  
     return (-1)  
    END  
      
    BEGIN TRAN
    
    UPDATE Character SET CharNum = -1, DeleteFlag = 1, Name='', DeleteName=@CharName  
    WHERE AID=@AID AND CharNum=@CharNum AND Name=@CharName  
    IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN
     ROLLBACK TRAN
     RETURN (-1)
    END
    
    INSERT INTO CharacterMakingLog(AID, CharName, Type, Date)
    VALUES(@AID, @CharName, '삭제', GETDATE())
    IF (0 <> @@ERROR) OR (0 = @@ROWCOUNT) BEGIN
     ROLLBACK TRAN
     RETURN (-1) 
    END
      
    COMMIT TRAN
    SELECT 1 AS Ret
    Example :
    Code:
    SELECT @CashItemCount=COUNT(*) FROM CharacterItem(nolock) WHERE CID=@CID AND ItemID>=650030 AND ItemID>=650032 AND ItemID>=Cashitem id AND ItemID>=CASHITEMid
    [ you should have at the zitem -> iscashitem="true" ]

    If you cant fix the storage, i will make a tutorial latter how to fix it :)

    Didn't work? tell me, i have another way to make it work :)

    Good luck.
    Wertex
    Last edited by Wertex011; 01-03-11 at 02:39 PM.


  2. #2
    Account Upgraded | Title Enabled! TheCodeOfGunz is offline
    MemberRank
    Oct 2010 Join Date
    PhilippinesLocation
    532Posts

    Re: Fixing the delete character bug [ 2008 files ]

    nice welcome back bro

  3. #3
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: Fixing the delete character bug [ 2008 files ]

    So what exactly is the "bug"? It's good that characters with Cash items can't be deleted because people pay money for Cash items. If they want to delete a character with those items then they can simply send the items to the storage and delete the character.

  4. #4
    Account Upgraded | Title Enabled! e1o14 is offline
    MemberRank
    Apr 2009 Join Date
    GermanyLocation
    306Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by Phoenix View Post
    So what exactly is the "bug"? It's good that characters with Cash items can't be deleted because people pay money for Cash items. If they want to delete a character with those items then they can simply send the items to the storage and delete the character.
    No I think the bug was that characters couldn't be deleted even tho they had NO cash items equipped / in storage / inventory, correct me if I'm wrong

  5. #5
    hoi ik ben cool Merijn is offline
    MemberRank
    Dec 2009 Join Date
    The NetherlandsLocation
    492Posts

    Re: Fixing the delete character bug [ 2008 files ]

    May i thank you, this works.

  6. #6
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by e1o14 View Post
    No I think the bug was that characters couldn't be deleted even tho they had NO cash items equipped / in storage / inventory, correct me if I'm wrong
    Never experienced that.

  7. #7
    Apprentice Wertex011 is offline
    MemberRank
    Mar 2011 Join Date
    7Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by Phoenix View Post
    So what exactly is the "bug"? It's good that characters with Cash items can't be deleted because people pay money for Cash items. If they want to delete a character with those items then they can simply send the items to the storage and delete the character.
    As you see the code " AND ItemID>=5000 " its the cash item id, Since everyone have a different shop, and zitem, You should make AND ItemID>=5000 AND ItemID>=6999 you just configured it for your own zitem. There is a lot of zitems, So you need to edit that.
    if you give a cash item for your char, and you didn't updated the zitem.xml with iscashitem=true" it will delete [ of course it will ] if you edited and you didn't updated the spDeleteChar procedure, it will delete aswell, you need to edit the spDeleteChar with the cash item id, and you need to change the IsCashItem="true" at the zitem.xml

  8. #8
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by Wertex011 View Post
    As you see the code " AND ItemID>=5000 " its the cash item id, Since everyone have a different shop, and zitem, You should make AND ItemID>=5000 AND ItemID>=6999 you just configured it for your own zitem. There is a lot of zitems, So you need to edit that.
    if you give a cash item for your char, and you didn't updated the zitem.xml with iscashitem=true" it will delete [ of course it will ] if you edited and you didn't updated the spDeleteChar procedure, it will delete aswell, you need to edit the spDeleteChar with the cash item id, and you need to change the IsCashItem="true" at the zitem.xml
    Alright, I get the point now. Just to let you know, I didn't "configure" anything for "my" zitem. It's from the official GunZ database.

    Good contribution anyways.

  9. #9
    Apprentice Wertex011 is offline
    MemberRank
    Mar 2011 Join Date
    7Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by Phoenix View Post
    Alright, I get the point now. Just to let you know, I didn't "configure" anything for "my" zitem. It's from the official GunZ database.

    Good contribution anyways.
    Sorry then, I didn't know.

  10. #10
    Doggie And Rice. Military is offline
    MemberRank
    Jun 2009 Join Date
    Here and AboutLocation
    3,301Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Thank you.

  11. #11
    Apprentice Wertex011 is offline
    MemberRank
    Mar 2011 Join Date
    7Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by Military View Post
    Thank you.
    No problem :)

  12. #12
    I am Dylan. I<3Bass is offline
    MemberRank
    Jun 2010 Join Date
    New YorkLocation
    953Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Wb to GunZ.

  13. #13
    Apprentice Wertex011 is offline
    MemberRank
    Mar 2011 Join Date
    7Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by Liquid Rave View Post
    Wb to GunZ.
    Thank you bro.

  14. #14
    Enthusiast dbz54 is offline
    MemberRank
    Apr 2009 Join Date
    29Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Wb and nice :)

  15. #15
    Apprentice Wertex011 is offline
    MemberRank
    Mar 2011 Join Date
    7Posts

    Re: Fixing the delete character bug [ 2008 files ]

    Quote Originally Posted by Baspower View Post
    Nice wertex, thanks alot.
    No problem mate :)



Page 1 of 2 12 LastLast

Advertisement