Hello! I have a system that synchronizes chat between servers.
I have done my best to research the new safety rules but I just wanted to double check;
Does this system comply with all Roblox communication rules?
Note: Not all code is shown. Just the necessary parts.
--SERVER
local TS = game:GetService("TextService")
remotes.SentMessage.OnServerEvent:Connect(function(plr,text)
--Filter the string for broadcast. (I could filter per-player but not worth effort.)
text = TS:FilterStringAsync(text,plr.UserId,Enum.TextFilterContext.PublicChat):GetNonChatStringForBroadcastAsync()
--Add message to a payload to send to other servers.
local message = {ID = plr.UserId, Name = plr.DisplayName, Text = text}
table.insert(messages,message)
--Code to publish these processed messages is elsewhere and irrelevant.
--Do I need to process the message further such as for privacy settings??
end)
--CLIENT
local TCS = game:GetService("TextChatService")
local channels = TCS:WaitForChild("TextChannels")
local channel = channels:WaitForChild("RBXGeneral")
--Display published messages from other servers.
remotes.RecievedMessages.OnClientEvent:Connect(function(messages)
for _,message in messages do
--Do not display "global messages" from your own server.
if game.Players:GetPlayerByUserId(message.ID) then continue end
--Show messages from other servers as a system message.
channel:DisplaySystemMessage(`{message.Name}: {message.Text}`)
end
end)
--Send messages to the server for processing and publishing.
TCS.SendingMessage:Connect(function(msg)
if msg.TextChannel == channel then
remotes.SentMessage:FireServer(msg.Text)
end
end)