#include <message.h>
Collaboration diagram for MsgDescr_t:
Data Fields | |
union { | |
struct { | |
Bool bcast: 1 | |
Indicates that the message may be broadcast to clients. | |
Bool buffLifeUnmanaged: 1 | |
Indicates the message buffer will not be destroyed by the messaging system until BufferFree() is called outside of the system. | |
Bool doNotAddId: 1 | |
True when the message format does not need a message ID number added. | |
Bool inflight: 1 | |
True while this struct has valid data and is being used to send and track acknowledgments to a message. | |
Bool mcast: 1 | |
Indicates that the message may be multicast to clients. | |
Bool noResend: 1 | |
When true, the message will not be resent. | |
} | |
Uint8 flags | |
Bit flags that indicate the message's state and affect how the message is handled. | |
}; | |
AcknowledgeMsg | ackFunc |
The function called to react to acknowledgment of recipt of the message. | |
ApproveSendMsg | approveFunc |
Approves a message to be sent to each recipient, or NULL to always approve sending the message. | |
NetBuffer * | buffer |
| |
void * | data |
A pointer to arbitrary data for use by the message's handling functions. | |
Uint16 | destMap [((((32)%(sizeof(Uint16)*8)) > 0)?((int)(32)/(sizeof(Uint16)*8)+1):((int)(32)/(sizeof(Uint16)*8)))] |
A bitmap of which clients the message is destined for who have not yet acknowledged the message. | |
FailMsg | failFunc |
The function called to react to a recipient that failed to acknowledge the message. | |
Uint16 | interval |
The time in milliseconds between sends. | |
Uint16 | msgId |
The identifier for the message. | |
Uint32 | nextSend |
The common game time when the message will be resent if not all recpients have acknowledged the message. | |
Sint8 | triesLeft |
The number of attempts remaining before giving up on this message. |
Definition at line 351 of file message.h.
union { ... } |
The function called to react to acknowledgment of recipt of the message.
May be NULL if there is no action upon acknowledgment.
Definition at line 364 of file message.h.
Referenced by AppendPlayerData(), SendDisconnectMessage(), SendScoreUpdate(), SendSpawnRequest(), and ServiceGameConfig().
Approves a message to be sent to each recipient, or NULL to always approve sending the message.
Definition at line 374 of file message.h.
Referenced by AppendPlayerData(), Send(), SendDisconnectMessage(), SendScoreUpdate(), SendSpawnRequest(), and ServiceGameConfig().
Indicates that the message may be broadcast to clients.
Definition at line 455 of file message.h.
Referenced by AddToConfigList(), Send(), SendDisconnectMessage(), SendScoreUpdate(), SendSpawnRequest(), and ServiceGameConfig().
A buffer given to this descriptor to write out a message. The lifespan of the message is one transmission unless either one of the flags buffLifeMsg or buffLifeUnmanaged is set. If the buffer should be dropped while the message is still in-flight, then call BufferFree() with this pointer and clear buffLifeMsg. To regain a persistent buffer, set buffLifeMsg in the constrFunc function.
The length of the buffer should be set by constrFunc or be set before the call to AddMessage(). A negative value is interpreted as an error and will cause the message to be canceled.
Definition at line 390 of file message.h.
Referenced by AddMessage(), AppendPlayerData(), MessageFree(), MsgFailDropConnection(), Send(), SendDisconnectMessage(), SendScoreUpdate(), SendSpawnRequest(), and ServiceGameConfig().
Indicates the message buffer will not be destroyed by the messaging system until BufferFree() is called outside of the system.
Definition at line 473 of file message.h.
Referenced by MessageFree(), Send(), and ServiceGameConfig().
void* MsgDescr_t::data |
Uint16 MsgDescr_t::destMap[((((32)%(sizeof(Uint16)*8)) > 0)?((int)(32)/(sizeof(Uint16)*8)+1):((int)(32)/(sizeof(Uint16)*8)))] |
A bitmap of which clients the message is destined for who have not yet acknowledged the message.
All elements of the array are set to zero in MessageNew(). Using this provides greater flexibility than storing a single address and uses less memory than an INetAddr struct. Use DESTMAPLEN as the array's size.
Definition at line 410 of file message.h.
Referenced by AddMessage(), AddToConfigList(), AppendPlayerData(), MessageNew(), Send(), SendDisconnectMessage(), SendSpawnRequest(), and ServiceGameConfig().
True when the message format does not need a message ID number added.
Normally messages will need an ID. They will be added when this flag is cleared.
Definition at line 479 of file message.h.
Referenced by AddMessage().
The function called to react to a recipient that failed to acknowledge the message.
May be NULL if there is no action upon failure.
Definition at line 369 of file message.h.
Referenced by AppendPlayerData(), Send(), SendDisconnectMessage(), SendScoreUpdate(), SendSpawnRequest(), and ServiceGameConfig().
Uint8 MsgDescr_t::flags |
Bit flags that indicate the message's state and affect how the message is handled.
The value is set to zero by MessageNew().
Definition at line 443 of file message.h.
Referenced by MessageNew().
Uint16 MsgDescr_t::interval |
The time in milliseconds between sends.
A default value is set by MessageNew() and it is doubled after nextSend is updated. The value may be changed before calling AddMessage() and by the message's constrFunc.
Definition at line 429 of file message.h.
Referenced by MessageNew(), Send(), and SendScoreUpdate().
Indicates that the message may be multicast to clients.
Definition at line 461 of file message.h.
Referenced by AddToConfigList().
Uint16 MsgDescr_t::msgId |
The identifier for the message.
This identifier is sent with all copies of this message, including re-transmissions. The value is set by AddMessage().
Definition at line 423 of file message.h.
Referenced by AddMessage(), MsgFailDisconnect(), Send(), and ServiceMessages().
Uint32 MsgDescr_t::nextSend |
The common game time when the message will be resent if not all recpients have acknowledged the message.
This value is used to sort messages in the inflightTime priority queue and is set at the end of the internal function Send().
Definition at line 417 of file message.h.
Referenced by Send(), and ServiceMessages().
Sint8 MsgDescr_t::triesLeft |
The number of attempts remaining before giving up on this message.
When value reaches zero, the message remains in the system for one more interval to allow incomming acknowledgements more time. After the interval, notifictaion of any non-acknowledging destinations will be made through calling failFunc just before canceling the message.
Definition at line 437 of file message.h.
Referenced by AddMessage(), MessageNew(), Send(), and SendDisconnectMessage().