Anvil
Anvil.Services.ChatService Class Reference
+ Inheritance diagram for Anvil.Services.ChatService:
+ Collaboration diagram for Anvil.Services.ChatService:

Public Member Functions

 ChatService (HookService hookService)
 
void ClearPlayerChatHearingDistance (NwPlayer player)
 Clears any hearing distance overrides for the specified NwPlayer. More...
 
void ClearPlayerChatHearingDistance (NwPlayer player, ChatChannel chatChannel)
 Clears the hearing distance override for the specified NwPlayer and ChatChannel. More...
 
float GetChatHearingDistance (ChatChannel chatChannel)
 Gets the global hearing distance for the specified ChatChannel. More...
 
float GetPlayerChatHearingDistance (NwPlayer player, ChatChannel chatChannel)
 Gets the hearing distance for the specified NwPlayer and ChatChannel. More...
 
bool SendMessage (ChatChannel chatChannel, string message, NwCreature sender, NwPlayer? target=null)
 Sends a message as the specified creature. More...
 
bool SendServerMessage (ChatChannel chatChannel, string message, NwPlayer? target=null)
 Sends a message from the "Server". More...
 
void SetChatHearingDistance (ChatChannel chatChannel, float distance)
 Sets the global hearing distance for the specified ChatChannel. More...
 
void SetPlayerChatHearingDistance (NwPlayer player, ChatChannel chatChannel, float distance)
 Sets the hearing distance override for the specified NwPlayer and ChatChannel. More...
 
- Public Member Functions inherited from Anvil.API.Events.IEventFactory< NullRegistrationData >
void Register< TEvent > (TRegisterData data)
 
void Unregister< TEvent > ()
 

Member Function Documentation

◆ ClearPlayerChatHearingDistance() [1/2]

void Anvil.Services.ChatService.ClearPlayerChatHearingDistance ( NwPlayer  player)
inline

Clears any hearing distance overrides for the specified NwPlayer.

Parameters
playerThe NwPlayer to query.

◆ ClearPlayerChatHearingDistance() [2/2]

void Anvil.Services.ChatService.ClearPlayerChatHearingDistance ( NwPlayer  player,
ChatChannel  chatChannel 
)
inline

Clears the hearing distance override for the specified NwPlayer and ChatChannel.

Parameters
playerThe NwPlayer to query.
chatChannelThe ChatChannel to query.

◆ GetChatHearingDistance()

float Anvil.Services.ChatService.GetChatHearingDistance ( ChatChannel  chatChannel)
inline

Gets the global hearing distance for the specified ChatChannel.

Parameters
chatChannelThe ChatChannel to query.
Returns
The distance configured for the specified chat channel.

◆ GetPlayerChatHearingDistance()

float Anvil.Services.ChatService.GetPlayerChatHearingDistance ( NwPlayer  player,
ChatChannel  chatChannel 
)
inline

Gets the hearing distance for the specified NwPlayer and ChatChannel.

Parameters
playerThe NwPlayer to query.
chatChannelThe ChatChannel to query.
Returns
The distance configured for the specified player and chat channel.
If no override is configured, returns the global configured distance instead.

◆ SendMessage()

bool Anvil.Services.ChatService.SendMessage ( ChatChannel  chatChannel,
string  message,
NwCreature  sender,
NwPlayer target = null 
)
inline

Sends a message as the specified creature.

Parameters
chatChannelThe ChatChannel to send the message.
messageThe message to send.
senderThe sender of the message.
targetThe receiver of the message.
Returns
True if the message was sent successfully, otherwise false.

◆ SendServerMessage()

bool Anvil.Services.ChatService.SendServerMessage ( ChatChannel  chatChannel,
string  message,
NwPlayer target = null 
)
inline

Sends a message from the "Server".

Parameters
chatChannelThe ChatChannel to send the message. Only works with ServerMessage and Player/DMShout
messageThe message to send.
targetThe receiver of the message.
Returns
True if the message was sent successfully, otherwise false.

◆ SetChatHearingDistance()

void Anvil.Services.ChatService.SetChatHearingDistance ( ChatChannel  chatChannel,
float  distance 
)
inline

Sets the global hearing distance for the specified ChatChannel.

Parameters
chatChannelThe ChatChannel to query.
distanceThe new hearing distance.

◆ SetPlayerChatHearingDistance()

void Anvil.Services.ChatService.SetPlayerChatHearingDistance ( NwPlayer  player,
ChatChannel  chatChannel,
float  distance 
)
inline

Sets the hearing distance override for the specified NwPlayer and ChatChannel.

Parameters
playerThe NwPlayer to query.
chatChannelThe ChatChannel to query.
distanceThe new hearing distance.

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