Anti-flooding

Note: This feature is in Open Beta.

Vivox can help mitigate text message flooding through pre-login value settings. Anti-flooding sets a limit for the text message length as well as the number of text messages sent per second. Use this feature to limit texting rate to prevent channels from being flooded by a player.

If a player attempts to send a text message that exceeds the text message length, the requested message is not sent and an error code reading “The message is too large and cannot be sent” is returned.

Rate limiting is enforced by the Vivox SDK. If a user tries to send messages at a rate higher than allowed, a VxErrorMessageTextRateExceeded error is returned.

vx_req_account_send_msg *req;
vx_req_account_send_msg_create(&req);
req->connector_handle = vx_strdup("c1");
req->account_handle = vx_strdup(".issuer-w-dev.mytestaccountname.");
req->language = vx_strdup(“en-us”);
req->user_uri = vx_strdup("sip:theotheruser@vd1.vivox.com");
req->message_body = vx_strdup("Hey there buddy!");
int status = vx_issue_request2(&req->base); // If rate limiting is surpassed, status = VxErrorMessageTextRateExceeded

Control messaging rates

Message rates are managed through tokens. The tokens are stored in a bucket to limit how many tokens are available at any given moment. You can make changes to the individual token costs of a message as well as the size of the bucket to control the send rate of messages in your game.

Prelogin keyExpected value and effect
MaxTextMessageSizeThe maximum length allowed for a single text message to be sent by the client SDK in bytes. The default is 320.
MaxTextMessageRateRate at which users can send messages. The default is 0, meaning there is no limit.
MaxTextMessageBucketSizeMax amount of tokens that will be accumulated. The default value is 5, which means there are a maximum of 5 tokens available.
TextMessageCreditCostToken cost to send a single message. This is subtracted from MaxTextMessageBucketSize every time a message is successfully sent. The default is 1.

You can use MaxTextMessageRate, MaxTextMessageBucketSize, TextMessageCreditCost together to set a non-integer value for the rate limit. In the following example you can send 2 messages before your bucket is empty, each message costs 3 tokens, and it will take 3 seconds for 3 tokens to be put back into the bucket, therefore it can send at a rate of about 1 message every 3 seconds.

MaxTextMessageRate = 1
MaxTextMessageBucketSize = 6
TextMessageCreditCost = 3

To modify these settings from their default, reach out to your Vivox representative.