Jump to content

Checking item cache to delete a character


Recommended Posts

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
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      Quest 6/7 Problem

    2. 5

      Effect weapons

    3. 3

      Crystal Metinstone

    4. 3

      Feeding game source to LLM

    5. 113

      Ulthar SF V2 (TMP4 Base)

    6. 3

      Feeding game source to LLM

    7. 0

      Target Information System

    8. 3

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

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.