[Fix]spInsertChar

Results 1 to 5 of 5
  1. #1
    Enthusiast ro_xangel is offline
    MemberRank
    Jul 2004 Join Date
    PhilippinesLocation
    25Posts

    [Fix]spInsertChar

    This Fix "Item Sharing", this only occurs when a character is deleted.
    And "New Character Missing", this also occurs when a character is deleted (e.g when you delete you first character).
    ALTER PROCEDURE [dbo].[spInsertChar]
    @nAID INT,
    @nCharIndex INT,
    @szName nvarchar(32),
    @nSex INT,
    @nHair INT,
    @nFace INT,
    @nCostume INT
    AS
    BEGIN
    SET NOCOUNT ON;

    DECLARE @cnt INT <--- cause of "New Character Missing"
    SELECT @cnt=COUNT(*)(e.g First Character has CharNum of 0, 2nd character is 1 and so on.
    FROM Character When you delete for example you 1st character this code counts you characters again
    WHERE AID = @nAIDbut now you have 2 characters aleady so @cnt=COUNT(*) will be equal to 2 so
    "New Character Missing" occurs here for there is already a character assigned to CharNum=1,thus this duplicate CharNum=1 and you cant see the new character

    DECLARE @cid INT <--- cause of "Item Sharing"
    SELECT @cid=COUNT(*) same problem as above (NOTE: @cid=COUNT(*) counts all characters,
    FROM Characterlets assume there are 30 characters so the last character has A CID of 29.)
    But this time when you delete a character, for example a character that has a CID of 10, @cid=COUNT(*) counts all character in the database and there are 29 characters so @cid=COUNT(*) will be equal to 29 now and "CID duplication" occurs which leads to "Item Sharing" for the same CID is use.



    INSERT INTO Character
    VALUES(@nAID,@szName,@cnt,1,@nSex,@nCostume,@nFace,@nHair,NULL,0,'1,000',0,0,0,0,0,0,0,0,0,0,0,0,@cnt,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,getdate(),getdate(),0)
    SOLUTION:

    Goto Character Database edit the Database. change CID to Identity, leave other things to default. Look at the "0" on the old spInsertChar, then assign a default value to 0 on all column that has a value of 0 on the old spInsertChar. And then save .

    then apply this:
    CREATE PROCEDURE [dbo].[spInsertChar]
    @nAID INT,
    @nCharIndex INT,
    @szName nvarchar(32),
    @nSex INT,
    @nHair INT,
    @nFace INT,
    @nCostume INT
    AS

    BEGIN
    SET NOCOUNT ON;

    INSERT Character (AID,Name,CharIndex,Sex,Costume,Face,Hair,CharNum)
    VALUES (@nAID,@szName,@nCharIndex,@nSex,@nCostume,@nFace,@nHair,@nCharIndex)
    END

    This is not the complete code that has all the items on your inventory and equipped on the same time. There is a post for that fix. You can add custom code below the line "Values"

    HOPE this help guys! and credits goes to me for the fix

    Sorry if i'm not to clear on my explanation. Hope you understand.


  2. #2
    Account Upgraded | Title Enabled! Kyuma is offline
    MemberRank
    Aug 2008 Join Date
    At HomeLocation
    350Posts

    Re: [Fix]spInsertChar

    looool LMAO UNTILL 2007 NO ONE REPLY THAT FREAKING FUNNY O.O

  3. #3
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: [Fix]spInsertChar

    Quote Originally Posted by Kyuma View Post
    looool LMAO UNTILL 2007 NO ONE REPLY THAT FREAKING FUNNY O.O
    Why was this graveduggen..?

  4. #4
    Account Upgraded | Title Enabled! JuanMedina is offline
    MemberRank
    Feb 2009 Join Date
    VenezuelaLocation
    227Posts

    Re: [Fix]spInsertChar

    very nice release dude...

  5. #5
    Proficient Member Tra3200 is offline
    MemberRank
    Jul 2008 Join Date
    199Posts

    Re: [Fix]spInsertChar

    Blah ..crap



Advertisement