Hi guys,
There's a guy that is blackmailing all servers that are using my offlineshop.
Not just my clients, but also those who downloaded it from some idiot's leak.
I'm sharing the fix here as 60/70% of the servers currently open use my shop.
- //FILE : new_offlineshop_manager.cpp
- //SEARCH FOR
- bool CShopManager::RecvShopCreateOfferClientPacket(LPCHARACTER ch, TOfferInfo& offer)
- {
- if(!ch)
- return false;
- //offlineshop-updated 03/08/19
- if(ch->GetPlayerID() == offer.dwOwnerID)
- return false;
- //ADD UNDER
- // fix flooding offers
- if (!CheckOfferCooldown(ch->GetPlayerID()))
- return false;
- //SEARCH FOR:
- void CShopManager::ClearSearchTimeMap()
- {
- m_searchTimeMap.clear();
- //ADD UNDER
- // fix flooding offers
- m_offerCooldownMap.clear();
- //SEARCH FOR
- void CShopManager::ClearSearchTimeMap()
- {
- m_searchTimeMap.clear();
- }
- //ADD UNDER
- // fix flooding offers
- bool CShopManager::CheckOfferCooldown(DWORD dwPID) {
- DWORD now = get_dword_time();
- const DWORD cooldown_seconds = 15;
- itertype(m_offerCooldownMap) it = m_offerCooldownMap.find(dwPID);
- if (it == m_offerCooldownMap.end()) {
- m_offerCooldownMap[dwPID] = now + cooldown_seconds *1000;
- return true;
- }
- if (it->second > now)
- return false;
- it->second = now + cooldown_seconds * 1000;
- return true;
- }
- //FILE : new_offlineshop_manager.h
- //SEARCH FOR:
- //search time map (checking to avoid search abouse)
- void ClearSearchTimeMap();
- bool CheckSearchTime(DWORD dwPID);
- //ADD UNDER:
- // fix flooding offers
- bool CheckOfferCooldown(DWORD dwPID);
- //SEARCH FOR:
- AUCTIONMAP m_mapAuctions;
- //ADD UNDER:
- // fix flooding offers
- SEARCHTIMEMAP m_offerCooldownMap;
- //FILE : ClientManagerOfflineshop.cpp
- //SEARCH FOR:
- bool CClientManager::RecvOfflineShopOfferAccepted(const char* data)
- {
- offlineshop::TSubPacketGDOfferAccept* subpack;
- data = Decode(subpack, data);
- offlineshop::COfferCache::TOfferCacheInfo* pOffer=nullptr;
- m_offlineshopOfferCache.Get(subpack->dwOfferID,&pOffer);
- //ADD UNDER:
- if(!pOffer)
- return true;
Random User :
Why are u sharing it using Metin2downloads?
Answer:
I m bored to see this guy make money by blackmailing.
Random User part2:
Is it right to share this fix even with those who are not your customer?
Answer:
I honestly think that anyone who uses the shop without permission, taking it from sources different from me, is not worthy of help from me, however I can't even allow so many people to be fooled by this idiot boy.
Random User part3:
Do you know who is blackmailing the p.server founders?
Answer:
Yes, i know his discord account : Mădălin#2332
I recommend to don't pay him at all. I would like to know other accounts of this guy, if anyone know some please report to me.
I also have the proofs about what i m talking.
BIG DISCLAIMER:
Test the code on a test-sever before to move it on a live-server.
Thanks to VegaS for the tip about cooldown