Planeshift
Classes | Public Member Functions | Public Attributes

psViewContainerDescription Class Reference

General Message for sending information about an containter to a client. More...

#include <messages.h>

List of all members.

Classes

struct  ContainerContents

Public Member Functions

void AddContents (const char *name, const char *meshName, const char *materialName, const char *icon, int purifyStatus, int slot, int stack)
 Add a item to this message ( assumes the base item is a container )
void ConstructMsg (csStringSet *msgstrings)
 Build the message ( assumes base item is a container ).
 PSF_DECLARE_MSG_FACTORY ()
 psViewContainerDescription (int containerID, int slotID)
 Requests to the server for an item Description.
 psViewContainerDescription (uint32_t to, const char *itemName, const char *description, const char *icon, uint32_t stackCount)
 Construct a message to go out to a client.
 psViewContainerDescription (MsgEntry *me, NetBase::AccessPointers *accessPointers)
 Crack out the details from the message.
virtual csString ToString (NetBase::AccessPointers *accessPointers)
 Converts the message into human readable string.

Public Attributes

bool CanTransform
 indicates whether the container can auto transform or not
int containerID
 The container ID for this item.
csArray< ContainerContentscontents
bool hasContents
 True if this item is a container and has contents.
const char * itemDescription
 The description of this item or container.
const char * itemIcon
 The 2D graphic GUI image.
const char * itemName
 The name of the item or container.
int maxContainerSlots
 The maximum number of slots available in this container.
int msgSize
 Running count of message size. Used for constructing the outgoing message.
bool renameable
 indicates whether the container is renameable or not
int slotID
 Where this item is in the container.
uint32_t stackCount
 Stack count of the item.
int to
 The destination client for this message.

Detailed Description

General Message for sending information about an containter to a client.

This class can take single items or containers and will send all the data to the client. The client will then pop up the correct window when it gets one of these messages. The item screen for a single item or the container screen if the item is a container.

When sending an item to a client you create this message by giving the name and description of the item ( all items have this )

If it is a container you need to set the container ID and call AddContents() for each item in the container. After that you need to call ConstructMsg() to build the network message.

Definition at line 4336 of file messages.h.


Constructor & Destructor Documentation

psViewContainerDescription::psViewContainerDescription ( int  containerID,
int  slotID 
)

Requests to the server for an item Description.

Parameters:
containerIDWhat container this item is from. Can be one of the special ones like CONTAINER_INVENTORY. If the item is in the world or not in a container then it is the gem id of the item.
slotIDWhere this item is in the container.
psViewContainerDescription::psViewContainerDescription ( uint32_t  to,
const char *  itemName,
const char *  description,
const char *  icon,
uint32_t  stackCount 
)

Construct a message to go out to a client.

If icContainer is false then the message is constructed right away. If it is true then the data is stored and the message is not constructed (because size is not known ).

Parameters:
toThe desitination client.
itemNameThe name of the item requested.
descriptionThe description of the requested item.
iconThe 2D gui image to draw for this item.
stackCountThe numer of items in the stack.
isContainerTrue if this item is a container.
psViewContainerDescription::psViewContainerDescription ( MsgEntry me,
NetBase::AccessPointers accessPointers 
)

Crack out the details from the message.

This will look at the packet and figure out if it is a single item or a container. If it is a container it will populate it's internal array of data.


Member Function Documentation

void psViewContainerDescription::AddContents ( const char *  name,
const char *  meshName,
const char *  materialName,
const char *  icon,
int  purifyStatus,
int  slot,
int  stack 
)

Add a item to this message ( assumes the base item is a container )

void psViewContainerDescription::ConstructMsg ( csStringSet *  msgstrings)

Build the message ( assumes base item is a container ).

psViewContainerDescription::PSF_DECLARE_MSG_FACTORY ( )
virtual csString psViewContainerDescription::ToString ( NetBase::AccessPointers accessPointers) [virtual]

Converts the message into human readable string.

Parameters:
accessPointersA struct to a number of access pointers.
Returns:
Return a human readable string for the message.

Implements psMessageCracker.


Member Data Documentation

indicates whether the container can auto transform or not

Definition at line 4411 of file messages.h.

The container ID for this item.

Definition at line 4393 of file messages.h.

Definition at line 4433 of file messages.h.

True if this item is a container and has contents.

Definition at line 4405 of file messages.h.

The description of this item or container.

Definition at line 4384 of file messages.h.

The 2D graphic GUI image.

Definition at line 4387 of file messages.h.

The name of the item or container.

Definition at line 4381 of file messages.h.

The maximum number of slots available in this container.

Definition at line 4396 of file messages.h.

Running count of message size. Used for constructing the outgoing message.

Definition at line 4402 of file messages.h.

indicates whether the container is renameable or not

Definition at line 4408 of file messages.h.

Where this item is in the container.

Definition at line 4399 of file messages.h.

Stack count of the item.

Definition at line 4390 of file messages.h.

The destination client for this message.

Definition at line 4414 of file messages.h.


The documentation for this class was generated from the following file: