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)
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.
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.
(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
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.
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.