Пример #1
0
 private static void HandleClientUpdate(ClientStatusUpdate <EasyAntiCheat.Server.Hydra.Client> clientStatus)
 {
     using (TimeWarning.New("AntiCheatKickPlayer", 10L))
     {
         EasyAntiCheat.Server.Hydra.Client client = clientStatus.get_Client();
         Connection connection = EACServer.GetConnection(client);
         if (connection == null)
         {
             Debug.LogError((object)("EAC status update for invalid client: " + (object)((EasyAntiCheat.Server.Hydra.Client) ref client).get_ClientID()));
         }
         else
         {
             if (EACServer.ShouldIgnore(connection))
             {
                 return;
             }
             if (clientStatus.get_RequiresKick())
             {
                 string message = clientStatus.get_Message();
                 if (string.IsNullOrEmpty(message))
                 {
                     message = clientStatus.get_Status().ToString();
                 }
                 Debug.Log((object)("[EAC] Kicking " + (object)(ulong)connection.userid + " (" + message + ")"));
                 connection.authStatus = (__Null)"eac";
                 ((Network.Server)Net.sv).Kick(connection, "EAC: " + message);
                 DateTime?nullable = new DateTime?();
                 if (clientStatus.IsBanned(ref nullable))
                 {
                     connection.authStatus = (__Null)"eacbanned";
                     Interface.CallHook("OnPlayerBanned", (object)connection, (object)connection.authStatus);
                     ConsoleNetwork.BroadcastToAllClients("chat.add", (object)0, (object)("<color=#fff>SERVER</color> Kicking " + (string)connection.username + " (banned by anticheat)"));
                     if (!nullable.HasValue)
                     {
                         Entity.DeleteBy((ulong)connection.userid);
                     }
                 }
                 EACServer.easyAntiCheat.UnregisterClient(client);
                 EACServer.client2connection.Remove(client);
                 EACServer.connection2client.Remove(connection);
                 EACServer.connection2status.Remove(connection);
             }
             else if (clientStatus.get_Status() == 2)
             {
                 EACServer.OnAuthenticatedLocal(connection);
                 EACServer.easyAntiCheat.SetClientNetworkState(client, false);
             }
             else
             {
                 if (clientStatus.get_Status() != 5)
                 {
                     return;
                 }
                 EACServer.OnAuthenticatedRemote(connection);
             }
         }
     }
 }
Пример #2
0
 private static void HandleClientUpdate(ClientStatusUpdate <EasyAntiCheat.Server.Hydra.Client> clientStatus)
 {
     using (TimeWarning timeWarning = TimeWarning.New("AntiCheatKickPlayer", (long)10))
     {
         EasyAntiCheat.Server.Hydra.Client client = clientStatus.Client;
         Connection connection = EACServer.GetConnection(client);
         if (connection == null)
         {
             Debug.LogError(string.Concat("EAC status update for invalid client: ", client.ClientID));
         }
         else if (!EACServer.ShouldIgnore(connection))
         {
             if (clientStatus.RequiresKick)
             {
                 string message = clientStatus.Message;
                 if (string.IsNullOrEmpty(message))
                 {
                     message = clientStatus.Status.ToString();
                 }
                 Debug.Log(string.Concat(new object[] { "[EAC] Kicking ", connection.userid, " (", message, ")" }));
                 connection.authStatus = "eac";
                 Network.Net.sv.Kick(connection, string.Concat("EAC: ", message));
                 DateTime?nullable = null;
                 if (clientStatus.IsBanned(out nullable))
                 {
                     connection.authStatus = "eacbanned";
                     Interface.CallHook("OnPlayerBanned", connection, connection.authStatus);
                     ConsoleNetwork.BroadcastToAllClients("chat.add", new object[] { 0, string.Concat("<color=#fff>SERVER</color> Kicking ", connection.username, " (banned by anticheat)") });
                     if (!nullable.HasValue)
                     {
                         Entity.DeleteBy(connection.userid);
                     }
                 }
                 EACServer.easyAntiCheat.UnregisterClient(client);
                 EACServer.client2connection.Remove(client);
                 EACServer.connection2client.Remove(connection);
                 EACServer.connection2status.Remove(connection);
             }
             else if (clientStatus.Status == ClientStatus.ClientAuthenticatedLocal)
             {
                 EACServer.OnAuthenticatedLocal(connection);
                 EACServer.easyAntiCheat.SetClientNetworkState(client, false);
             }
             else if (clientStatus.Status == ClientStatus.ClientAuthenticatedRemote)
             {
                 EACServer.OnAuthenticatedRemote(connection);
             }
         }
     }
 }
Пример #3
0
 public static void OnJoinGame(Connection connection)
 {
     if (EACServer.easyAntiCheat == null)
     {
         EACServer.OnAuthenticatedLocal(connection);
         EACServer.OnAuthenticatedRemote(connection);
     }
     else
     {
         EasyAntiCheat.Server.Hydra.Client client = EACServer.easyAntiCheat.GenerateCompatibilityClient();
         EACServer.easyAntiCheat.RegisterClient(client, connection.userid.ToString(), connection.ipaddress, connection.ownerid.ToString(), connection.username, (connection.authLevel > 0 ? PlayerRegisterFlags.PlayerRegisterFlagAdmin : PlayerRegisterFlags.PlayerRegisterFlagNone));
         EACServer.client2connection.Add(client, connection);
         EACServer.connection2client.Add(connection, client);
         EACServer.connection2status.Add(connection, ClientStatus.ClientDisconnected);
         if (EACServer.ShouldIgnore(connection))
         {
             EACServer.OnAuthenticatedLocal(connection);
             EACServer.OnAuthenticatedRemote(connection);
             return;
         }
     }
 }
Пример #4
0
 public static void OnJoinGame(Connection connection)
 {
     if (EACServer.easyAntiCheat != null)
     {
         EasyAntiCheat.Server.Hydra.Client compatibilityClient = EACServer.easyAntiCheat.GenerateCompatibilityClient();
         // ISSUE: explicit non-virtual call
         // ISSUE: explicit non-virtual call
         EACServer.easyAntiCheat.RegisterClient(compatibilityClient, __nonvirtual(connection.userid.ToString()), (string)connection.ipaddress, __nonvirtual(connection.ownerid.ToString()), (string)connection.username, connection.authLevel > 0 ? (PlayerRegisterFlags)1 : (PlayerRegisterFlags)0);
         EACServer.client2connection.Add(compatibilityClient, connection);
         EACServer.connection2client.Add(connection, compatibilityClient);
         EACServer.connection2status.Add(connection, (ClientStatus)0);
         if (!EACServer.ShouldIgnore(connection))
         {
             return;
         }
         EACServer.OnAuthenticatedLocal(connection);
         EACServer.OnAuthenticatedRemote(connection);
     }
     else
     {
         EACServer.OnAuthenticatedLocal(connection);
         EACServer.OnAuthenticatedRemote(connection);
     }
 }