/** psinventorycachehdlr.cpp * * Copyright (C) 2006 Atomic Blue (info@planeshift.it, http://www.atomicblue.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation (version 2 of the License) * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Server-side of the inventory cache handling. */ #include #include "pscharacter.h" #include "psinventorycachesvr.h" psInventoryCacheServer::psInventoryCacheServer () { } psInventoryCacheServer::~psInventoryCacheServer () { } bool psInventoryCacheServer::BulkSlotModified (int slot) { if (slot=PSCHARACTER_BULK_COUNT) { SetCacheStatus(INVALID); // somethings gone wrong; force entire // inventory update next time return false; } bulkSlotModified[slot] = true; return true; } bool psInventoryCacheServer::EquipmentSlotModified (int slot) { if (slot<0 || slot>=PSCHARACTER_SLOT_COUNT) { SetCacheStatus(INVALID); // somethings gone wrong; force entire // inventory update next time return false; } equipSlotModified[slot] = true; return true; } bool psInventoryCacheServer::HasEquipSlotModified (int slot) { if (slot<0 || slot>=PSCHARACTER_SLOT_COUNT) { return false; } return equipSlotModified[slot]; } bool psInventoryCacheServer::HasBulkSlotModified (int slot) { if (slot=PSCHARACTER_BULK_COUNT) { return false; } return bulkSlotModified[slot]; } bool psInventoryCacheServer::ClearBulkSlot(int slot) { if (slot=PSCHARACTER_BULK_COUNT) { SetCacheStatus(INVALID); // somethings gone wrong; force entire // inventory update next time return false; } bulkSlotModified[slot] = false; return true; } bool psInventoryCacheServer::ClearEquipSlot(int slot) { if (slot<0 || slot>=PSCHARACTER_SLOT_COUNT) { SetCacheStatus(INVALID); // somethings gone wrong; force entire // inventory update next time return false; } equipSlotModified[slot] = false; return true; } bool psInventoryCacheServer::ClearAllSlots(void) { bool slotOK = true; for (int slot=ANY_EMPTY_BULK_SLOT; slot