Server-sided ChatService methods to automatically handle the replication of BubbleChatSettings

The brand new Bubble Chat rocks although there’s two areas which would be great to see improved:

1. Replication

Currently Bubble Chat methods are limited solely to the client. This is fine for situations where information is available to the client (such as gamepasses) although not when working with server-exclusive data (such as admin command roles/ranks) which may determine a players chat settings. Having these methods expanded to the server, where customisations are internally replicated to existing and future players, would reduce the workload of many developers significantly.

2. Getters

It’s currently impossible to retrieve the values of existing bubble chat settings, and impossible to update individual settings without writing to all settings. This is vital for third party software such as admin commands where changes by the game developer in addition to its own changes need to be taken into account.


API Proposals

Chat:SetBubbleChatSettings(settings)

Same as the current client method, except could also be called on the server and would replicate to all existing and future clients.


Chat:SetBubbleChatSetting(settingPathway, value)

Same as above (i.e. can be called on both client and server) but only updates an individual setting based upon the settingPathway (a string which defines the setting to update, e.g. "Padding", "BackgroundGradient.Enabled", etc)

To update an individual users setting, you can then do…

Chat:SetBubbleChatSetting("UserSpecificSettings.82347291.TextSize", 100)

Or to update multiple user settings do:

Chat:SetBubbleChatSetting("UserSpecificSettings.82347291", {
	TextSize = 100,
	Font = Enum.Font.SpecialElite,
	Padding = 15,
	etc,
})

Chat:SetUserSpecificBubbleChatSetting(userId, settingPathway, value)

An abstraction of Chat:SetBubbleChatSetting which extends the settingPathway to automatically include the UserSettings[userId] part (i.e. string.format("UserSpecificSettings.%s.%s", userId, settingPathway))

This means you can now do:

Chat:SetUserSpecificBubbleChatSetting(82347291, "TextSize", 100)

Chat:GetBubbleChatSettings()

As the name suggests, retrieves a dictionary of chat settings. Like all other methods in this list, this too would work client and server sided.


Chat:GetUserSpecificBubbleChatSettings(userId)

Similar to above but returns settings.UserSpecificSettings[userId] instead.

24 Likes