Goals
- I want to make a server browser system
The Issue
- I’m using @DroneMiner967_Gaming 's Protocol system
- Hard to explain, here’s the pseudo-code
- Everything works fine except that the lobby server isn’t receiving any messages. if it does, it’ll print
("RECEIVED MESSAGE FROM GAME: ", [insert random table address])
Lobby Scripts (In lobby server)
Okay, here’s the start game code
function module.StartGame()
warn("SERVER STARTING: jobId"..game.JobId)
-- teleport players to game server
end
Here’s the CrossServerProtocol code
MessagingService:SubscribeAsync("CSProtocol", function(protocol, something)
-- pretend there's a code that gets the sender job id here
if senderJobId == game.JobId then
if protocol == "Multiplayer Server Send Match Data To Lobby" then
warn("RECEIVED MESSAGE FROM GAME: ", data)
end)
Game scripts (In game server)
Here’s the ‘Send message’ script
function CrossServer.SendStringTo(protocol, targetJobId, data)
-- local something =
-- (a string with targetJobId and data encrypted in it)
MessagingService:PublishAsync("CSProtocol", protocol, something)
end
The server setup script
-- pretend I have a data table
-- and the sender job id from teleportData here
warn("MESSAGE SENT"..senderJobId)
CrossServer.SendStringTo(hostJobId,
"Multiplayer Server Send Match Data To Lobby",
-- (pretend there's JSONDecoded data table here)
)
My test results
Lobby Server
Game Server
Test 2
Lobby Server
“SERVER STARTING: jobId”…game.JobId
Game Server
“MESSAGE SENT”…senderJobId
Result
( The game server should appear as a frame in the list)
Also this isn’t the actual picture, no way I’m exporting one picture from my phone to PC just for a post >:^(
Probable cause
- I have a few suspicions;
- MessagingService doesn’t work across different places in the same ‘Experience’
- Reaching allowed limit of active subscription doesn’t let you send messages (which probably isn’t the case)
- It’s not me mispelling the protocol name, I’ve checked like about 7 times now
tl; dr
- help i’m too dumb to figure out how to make server browser system using MessagingService