Planeshift
Public Member Functions | Public Attributes

psViewItemDescription Class Reference

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

#include <messages.h>

List of all members.

Public Member Functions

 PSF_DECLARE_MSG_FACTORY ()
 psViewItemDescription (int containerID, int slotID)
 Requests to the server for an item Description.
 psViewItemDescription (uint32_t to, const char *itemName, const char *description, const char *icon, uint32_t stackCount)
 Construct a message to go out to a client.
 psViewItemDescription (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

int containerID
 The container ID for this item.
int ContainerSlots
 The slots available in this container.
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 msgSize
 Running count of message size. Used for constructing the outgoing message.
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 item 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 4237 of file messages.h.


Constructor & Destructor Documentation

psViewItemDescription::psViewItemDescription ( 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.
psViewItemDescription::psViewItemDescription ( 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.
psViewItemDescription::psViewItemDescription ( 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

psViewItemDescription::PSF_DECLARE_MSG_FACTORY ( )
virtual csString psViewItemDescription::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

The container ID for this item.

Definition at line 4294 of file messages.h.

The slots available in this container.

Definition at line 4297 of file messages.h.

True if this item is a container and has contents.

Definition at line 4306 of file messages.h.

The description of this item or container.

Definition at line 4285 of file messages.h.

The 2D graphic GUI image.

Definition at line 4288 of file messages.h.

The name of the item or container.

Definition at line 4282 of file messages.h.

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

Definition at line 4303 of file messages.h.

Where this item is in the container.

Definition at line 4300 of file messages.h.

Stack count of the item.

Definition at line 4291 of file messages.h.

The destination client for this message.

Definition at line 4309 of file messages.h.


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