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. | |
void | BeginTrading (Client *client, gemObject *target, const csString &type) |
Start trading. | |
bool | HasConnected (csString name) |
Checked if the character exists still or if it hasn't connected in two months. | |
bool | Initialize () |
bool | IsBanned (const char *name) |
virtual bool | SendInventory (uint32_t clientNum, bool sendUpdatesOnly=true) |
Sends the client an inventory. | |
void | SendOutEquipmentMessages (gemActor *actor, INVENTORY_SLOT_NUMBER slotID, psItem *item, int equipped) |
Sends out equipment messages to all the people around client. | |
void | SendOutPlaySoundMessage (uint32_t clientNum, const char *itemsound, const char *action) |
Sends out sound messages to the client. | |
void | SendPlayerMoney (Client *client, bool storage=false) |
ServerCharManager (CacheManager *cachemanager, GEMSupervisor *gemsupervisor) | |
virtual bool | UpdateItemViews (uint32_t clientNum) |
Update all views with items. | |
void | ViewItem (Client *client, int containerID, INVENTORY_SLOT_NUMBER slotID) |
virtual | ~ServerCharManager () |
Static Public Member Functions | |
static bool | TradingCheck (Client *client, gemObject *target, csString *errorMessage=NULL) |
Check if trading is allowed. | |
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. | |
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. | |
void | HandleStorageMessage (MsgEntry *me, Client *client) |
Handles a message coming from the client for making operations with his storage. | |
void | HandleStorageRequest (psGUIStorageMessage &msg, Client *client) |
Handles the request to access the storage from the player. | |
void | HandleStorageStore (psGUIStorageMessage &msg, Client *client) |
Handles the request to store an item from the player. | |
void | HandleStorageView (psGUIStorageMessage &msg, Client *client) |
Handles the request to check informations about a stored item. | |
void | HandleStorageWithdraw (psGUIStorageMessage &msg, Client *client) |
Handles the request to withdraw an item from the NPC. | |
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. | |
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 | |
bool | VerifyStorage (Client *client, psCharacter *character, psCharacter **storage, const char *trade, const char *itemName, PID storageID) |
Return true if all storage params are ok. | |
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. | |
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 |
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 ServerCharManager::~ServerCharManager | ( | ) | [virtual] |
Handles a storing beginning.
client | The client sending us the message. |
target | The target of the storage operation. |
type | ? |
Start trading.
int ServerCharManager::CalculateMerchantPrice | ( | psItem * | item, |
Client * | client, | ||
bool | sellPrice | ||
) | [protected] |
Handles any incoming messages about the character gui.
void ServerCharManager::HandleMerchantBuy | ( | psGUIMerchantMessage & | msg, |
Client * | client | ||
) | [protected] |
void ServerCharManager::HandleMerchantCategory | ( | psGUIMerchantMessage & | msg, |
Client * | client | ||
) | [protected] |
void ServerCharManager::HandleMerchantRequest | ( | psGUIMerchantMessage & | msg, |
Client * | client | ||
) | [protected] |
void ServerCharManager::HandleMerchantSell | ( | psGUIMerchantMessage & | msg, |
Client * | client | ||
) | [protected] |
void ServerCharManager::HandleMerchantView | ( | psGUIMerchantMessage & | msg, |
Client * | client | ||
) | [protected] |
void ServerCharManager::HandleStorageCategory | ( | psGUIStorageMessage & | msg, |
Client * | client | ||
) | [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. |
void ServerCharManager::HandleStorageRequest | ( | psGUIStorageMessage & | msg, |
Client * | client | ||
) | [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. |
void ServerCharManager::HandleStorageStore | ( | psGUIStorageMessage & | msg, |
Client * | client | ||
) | [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. |
void ServerCharManager::HandleStorageView | ( | psGUIStorageMessage & | msg, |
Client * | client | ||
) | [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. |
void ServerCharManager::HandleStorageWithdraw | ( | psGUIStorageMessage & | msg, |
Client * | client | ||
) | [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 bool ServerCharManager::SendInventory | ( | uint32_t | clientNum, |
bool | sendUpdatesOnly = true |
||
) | [virtual] |
Sends the client an inventory.
bool ServerCharManager::SendMerchantItems | ( | Client * | client, |
psCharacter * | merchant, | ||
psItemCategory * | category | ||
) | [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.
bool ServerCharManager::SendPlayerItems | ( | Client * | client, |
psItemCategory * | category, | ||
bool | storage | ||
) | [protected] |
void ServerCharManager::SendPlayerMoney | ( | Client * | client, |
bool | storage = false |
||
) |
bool ServerCharManager::SendStorageItems | ( | Client * | client, |
psCharacter * | character, | ||
psItemCategory * | category | ||
) | [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 bool ServerCharManager::TradingCheck | ( | Client * | client, |
gemObject * | target, | ||
csString * | errorMessage = NULL |
||
) | [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 bool ServerCharManager::UpdateItemViews | ( | uint32_t | clientNum | ) | [virtual] |
Update all views with items.
bool ServerCharManager::VerifyGoal | ( | Client * | client, |
psCharacter * | character, | ||
psItem * | goal | ||
) | [protected] |
verifies that item dropped in mind slot is a valid goal
bool ServerCharManager::VerifyStorage | ( | Client * | client, |
psCharacter * | character, | ||
psCharacter ** | storage, | ||
const char * | trade, | ||
const char * | itemName, | ||
PID | storageID | ||
) | [protected] |
Return true if all storage params are ok.
bool ServerCharManager::VerifyTrade | ( | Client * | client, |
psCharacter * | character, | ||
psCharacter ** | merchant, | ||
psMerchantInfo ** | info, | ||
const char * | trade, | ||
const char * | itemName, | ||
PID | merchantID | ||
) | [protected] |
Return true if all trade params are ok.
void ServerCharManager::ViewItem | ( | Client * | client, |
int | containerID, | ||
INVENTORY_SLOT_NUMBER | slotID | ||
) |
CacheManager* ServerCharManager::cacheManager [protected] |
Definition at line 209 of file psserverchar.h.
Definition at line 212 of file psserverchar.h.
Definition at line 213 of file psserverchar.h.
GEMSupervisor* ServerCharManager::gemSupervisor [protected] |
Definition at line 210 of file psserverchar.h.
SlotManager* ServerCharManager::slotManager [protected] |
Definition at line 208 of file psserverchar.h.