TextFilterResult
Memory category | Instances |
---|
Member index 3
Description
Represents the result of a call to TextService:FilterStringAsync(). Used to distribute a filtered string accordingly.
History 9
- 462 Change ThreadSafety of GetNonChatStringForUserAsync from to Unsafe
- 462 Change ThreadSafety of GetNonChatStringForBroadcastAsync from to Unsafe
- 462 Change ThreadSafety of GetChatForUserAsync from to Unsafe
- 322 Change Parameters of GetNonChatStringForUserAsync from (toUserId: int) to (toUserId: int64)
- 322 Change Parameters of GetChatForUserAsync from (toUserId: int) to (toUserId: int64)
- 293 Add GetNonChatStringForUserAsync
- 293 Add GetNonChatStringForBroadcastAsync
- 293 Add GetChatForUserAsync
- 293 Add TextFilterResult
Members 3
GetChatForUserAsync
Parameters (1) | ||
---|---|---|
toUserId | int64 | |
Returns (1) | ||
string |
This method returns the text in a properly filtered manner for the specified Player.UserId using the least restrictive filtering appropriate for that user, with Chat privacy settings of both users enforced. This should be used in the context of chats between players, although there are some other cases where text filtering is required.
The returned string should only be shown to the target user, as it might not be appropriate for all users.
If this method throws an error, the string should not be displayed to the user. Cases for error include:
- The two users are not allowed to chat, for example if
Chat:CanUserChatAsync() would return
false
for the given sender and receiver. - The user with the ID
toUserId
is not online on the current server.
This function will return immediately in most cases, although it will yield if the target user has just joined the server and their filtering info is not yet loaded.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of GetChatForUserAsync from to Unsafe
- 322 Change Parameters of GetChatForUserAsync from (toUserId: int) to (toUserId: int64)
- 293 Add GetChatForUserAsync
GetNonChatStringForBroadcastAsync
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
Returns the text in a properly filtered manner for all users. This should be used in the context of non-chat text that every user can see, such as for a dialog that lets a user write a message on a sign, visible to all users on the server even after the author has left.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetNonChatStringForBroadcastAsync from to Unsafe
- 293 Add GetNonChatStringForBroadcastAsync
GetNonChatStringForUserAsync
Parameters (1) | ||
---|---|---|
toUserId | int64 | |
Returns (1) | ||
string |
Returns the text in a properly filtered manner for the specified Player.UserId based on age and other details. This should be used in the context of non-chat text that one specific user can see, such as the name of a pet.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of GetNonChatStringForUserAsync from to Unsafe
- 322 Change Parameters of GetNonChatStringForUserAsync from (toUserId: int) to (toUserId: int64)
- 293 Add GetNonChatStringForUserAsync