Duplicate Itemid Fix!!

Results 1 to 12 of 12
  1. #1
    League of Legends <3 toperwin is offline
    MemberRank
    Jan 2009 Join Date
    313Posts

    Duplicate Itemid Fix!!

    Ago i saw verry long ago to fix it with something like "SQL_NO_CACHE" but didn't work for me,.. sow thats reason why i post a new fix by me ;p

    Search into /HabboHotel/Users/Iventory/IventoryComponent.cs for:
    Code:
    public void AddItem(uint Id, uint BaseItem, string ExtraData)
    Replace that WHOLE void with:
    Code:
            public void AddItem(uint Id, uint BaseItem, string ExtraData)
            {
                try
                {
                    lock (this.InventoryItems)
                    {
                        InventoryItems.Add(new UserItem(Id, BaseItem, ExtraData));
    
                        using (DatabaseClient dbClient = UberEnvironment.GetDatabase().GetClient())
                        {
                            dbClient.AddParamWithValue("extra_data", ExtraData);
                            dbClient.ExecuteQuery("INSERT INTO user_items (id,user_id,base_item,extra_data) VALUES ('" + Id + "','" + UserId + "','" + BaseItem + "',@extra_data)");
                        }
                    }
                }
                catch (Exception)
                {
                    this.AddItem(Id, BaseItem, ExtraData);
                }
            }
    U maybe think, isnt this going to give u other errors, or a insta loop or whatever? -> NO! :D
    Bcouse the change to get itemid error with much ppl online is 1 at 20/50 ,... just say to the script to try it again ;) and it will work,...
    I doesn't got ANY duplicate itemid error/disconnect anymore :D


  2. #2
    What about no. Davidaap is offline
    MemberRank
    Nov 2009 Join Date
    773Posts

    Re: Duplicate Itemid Fix!!

    nice mattie :)

  3. #3
    Banned PEjump2 is offline
    BannedRank
    Jan 2010 Join Date
    The NetherlandsLocation
    2,838Posts

    Re: Duplicate Itemid Fix!!

    This won't fix it completly, this will just create loops,
    and loops will create an memory leak,
    and when you've got 200+ online you'r computer would burn away..

    Tip:
    To fix this, add an sort of an check that checks if the item already exists :)
    Last edited by PEjump2; 22-12-10 at 01:10 PM.

  4. #4
    League of Legends <3 toperwin is offline
    MemberRank
    Jan 2009 Join Date
    313Posts

    Re: Duplicate Itemid Fix!!

    Quote Originally Posted by PEjump2 View Post
    This won't fix it completly, this will just create loops,
    and loops will create an memory leak,
    and when you've got 200+ online you'r computer would burn away..

    Tip:
    To fix this, add an sort of an check that checks if the item already exists :)
    AGAIN! can u read?
    It doesnt create loops bcouse you have just 1 at 50 times that duplicate itemid fix,...
    change that u get a loop from 500000000 is change 1 at 9999999999999999999999999999999999999
    It just let it repeat 1/2 times bcouse than the item works with buying,.....
    sow it doesnt create unendless loop (if u dont got a selfmade sucking emulator like you got) and it doesnt burn your emulator ;) it just works and fix the problem,.. if u dont like it dont use it!

  5. #5
    The Legend Returns vista4life is offline
    MemberRank
    Mar 2007 Join Date
    The NetherlandsLocation
    843Posts

    Re: Duplicate Itemid Fix!!

    sigh.. add a hashtable for item's that will fix almost all problems ;)

    Example:


    if (mRemovedItems.Contains(Id))
    mRemovedItems.Remove(Id);
    if (mAddedItems.ContainsKey(Id))
    return;
    Last edited by vista4life; 22-12-10 at 01:37 PM.

  6. #6
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    Re: Duplicate Itemid Fix!!

    So, this work our no?

  7. #7
    Banned PEjump2 is offline
    BannedRank
    Jan 2010 Join Date
    The NetherlandsLocation
    2,838Posts

    Re: Duplicate Itemid Fix!!

    Quote Originally Posted by rafa95123 View Post
    So, this work our no?
    Nope, this will just create loops, and loops will create a few memory leaks & lagg on you'r hotel so, i don't recommend to use this 'fix'.

  8. #8
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    Re: Duplicate Itemid Fix!!

    Ok Thanks ;D

  9. #9
    Lurking since '06 1ntel is offline
    MemberRank
    Jul 2006 Join Date
    401Posts

    Re: Duplicate Itemid Fix!!

    Quote Originally Posted by vista4life View Post
    sigh.. add a hashtable for item's that will fix almost all problems ;)

    Example:


    if (mRemovedItems.Contains(Id))
    mRemovedItems.Remove(Id);
    if (mAddedItems.ContainsKey(Id))
    return;
    Thats what you did in martinmines fix for VG, and its a complete mess i would never go that way about to fixing it really.

  10. #10
    The Legend Returns vista4life is offline
    MemberRank
    Mar 2007 Join Date
    The NetherlandsLocation
    843Posts

    Re: Duplicate Itemid Fix!!

    Quote Originally Posted by matty13 View Post
    Thats what you did in martinmines fix for VG, and its a complete mess i would never go that way about to fixing it really.

    good to see that ur totaly agree with ur buggy leaked source =]

    that happens when something leaks ;) because that source you have is full bugs and full testing stuff and trust me this is the best fix todo that thing and beside ask martin about it;)

    think before you post..
    Last edited by vista4life; 23-12-10 at 05:39 PM.

  11. #11
    League of Legends <3 toperwin is offline
    MemberRank
    Jan 2009 Join Date
    313Posts

    Re: Duplicate Itemid Fix!!

    Btw into that catch,.. just place a return >,< i found that not all emulators accept this code (bcouse my stable one does they drived about 2days with this working, but my other one for fun with battlebanzai etz he gave stackoverflow,...)

    if ur emulator don't accept this code and give stackoverflow, than just into the catch place a return or whatever u wanted ;p

  12. #12
    Account Upgraded | Title Enabled! masood104 is offline
    MemberRank
    Aug 2009 Join Date
    311Posts

    Re: Duplicate Itemid Fix!!

    so whats the final fix for this xD? that doesn't cause loops or w.e



Advertisement