game_chat_text_chat_received_state_change
Represents information specific to the game_chat_state_change_type::text_chat_received state change.
Syntax
typedef struct game_chat_text_chat_received_state_change {
chat_user* sender;
uint32_t receiver_count;
chat_user_array receivers;
PCWSTR message;
} game_chat_text_chat_received_state_change
Members
sender
Type: chat_user*
A pointer to the chat_user
object that originated the text message.
Pointers for chat_user
objects remain valid until the user has been removed from the local chat_manager instance via the chat_manager::remove_user method.
receiver_count
Type: uint32_t
The number of array elements in receivers.
receivers _Field_size_(receiver_count)
Type: chat_user_array
An array of chat_user
pointers to one or more local destination players to whom the text message is addressed.
The memory for the chat_user_array
object remains valid until this object has been returned by calling chat_manager::finish_processing_state_changes. Individual chat_user
object pointers remain valid until the user has been removed from the local chat_manager
instance via the chat_manager::remove_user
method.
message
Type: PCWSTR
A pointer to the text string that was sent by calling chat_user_local::send_chat_text. The string may be up to c_maxChatTextMessageLength
characters long, not including the null terminator.
Note
c_maxChatTextMessageLength
is a constexpr uint16_t
with a value of 1023.
The string remains valid until this object has been returned by calling chat_manager::finish_processing_state_changes
. The app should make a copy of the text to display in a manner and duration described in the Game Chat communication policy guide document.
Remarks
This structure provides additional information for a game_chat_state_change_type::text_chat_received state change in Game Chat 2. This state change occurs when a player-to-player text communication has arrived.
If this state change occurs, this structure is returned as a game_chat_state_change element in the game_chat_state_change_array array retrieved when chat_manager::start_processing_state_changes is called by your app. After confirming the state change type by checking the value of the state_change_type
member for that game_chat_state_change
element, you can then cast that element to this structure. You can then use this structure to obtain more information about and process the state change before the array is passed back to Game Chat 2 from your app, by calling chat_manager::finish_processing_state_changes.
For more information about processing state changes, see Using the Game Chat 2 C++ API.
Requirements
Header: GameChat2.h
Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles