/// <summary> /// TokenGenerator is used for generate access token when connecting to lobby. /// If token generator is not specified, no token will be used when connecting to lobby. /// For entitlement token verification, use EntitlementTokenGenerator class on the parameter. /// </summary> /// <param name="tokenGenerator"> Token generator for connecting lobby. </param> public void SetConnectionTokenGenerator(ITokenGenerator tokenGenerator) { if (maintainConnectionCoroutine != null) { AccelByteDebug.LogWarning("Can't set connection token generator! Lobby is already connected."); return; } this.tokenGenerator = tokenGenerator; this.tokenGenerator.TokenReceivedEvent += OnTokenReceived; }
/// <summary> /// Set the interval of sending telemetry event to the backend. /// By default it sends the queued events once a minute. /// Should not be less than 5 seconds. /// </summary> /// <param name="interval">The interval between telemetry event.</param> public void SetBatchFrequency(TimeSpan interval) { if (interval >= MINIMUM_INTERVAL_TELEMETRY) { telemetryInterval = interval; } else { AccelByteDebug.LogWarning($"Telemetry schedule interval is too small! Set to {MINIMUM_INTERVAL_TELEMETRY.TotalSeconds} seconds."); telemetryInterval = MINIMUM_INTERVAL_TELEMETRY; } }
/// <summary> /// Change the delay parameters to maintain connection in the websocket. /// </summary> /// <param name="totalTimeout">Time limit until stop to re-attempt</param> /// <param name="backoffDelay">Initial delay time</param> /// <param name="maxDelay">Maximum delay time</param> public void SetRetryParameters(int totalTimeout, int backoffDelay, int maxDelay) { if (maintainConnectionCoroutine != null) { AccelByteDebug.LogWarning("Can't change retry parameters! Lobby is already connected."); return; } this.totalTimeout = totalTimeout; this.backoffDelay = backoffDelay; this.maxDelay = maxDelay; }