tModLoader v2024.03
A mod to make and play Terraria mods
ChatHelper Class Reference

Facilitates sending chat messages from the server to clients. BroadcastChatMessage(NetworkText, Color, int) and SendChatMessageToClient(NetworkText, Color, int) are the most commonly used methods provided. More...

Static Public Member Functions

static void BroadcastChatMessage (NetworkText text, Color color, int excludedPlayer=-1)
 Sends a message to all connected clients to be displayed in chat. Intended to be used from the server. More...
 
static void BroadcastChatMessageAs (byte messageAuthor, NetworkText text, Color color, int excludedPlayer=-1)
 
static void ClearDelayedMessagesCache ()
 
static void DisplayMessage (NetworkText text, Color color, byte messageAuthor)
 
static void DisplayMessageOnClient (NetworkText text, Color color, int playerId)
 
static bool OnlySendToPlayersWhoAreLoggedIn (int clientIndex)
 
static void SendChatMessageFromClient (ChatMessage message)
 
static void SendChatMessageToClient (NetworkText text, Color color, int playerId)
 Sends a message to the specified client to be displayed in their chat. Intended to be used from the server. Useful for the server replying to client actions. More...
 
static void SendChatMessageToClientAs (byte messageAuthor, NetworkText text, Color color, int playerId)
 
static void ShowCachedMessages ()
 

Detailed Description

Facilitates sending chat messages from the server to clients.

BroadcastChatMessage(NetworkText, Color, int) and SendChatMessageToClient(NetworkText, Color, int) are the most commonly used methods provided.

Member Function Documentation

◆ BroadcastChatMessage()

static void ChatHelper.BroadcastChatMessage ( NetworkText  text,
Color  color,
int  excludedPlayer = -1 
)
static

Sends a message to all connected clients to be displayed in chat. Intended to be used from the server.

Parameters
text
color
excludedPlayer

◆ SendChatMessageToClient()

static void ChatHelper.SendChatMessageToClient ( NetworkText  text,
Color  color,
int  playerId 
)
static

Sends a message to the specified client to be displayed in their chat. Intended to be used from the server. Useful for the server replying to client actions.

Parameters
text
color
playerId