Jump to content

Recommended Posts

Hi guyz and @ Rakancito !

I have some system from you, Rakancito.

But first system is total bugged from you, i start developing and rewritting the whole bugged code.

Shop is can't reupdate itself when server closed/restarted, problem start in char.cpp -> 
void CHARACTER::LoadPremiumPrivateShop(int iItemCount, TPlayerItem* pItems) function.

And in db side, the example ( your files ) totally useless for me.
Example:
your code :
 

Spoiler

#ifdef ENABLE_PREMIUM_PRIVATE_SHOP

if(pi->bIsPrivateShop)

{

snprintf(szQuery, sizeof(szQuery),

"INSERT INTO item%s (id, owner_id, window, pos, vnum, count, socket0, socket1, socket2) "

"VALUES(%u, %u, '%s', %d, %u, %u, %u, %u, %u)",

GetTablePostfix(),

GainItemID(),

pi->player_id,

pi->ip[0] == 0 ? "PRIVATE_SHOP" : "PRIVATE_SHOP",

iPos,

pItemAward->dwVnum, pItemAward->dwCount, pItemAward->dwSocket0, pItemAward->dwSocket1, dwSocket2);

}
........

My code : 

 

Spoiler

snprintf(szQuery, sizeof(szQuery), 
                                "INSERT INTO item%s (id, owner_id, window, pos, vnum, count, socket0, socket1, socket2) "
                                "VALUES(%u, %u, '%s', %d, %u, %u, %u, %u, %u)",
                                GetTablePostfix(),
                                GainItemID(),
#ifdef ENABLE_PREMIUM_PRIVATE_SHOP
                            pi->ip[0] == 2 ? pi->player_id : 
#endif
                            pi->account_id,
#ifdef ENABLE_PREMIUM_PRIVATE_SHOP
                                //pi->bIsPrivateShop == true ? "PRIVATE_SHOP" : pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
                                pi->ip[0] == 2 ? "PRIVATE_SHOP" : pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
#else
                                pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
#endif
                                iPos,
                                pItemAward->dwVnum, pItemAward->dwCount, pItemAward->dwSocket0, pItemAward->dwSocket1, dwSocket2);
                    }


No need useless + lines just work smart ?

if i fixed the items load, and other things in shop, and need this, i will paste it to here.
Excuse me for bad eng. 
Best regard !
 

 

#Update

Finally fixed ❤️ 
spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Good 1
  • muscle 2

787292068_Nvtelen.png.6faa7b0bbb3398fd29

  • 1 year later...
  • 1 month later...
  • 1 month later...
  • 4 weeks later...
  • 2 months later...
On 12/19/2022 at 11:13 AM, [007]DawisHU said:

Hi guyz and @ Rakancito !

I have some system from you, Rakancito.

But first system is total bugged from you, i start developing and rewritting the whole bugged code.

Shop is can't reupdate itself when server closed/restarted, problem start in char.cpp -> 
void CHARACTER::LoadPremiumPrivateShop(int iItemCount, TPlayerItem* pItems) function.

And in db side, the example ( your files ) totally useless for me.
Example:
your code :
 

  Reveal hidden contents

#ifdef ENABLE_PREMIUM_PRIVATE_SHOP

if(pi->bIsPrivateShop)

{

snprintf(szQuery, sizeof(szQuery),

"INSERT INTO item%s (id, owner_id, window, pos, vnum, count, socket0, socket1, socket2) "

"VALUES(%u, %u, '%s', %d, %u, %u, %u, %u, %u)",

GetTablePostfix(),

GainItemID(),

pi->player_id,

pi->ip[0] == 0 ? "PRIVATE_SHOP" : "PRIVATE_SHOP",

iPos,

pItemAward->dwVnum, pItemAward->dwCount, pItemAward->dwSocket0, pItemAward->dwSocket1, dwSocket2);

}
........

My code : 

 

  Hide contents

snprintf(szQuery, sizeof(szQuery), 
                                "INSERT INTO item%s (id, owner_id, window, pos, vnum, count, socket0, socket1, socket2) "
                                "VALUES(%u, %u, '%s', %d, %u, %u, %u, %u, %u)",
                                GetTablePostfix(),
                                GainItemID(),
#ifdef ENABLE_PREMIUM_PRIVATE_SHOP
                            pi->ip[0] == 2 ? pi->player_id : 
#endif
                            pi->account_id,
#ifdef ENABLE_PREMIUM_PRIVATE_SHOP
                                //pi->bIsPrivateShop == true ? "PRIVATE_SHOP" : pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
                                pi->ip[0] == 2 ? "PRIVATE_SHOP" : pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
#else
                                pi->ip[0] == 0 ? "SAFEBOX" : "MALL",
#endif
                                iPos,
                                pItemAward->dwVnum, pItemAward->dwCount, pItemAward->dwSocket0, pItemAward->dwSocket1, dwSocket2);
                    }


No need useless + lines just work smart ?

if i fixed the items load, and other things in shop, and need this, i will paste it to here.
Excuse me for bad eng. 
Best regard !
 

 

#Update

Finally fixed ❤️ 
spacer.png

Hi! Any chance of upload your fix please? 😄

  • 2 months later...
  • 2 weeks later...
On 12/1/2024 at 1:37 AM, KolenMG said:

Unfortunately, After implementing it on tmp4, my client crashes after char select. Havent found a solution yet. 😕 

 

Suppose to work @ Ulthardid it on the @ TMP4files,but im not sure is the same version or other dev sistem

  • Premium
On 12/11/2024 at 6:14 PM, БlyatMAN said:

Suppose to work @ Ulthardid it on the @ TMP4files,but im not sure is the same version or other dev sistem

I believe Ulthar used Great offline shop 

  • 1 year later...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.