Jump to content
×
×
  • Create New...
  • 0

Checking item cache to delete a character


Firecracker

Question

hi dev,

 

i want to check player's items if they are binded or not before deleting character. i have added a function which checks item.sql table but cache is problem.

i used this to check cache in clientmanagerplayer.cpp but it doesn't work. could anyone help me?

 

			CItemCache * pkItemCache = GetItemCache(packet->player_id);
            if (pkItemCache)
            {
                TPlayerItem * pTab2 = pkItemCache->Get();

                if (pTab2->bind > 0)
                {
   	                sys_log(0, "PLAYER DELETE FAILED HAS BINDED ITEM PID %d", packet->player_id);
   	                peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
       	            peer->EncodeBYTE(packet->account_index);
       	            return;
                }
            }

 

Link to comment
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

i realized that ItemCache uses item id not player id. i have to use ItemCacheSet.

 

with this

TItemCacheSet * pkItemCache = GetItemCacheSet(packet->player_id);
            if (pkItemCache)
            {
                sys_log(0, "PLAYER_DELETE FAILED HAS BINDED ITEM PID: %d", packet->player_id);
				peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, dwHandle, 1);
				peer->EncodeBYTE(packet->account_index);
                return;
            }

i checked that there are some items which are belong to the player who tries to delete character. i want to check that is there any item which is soul binded. but i failed.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Read our Rules
  • Activity

    1. 0

      [Land of Heroes] We are looking for Game / Game Economy Designers

    2. 177

      Render Target Remastered

    3. 1

      MySQL stop when start server

    4. 0

    5. 59

      Emoji in TextLine

    6. 1

      MySQL stop when start server

  • Recently Browsing

    No registered users viewing this page.

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.