Jump to content

Offline Shop (Premium Private Shop)


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
  • Good 1
  • muscle 1

787292068_Nvtelen.png.6faa7b0bbb3398fd29

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

Announcements



×
×
  • 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.