Planeshift
|
General Message for sending information about an containter to a client. More...
#include <messages.h>
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 ) More... | |
void | ConstructMsg (csStringSet *msgstrings) |
Build the message ( assumes base item is a container ). More... | |
PSF_DECLARE_MSG_FACTORY () | |
psViewContainerDescription (int containerID, int slotID) | |
Requests to the server for an item Description. More... | |
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. More... | |
psViewContainerDescription (MsgEntry *me, NetBase::AccessPointers *accessPointers) | |
Crack out the details from the message. More... | |
virtual csString | ToString (NetBase::AccessPointers *accessPointers) |
Converts the message into human readable string. More... | |
![]() | |
void | FireEvent () |
Publishes the message to the local program. More... | |
virtual csString | GetMessageTypeName () const =0 |
Gets the name of the message type. More... | |
void | Multicast (csArray< PublishDestination > &multi, uint32_t except, float range) |
Multicasts the message to all current connections. More... | |
psMessageCracker () | |
void | SendMessage () |
Sends the message to the client/server. More... | |
virtual | ~psMessageCracker () |
Public Attributes | |
bool | CanTransform |
indicates whether the container can auto transform or not More... | |
int | containerID |
The container ID for this item. More... | |
csArray< ContainerContents > | contents |
bool | hasContents |
True if this item is a container and has contents. More... | |
const char * | itemDescription |
The description of this item or container. More... | |
const char * | itemIcon |
The 2D graphic GUI image. More... | |
const char * | itemName |
The name of the item or container. More... | |
int | maxContainerSlots |
The maximum number of slots available in this container. More... | |
int | msgSize |
Running count of message size. Used for constructing the outgoing message. More... | |
bool | renameable |
indicates whether the container is renameable or not More... | |
int | slotID |
Where this item is in the container. More... | |
uint32_t | stackCount |
Stack count of the item. More... | |
int | to |
The destination client for this message. More... | |
![]() | |
int | filterNumber |
csRef< MsgEntry > | msg |
bool | valid |
Additional Inherited Members | |
![]() | |
static MsgHandler * | msghandler |
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 4339 of file messages.h.
Requests to the server for an item Description.
containerID | What 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. |
slotID | Where 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 ).
to | The desitination client. |
itemName | The name of the item requested. |
description | The description of the requested item. |
icon | The 2D gui image to draw for this item. |
stackCount | The numer of items in the stack. |
isContainer | True 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.
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 |
Converts the message into human readable string.
accessPointers | A struct to a number of access pointers. |
Implements psMessageCracker.
bool psViewContainerDescription::CanTransform |
indicates whether the container can auto transform or not
Definition at line 4414 of file messages.h.
int psViewContainerDescription::containerID |
The container ID for this item.
Definition at line 4396 of file messages.h.
csArray<ContainerContents> psViewContainerDescription::contents |
Definition at line 4436 of file messages.h.
bool psViewContainerDescription::hasContents |
True if this item is a container and has contents.
Definition at line 4408 of file messages.h.
const char* psViewContainerDescription::itemDescription |
The description of this item or container.
Definition at line 4387 of file messages.h.
const char* psViewContainerDescription::itemIcon |
The 2D graphic GUI image.
Definition at line 4390 of file messages.h.
const char* psViewContainerDescription::itemName |
The name of the item or container.
Definition at line 4384 of file messages.h.
int psViewContainerDescription::maxContainerSlots |
The maximum number of slots available in this container.
Definition at line 4399 of file messages.h.
int psViewContainerDescription::msgSize |
Running count of message size. Used for constructing the outgoing message.
Definition at line 4405 of file messages.h.
bool psViewContainerDescription::renameable |
indicates whether the container is renameable or not
Definition at line 4411 of file messages.h.
int psViewContainerDescription::slotID |
Where this item is in the container.
Definition at line 4402 of file messages.h.
uint32_t psViewContainerDescription::stackCount |
Stack count of the item.
Definition at line 4393 of file messages.h.
int psViewContainerDescription::to |
The destination client for this message.
Definition at line 4417 of file messages.h.