How do I allow chat cross-servers?

I’m trying to create a system where players in different servers of the same game could chat with each other. There will be radio channels for that or they could just privately chat. How would I be able to do this?

So, there will have to be a list of channels that players can choose to join and alist of active players that players can choose to private chat.

I know that I can use MessagingService (but I don’t really know how to establish the link between two players)

2 Likes

This is actually a really interesting topic. The only thing that I can think of is the use of datastores but I think there will be an inconsistency since it’s “Live Data”. My buddy made a system where he made a scoreboard for a Sports Bar that was able to change relative to another server at a different game.

1 Like

Yes, I’ve thought of using DataStore as well. But it becomes problematic when you have relatively high max server capacity because of DataStore limits.

But with MessagingService introduced, I think the game would be more efficient to use it. Plus MessagingService is built for exactly this cross-server chat system, but I just couldn’t figure it out how to implement it. I would appreciate it if anyone can shed some light how I could create a list of game-wide players that a player in a server can see, and that they would be able to privately message one of those players in the list.

Another user on the DevForum made this thread explaining how to do something likes this.

1 Like

Yes, I’ve already checked that prior to making this post and it didn’t have any depth related to linking two players in different servers.

(Assuming that these are private messages)
I think what you can do is make a command where it takes in the user’s name and the message, send that data to all the servers via MessagingService, and then uses the SubscribeAsync() function, check if the there’s a player with the same name as the name supplied as the name argument

That could work. Do you have any ideas how I could make a list of active players and active channels (channels will basically be group chats)?

The thread I created inclusively showed you how you can communicate between servers with using MessagingService, if something wasn’t clear feel free to let me know- however you should be able to use the concepts and apply it to the chat relatively easily.

Player Chats > MessagingService Publish > MessagingService Subscribe > Display Message

Send the message, and the username of the player chatting. If you want to get frisky you can also send the color of the users chat name, and display that accordingly as well.