Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-19-2009, 04:26 AM
tsowl
Fire Beetle
 
Join Date: Jul 2004
Posts: 8
Default share bank dupe prevent

there are two ways to dupe items with shared bank

zone/inventory.cpp
Code:
	if (!src_inst && (src_slot_id<4000 || src_slot_id>4009)) {
		if (GetClientVersion() != EQClientSoF)  // SoF client sends invalid slots regularly for an unknown use, so don't warn them about this.
			Message(13, "Error: Server found no item in slot %i (->%i), Deleting Item!", src_slot_id, dst_slot_id);

		LogFile->write(EQEMuLog::Debug, "Error: Server found no item in slot %i (->%i), Deleting Item!", src_slot_id, dst_slot_id);
-		this->DeleteItemInInventory(dst_slot_id,0,true);
+		this->DeleteItemInInventory(src_slot_id,0,true);
		return false;
	}
	//verify shared bank transactions in the database
	if(src_inst && src_slot_id >= 2500 && src_slot_id <= 2550) {
		if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) {
			LogFile->write(EQEMuLog::Error, "Player %s on account %s was found exploiting the shared bank. They have been banned until further review.\n", account_name, GetName());
			DeleteItemInInventory(dst_slot_id,0,true);
			return(false);
		}
+		if(src_slot_id >= 2500 && src_slot_id <= 2501 && src_inst->IsType(ItemClassContainer)){
+			for (uint8 idx=0; idx<10; idx++) {
+				const ItemInst* baginst = src_inst->GetItem(idx);
+				if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(src_slot_id, idx), baginst)){
+					DeleteItemInInventory(Inventory::CalcSlotId(src_slot_id, idx),0,false);
+				}
+			}
+		}
	}
+	if(dst_inst && dst_slot_id >= 2500 && dst_slot_id <= 2550) {
+		if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) {
+			LogFile->write(EQEMuLog::Error, "Player %s on account %s was found exploting the shared bank. They have been banned until further review.\n", account_name, GetName());
+			DeleteItemInInventory(src_slot_id,0,true);
+			return(false);
+		}
+		if(dst_slot_id >= 2500 && dst_slot_id <= 2501 && dst_inst->IsType(ItemClassContainer)){
+			for (uint8 idx=0; idx<10; idx++) {
+				const ItemInst* baginst = dst_inst->GetItem(idx);
+				if(baginst && !database.VerifyInventory(account_id, Inventory::CalcSlotId(dst_slot_id, idx), baginst)){
+					DeleteItemInInventory(Inventory::CalcSlotId(dst_slot_id, idx),0,false);
+				}
+			}
+		}
+	}

common/shareddb.cpp (change not necessary)
Code:
-				ret = RunQuery(query, MakeAnyLenString(&query, "DELETE FROM inventory WHERE charid=%i AND slotid>=%i AND slotid<%i",
-					char_id, base_slot_id, (base_slot_id+10)), errbuf);*/
+				ret = RunQuery(query, MakeAnyLenString(&query, "DELETE FROM sharedbank WHERE acctid=%i AND slotid>=%i AND slotid<%i",
+					account_id, base_slot_id, (base_slot_id+10)), errbuf);
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:05 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3