19 #ifndef __EXCHANGEMANAGER_H__    20 #define __EXCHANGEMANAGER_H__    24 #include <csutil/ref.h>    25 #include <csutil/refarr.h>    26 #include <csutil/parray.h>   227     virtual bool HandleAccept(
Client* client) = 0;
   257     virtual void MoveItem(
Client* client, 
int fromSlot, 
int stackCount, 
int toSlot);
   271     virtual bool RemoveItem(
Client* fromClient, 
int slot, 
int stackCount);
   284         return starterClient;    
   287     psItem* GetStarterOffer(
int slot);
   295     virtual void SendRemoveItemMessage(
Client* fromClient, 
int slot);
   297     void SendEnd(
int clientNum);
   324     bool CheckExchange(uint32_t clientNum, 
bool checkRange=
false);
   325     bool HandleAccept(
Client* client);
   326     void HandleEnd(
Client* client);
   327     void SendExchangeStatusToBoth();
   356     virtual bool RemoveItem(
Client* fromClient, 
int slot, 
int stackCount);
   360     virtual psItem* GetTargetOffer(
int slot);
   364     virtual void SendRemoveItemMessage(
Client* fromClient, 
int slot);
   368     void SendRequestToBoth();
   379     bool starterAccepted, targetAccepted;
   390     bool CheckExchange(uint32_t clientNum, 
bool checkRange=
false);
   392     virtual bool HandleAccept(
Client* client);
   423     void StartExchange(
Client* client, 
bool withPlayer, 
bool automaticExchange = 
false, 
int questID = -1);
   436         exchanges.Push(exchange);
   440     void DeleteExchange(
Exchange* exchange);
 ClientConnectionSet * clients
 
This class handles the details behind a character's inventory system. 
 
bool IsOfferingSane()
Make sure all offered items still have legal stack counts. 
 
void AdjustMoney(int coin, int delta)
Change the amount of money this character is offering in the exchange. 
 
ExchangingCharacter(int client, psCharacterInventory &inv)
 
bool exchangeSuccess
exchange was successful and items should not be returned to owners 
 
INVENTORY_SLOT_NUMBER
Holds a list of the possible socket identifiers that items can be attached to. 
 
The structure of 1 queue entry (pointer to a message) 
 
void UpdateOfferingMoney()
Update the money box for money that is being offered by this character. 
 
float GetSumSize()
Gets the total size of all the items that are offered. 
 
void AddExchange(Exchange *exchange)
Adds given exchange to the exchange manager's exchanges list. 
 
bool automaticExchange
the exchange is done entirely server side don't open windows on the client. This is used only with NP...
 
psCharacter * GetClientCharacter(int clientNum)
 
ExchangingCharacter starterChar
Information about the player that initiated the exchange. 
 
void TransferMoney(int targetClientNum)
Transfers the trias from this exchanging player to a different player. 
 
ExchangingCharacter holds relevant information about character that is participating in exchange of i...
 
psMoney GetOfferedMoney()
 
void GetOffering(csString &buff)
Constructs an XML list of the items that are being offered. 
 
void UpdateReceivingMoney(psMoney &money)
Update the money box for money that will be received by this character. 
 
bool MoveOfferedItem(int fromSlot, int stackcount, int toSlot)
 
int client
Stuff that was removed from character inventory and offered to the other character. 
 
void GetOfferingCSV(csString &buff)
 
bool RemoveItemFromOffer(int itemNum, int count, int &remain)
Removes items from position 'itemNum'. 
 
void TransferOffer(int targetClientNum)
Transfers offered items and money to character 'target'. 
 
This class collects data of a netclient. 
 
Client * GetStarterClient()
 
psItem * GetOfferedItem(int slot)
 
float GetSumWeight()
Gets the total weight of all the items that are offered. 
 
This class exists per NPC, and holds all dialog triggers, responses and scripts for this particular N...
 
psCharacterInventory * chrinv
 
bool OfferItem(int exchSlotNum, INVENTORY_SLOT_NUMBER invSlot, int stackcount, bool test)
Inserts item to position 'itemNum'. 
 
ExchangeManager * exchangeMgr
 
A gemObject is any solid, graphical object visible in PS with normal physics and normal collision det...
 
virtual psItem * GetTargetOffer(int slot)
 
bool GetExchangedItems(csString &text)
 
This class is a list of several CLient objects, it's designed for finding clients very fast based on ...
 
csPDelArray< Exchange > exchanges
 
void GetSimpleOffering(csString &buff, psCharacter *chr, bool exact=true)
Constructs a simple XML list of the items that are being offered. 
 
This class generically allows objects to be notified when a gemObject is removed. ...
 
bool exchangeEnded
exchange ended and should be deleted 
 
This class embodies item instances in the game. 
 
Provides a manager to facilitate subscriptions.