Unofficial CardLife revival project, pronounced like "celery"
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System.Collections;
- using UnityEngine;
-
- namespace CLre_server.API.Synergy
- {
- internal static class CLreEnforcer
- {
- private const float _waitTime = 10.0f;
-
- public static IEnumerator WaitABitForHandshakeThenKick(int playerId)
- {
- float elapsedTime = 0.0f;
- while (elapsedTime < _waitTime)
- {
- yield return null;
- elapsedTime += Time.deltaTime;
- }
- yield return null;
- if (Clients.IsConnected(playerId) && !Clients.IsCLreClient(playerId))
- {
- MainServer.UserVerification.Instance.DisconnectPlayer(playerId);
- }
- }
-
- internal static void Init()
- {
- if (CLre_server.CLre.Config.clre_clients_only)
- {
- MainServer.Server.Instance.PlayerConnect += (_, playerData) =>
- {
- WaitABitForHandshakeThenKick(playerData.PlayerId).Run();
- };
- }
- }
- }
- }
|