Solved, It was my own stupidity. Can’t filter a message from someone not in game. Needs to be before
-
What do you want to achieve?
Trying to send a small string to other servers via MessagingService -
What is the issue?
Only the server that sent it gets the message sent. -
What solutions have you tried so far?
I’ve looked around DevForums to see if anyone else has the same problem I do, I haven’t. I’ve tried adding prints both server-side and local which only go off on the originating server, so that means the other servers didn’t pick up on it.
Server:
local function handlePublish(plr, method, info)
local decodedData = {
method = method,
info = info,
id = plr.UserId
}
local encodedData = httpService:JSONEncode(decodedData)
messagingService:PublishAsync("Info", encodedData)
end
local function handleSubscribe(encodedData)
local decodedData = httpService:JSONDecode(encodedData.Data)
local method = decodedData.method
local info = decodedData.info
local id = decodedData.id
local filterResult = TextService:FilterStringAsync(info, id, Enum.TextFilterContext.PublicChat)
for i,v in pairs(game:GetService("Players"):GetChildren()) do
bind:InvokeClient(v, method, filterResult:GetChatForUserAsync(v.UserId))
end
end
bind.OnServerInvoke = handlePublish
messagingService:SubscribeAsync("Info", handleSubscribe)
Client:
local function handleSubscribe(method, info)
print(method .. ":" .. "info")
if method == "ga" then
StarterGui:SetCore("ChatMakeSystemMessage", {
Text = ("[Global Announcement] %s"):format(info);
Color = Color3.fromRGB(116, 185, 255);
})
elseif method == "gw" then
StarterGui:SetCore("ChatMakeSystemMessage", {
Text = ("[Global Warning] %s"):format(info);
Color = Color3.fromRGB(255, 118, 117);
})
else
StarterGui:SetCore("ChatMakeSystemMessage", {
Text = ("[Server] %s"):format(info);
Color = Color3.fromRGB(130, 204, 221);
})
end
end
bind.OnClientInvoke = handleSubscribe
“Delivery is best effort and not guaranteed. Make sure to architect your game so delivery failures are not critical.” Due to it saying this on the wiki I’ve tried sending multiple. All tests have definitely been under the 80char limit. I’m quite unsure why it is not sending to other servers (within same game/universe).