Planeshift
|
Manages character details over the net. More...
#include <psserverchar.h>
Public Member Functions | |
void | BeginStoring (Client *client, gemObject *target, const csString &type) |
Handles a storing beginning. More... | |
void | BeginTrading (Client *client, gemObject *target, const csString &type) |
Start trading. More... | |
bool | HasConnected (csString name) |
Checked if the character exists still or if it hasn't connected in two months. More... | |
bool | Initialize () |
bool | IsBanned (const char *name) |
virtual bool | SendInventory (uint32_t clientNum, bool sendUpdatesOnly=true) |
Sends the client an inventory. More... | |
void | SendOutEquipmentMessages (gemActor *actor, INVENTORY_SLOT_NUMBER slotID, psItem *item, int equipped) |
Sends out equipment messages to all the people around client. More... | |
void | SendOutPlaySoundMessage (uint32_t clientNum, const char *itemsound, const char *action) |
Sends out sound messages to the client. More... | |
void | SendPlayerMoney (Client *client, bool storage=false) |
ServerCharManager (CacheManager *cachemanager, GEMSupervisor *gemsupervisor) | |
virtual bool | UpdateItemViews (uint32_t clientNum) |
Update all views with items. More... | |
void | ViewItem (Client *client, int containerID, INVENTORY_SLOT_NUMBER slotID) |
virtual | ~ServerCharManager () |
![]() | |
void | HandleMessage (MsgEntry *msg, Client *client) |
Transfers the message to the manager specific function. More... | |
void | Subscribe (FunctionPointer fpt, msgtype type, uint32_t flags=0x01) |
Subscribes this manager to a specific message type with a custom callback. More... | |
bool | Unsubscribe (msgtype type) |
Unsubscribes this manager from a specific message type. More... | |
bool | Unsubscribe (FunctionPointer handler, msgtype type) |
Unsubscribes a specific handler from a specific message type. More... | |
bool | UnsubscribeAll () |
Unsubscribes this manager from all message types. More... | |
virtual | ~MessageManager () |
Unsubscribes all messages then destroys this object. More... | |
![]() | |
csArray< csString > | DecodeCommandArea (Client *client, csString target) |
Decodes an area: expression. More... | |
gemObject * | FindObjectByString (const csString &str, gemActor *me) const |
Find the object we are referring to in str. More... | |
Client * | FindPlayerClient (const char *name) |
Finds Client* of character with given name. More... | |
virtual bool | Verify (MsgEntry *pMsg, unsigned int flags, Client *&client) |
Static Public Member Functions | |
static bool | TradingCheck (Client *client, gemObject *target, csString *errorMessage=NULL) |
Check if trading is allowed. More... | |
Protected Member Functions | |
int | CalculateMerchantPrice (psItem *item, Client *client, bool sellPrice) |
void | HandleBookWrite (MsgEntry *me, Client *client) |
void | HandleCraftTransInfo (MsgEntry *me, Client *client) |
void | HandleFaction (MsgEntry *me, Client *client) |
void | HandleInventoryMessage (MsgEntry *me, Client *client) |
Handles any incoming messages about the character gui. More... | |
void | HandleMerchantBuy (psGUIMerchantMessage &msg, Client *client) |
void | HandleMerchantCategory (psGUIMerchantMessage &msg, Client *client) |
void | HandleMerchantMessage (MsgEntry *me, Client *client) |
void | HandleMerchantRequest (psGUIMerchantMessage &msg, Client *client) |
void | HandleMerchantSell (psGUIMerchantMessage &msg, Client *client) |
void | HandleMerchantView (psGUIMerchantMessage &msg, Client *client) |
void | HandleStorageCategory (psGUIStorageMessage &msg, Client *client) |
Handles the request to change category from the player. More... | |
void | HandleStorageMessage (MsgEntry *me, Client *client) |
Handles a message coming from the client for making operations with his storage. More... | |
void | HandleStorageRequest (psGUIStorageMessage &msg, Client *client) |
Handles the request to access the storage from the player. More... | |
void | HandleStorageStore (psGUIStorageMessage &msg, Client *client) |
Handles the request to store an item from the player. More... | |
void | HandleStorageView (psGUIStorageMessage &msg, Client *client) |
Handles the request to check informations about a stored item. More... | |
void | HandleStorageWithdraw (psGUIStorageMessage &msg, Client *client) |
Handles the request to withdraw an item from the NPC. More... | |
bool | SendMerchantItems (Client *client, psCharacter *merchant, psItemCategory *category) |
bool | SendPlayerItems (Client *client, psItemCategory *category, bool storage) |
bool | SendStorageItems (Client *client, psCharacter *character, psItemCategory *category) |
Sends to the client the stored items for this category. More... | |
void | UpdateMusicalSheet (MsgEntry *me, Client *client) |
void | UpdateSketch (MsgEntry *me, Client *client) |
bool | VerifyGoal (Client *client, psCharacter *character, psItem *goal) |
verifies that item dropped in mind slot is a valid goal More... | |
bool | VerifyStorage (Client *client, psCharacter *character, psCharacter **storage, const char *trade, const char *itemName, PID storageID) |
Return true if all storage params are ok. More... | |
bool | VerifyTrade (Client *client, psCharacter *character, psCharacter **merchant, psMerchantInfo **info, const char *trade, const char *itemName, PID merchantID) |
Return true if all trade params are ok. More... | |
void | ViewItem (MsgEntry *me, Client *client) |
Protected Attributes | |
CacheManager * | cacheManager |
MathScript * | calc_item_merchant_price_buy |
MathScript * | calc_item_merchant_price_sell |
GEMSupervisor * | gemSupervisor |
SlotManager * | slotManager |
Additional Inherited Members | |
![]() | |
typedef void(ServerCharManager::* | FunctionPointer) (MsgEntry *, Client *) |
Manages character details over the net.
This is used instead of cel persistance because the persistance is an all or nothing sort of thing. By using this we can make more efficient use of the net traffic
Definition at line 58 of file psserverchar.h.
ServerCharManager::ServerCharManager | ( | CacheManager * | cachemanager, |
GEMSupervisor * | gemsupervisor | ||
) |
|
virtual |
Handles a storing beginning.
client | The client sending us the message. |
target | The target of the storage operation. |
type | ? |
Start trading.
|
protected |
Handles any incoming messages about the character gui.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Handles the request to change category from the player.
msg | The cracked message received from the client. |
client | The client sending us the message. |
Handles a message coming from the client for making operations with his storage.
me | The message received from the client. |
client | The client sending us the message. |
|
protected |
Handles the request to access the storage from the player.
msg | The cracked message received from the client. |
client | The client sending us the message. |
|
protected |
Handles the request to store an item from the player.
msg | The cracked message received from the client. |
client | The client sending us the message. |
|
protected |
Handles the request to check informations about a stored item.
msg | The cracked message received from the client. |
client | The client sending us the message. |
|
protected |
Handles the request to withdraw an item from the NPC.
msg | The cracked message received from the client. |
client | The client sending us the message. |
bool ServerCharManager::HasConnected | ( | csString | name | ) |
Checked if the character exists still or if it hasn't connected in two months.
bool ServerCharManager::Initialize | ( | ) |
bool ServerCharManager::IsBanned | ( | const char * | name | ) |
|
virtual |
Sends the client an inventory.
|
protected |
void ServerCharManager::SendOutEquipmentMessages | ( | gemActor * | actor, |
INVENTORY_SLOT_NUMBER | slotID, | ||
psItem * | item, | ||
int | equipped | ||
) |
Sends out equipment messages to all the people around client.
This is used when a player changes their visible equipment and needs to be reflected on other nearby clients. Visible changes can be either new weapons/shields ( new mesh ) or texture changes for clothes ( new material ).
actor | The actor that has changed equipment. |
slotID | To what slot has changed. |
item | The item that is the piece of visible equipment. |
equipped | The equiping type. One of: psEquipmentMessage::DEEQUIP psEquipmentMessage::EQUIP |
void ServerCharManager::SendOutPlaySoundMessage | ( | uint32_t | clientNum, |
const char * | itemsound, | ||
const char * | action | ||
) |
Sends out sound messages to the client.
|
protected |
void ServerCharManager::SendPlayerMoney | ( | Client * | client, |
bool | storage = false |
||
) |
|
protected |
Sends to the client the stored items for this category.
client | The client sending us the message. |
character | merchant ????? |
category | The category we are browsing |
|
static |
Check if trading is allowed.
Will return true if trading is allowed. Returning a reasion in the errorMessage if a pointer is given.
|
virtual |
Update all views with items.
|
protected |
verifies that item dropped in mind slot is a valid goal
|
protected |
Return true if all storage params are ok.
|
protected |
Return true if all trade params are ok.
void ServerCharManager::ViewItem | ( | Client * | client, |
int | containerID, | ||
INVENTORY_SLOT_NUMBER | slotID | ||
) |
|
protected |
Definition at line 209 of file psserverchar.h.
|
protected |
Definition at line 212 of file psserverchar.h.
|
protected |
Definition at line 213 of file psserverchar.h.
|
protected |
Definition at line 210 of file psserverchar.h.
|
protected |
Definition at line 208 of file psserverchar.h.