Skip to main content

Struct RpcRateLimitConfig

Rate limit configuration for an RPC method. Use for no rate limiting, or to configure a token bucket.

Syntax
public struct RpcRateLimitConfig

Fields

IsEnabled

Declaration
public readonly bool IsEnabled

BucketConfig

Declaration
public readonly RateLimitBucket.RefillConfig BucketConfig

Penalty

Declaration
public readonly int Penalty

Methods

Disabled()

No rate limiting for this RPC

Declaration
public static RpcRateLimitConfig Disabled()
Returns
TypeDescription
Mirage.RemoteCalls.RpcRateLimitConfig

Enabled(Single, Int32, Int32, Int32)

Enables rate limiting with the specified token bucket configuration

Declaration
public static RpcRateLimitConfig Enabled(float interval, int refill, int maxTokens, int penalty)
Parameters
TypeNameDescription
System.SingleintervalSeconds between refills
System.Int32refillHow many tokens refilled each interval
System.Int32maxTokensMax number of tokens in bucket
System.Int32penaltyError cost applied to NetworkPlayer's ErrorRateLimit when limit is exceeded
Returns
TypeDescription
Mirage.RemoteCalls.RpcRateLimitConfig