I made a module for helping others calculate the estimated size of their messages based on the estimated bit weight (Rounded up from the tenths place.) If you want to use it the module is posted below. Posting it here so those that are messing with MessagingService can see/use it to ensure their messages are within size constraints before passing them to MessagingService. (All data calculated with the assumption that MessagingService only allows strings with 1kB or less of data to be sent)
Valid UTF-8 characters are string.char(1) through string.char(127)
Example of use:
function Can_Send_Message(Message)
local Weight = WeightModule.Calculate_Byte_Weight(Message) -->“Hello world” = 11.287125
return (Weight<1000)
end
print(Can_Send_Message(“Hello world”)) → true
I agree, the “per universe” limit is worrying. For potentially traffic heavy games, implementing game features with this API is a risky move as if a game spikes in popularity it almost ensures that the feature will be broken.
Perhaps this will be addressed with the “Universe Scripts” feature that’s on the roadmap.
I’ve recently implemented MessagingService into my game to allow for a real time server browser.
However I seem to be getting throttled by sending 20 messages per minute (1 every 5 seconds), which should be well below the stated rate of 150 + 60 * num players per minute and I definitely haven’t reached the game universe limitation.
Real excited to use this service but when will the page for MessagingService be fixed? Had to go scavenging through threads to find documentation for what it provides.
A fair warning to everyone here, I don’t believe that the subscription limit functionality is working correctly (or there is an issue with documentation)
In Vesteria, we create a single subscription for each user when they join, and unsubscribe immediately when they leave. The limit of subscriptions is documented at 5 + 2/user, but with 1 subscription per user we are seeing big spikes in messagingService failures which don’t make sense with our constant usage of the feature. Here’s the errors from today:
The error we get is usually “The game server has reached the allowed limit of active subscriptions”, but it’s a really weird error to get considering we are strictly opening one subscription per player, and we track all subscriptions in a table, removing them only when they have been disconnected, to ensure we don’t have “subscription leak.” Whenever a player leaves, we go through all subscriptions and disconnect the ones that aren’t connected to a player who is currently in the server as an extra level of redundancy.
Had an issue as well with MessagingService throttling yesterday while under the original rate limits, hopefully there may be something like GetRequestBudgetForRequestType() for MessagingService as DataStore does.