Routing Bucket Integration
FiniAC isolates players in their own routing bucket during from loading screen until the anti-cheat is fully initialised. Using FiniAC:SetPlayerOriginalRoutingBucket ensures FiniAC can properly restore players to their correct bucket after initialisation or security checks.
Why Set Original Routing Bucket?
If your server uses an entry system that isolates new players in a custom routing bucket, you use the FiniAC:SetPlayerOriginalRoutingBucket event to inform FiniAC of routing bucket the player should be returned to. By default FiniAC returns players to the routing bucket they are in during the loading screen.
FiniAC:SetPlayerOriginalRoutingBucket Event
Use this event on the server to set the routing bucket FiniAC should return the player to after they've initialised.
Parameters:
source(string): The player's source IDbucket(number): The routing bucket number
When to use:
- Your server isolates new players in a custom routing bucket
- Your server uses multiple routing buckets for minigames, lobbies, etc.
Usage Examples
lua
-- Example: Server isolates new players in bucket 100
local playerId = source
local queueBucket = 100
-- Set the player's routing bucket
SetPlayerRoutingBucket(playerId, queueBucket)
-- Notify FiniAC of the original bucket so it can restore later
TriggerEvent("FiniAC:SetPlayerOriginalRoutingBucket", tostring(playerId), queueBucket)typescript
// Example: Queue system places player in bucket 100
const playerId: string = source.toString();
const queueBucket: number = 100;
// Set the player's routing bucket
SetPlayerRoutingBucket(playerId, queueBucket);
// Notify FiniAC of the original bucket so it can restore later
emit("FiniAC:SetPlayerOriginalRoutingBucket", playerId, queueBucket);Best Practices
TIP
- Always call this event after setting the player's routing bucket with
SetPlayerRoutingBucket - This is only necessary if you're using custom routing buckets
- The event can only be triggered locally on the server