예제 #1
0
        public static void BroadCastDetectHook()
        {
            int        index = 0;
            GameClient client;

            while ((client = GameManager.ClientMgr.GetNextClient(ref index, true)) != null)
            {
                if (client != null)
                {
                    FileBanLogic.SendMagicCrashMsg(client, MagicCrashUnityType.DetectHook);
                }
            }
        }
예제 #2
0
 public static void BroadCastDetectHook(List <string> uidList)
 {
     if (uidList != null)
     {
         foreach (string uid in uidList)
         {
             TMSKSocket clientSocket = GameManager.OnlineUserSession.FindSocketByUserID(uid);
             if (null != clientSocket)
             {
                 GameClient client = GameManager.ClientMgr.FindClient(clientSocket);
                 if (client != null)
                 {
                     FileBanLogic.SendMagicCrashMsg(client, MagicCrashUnityType.DetectHook);
                 }
             }
         }
     }
 }
예제 #3
0
 public static void Tick()
 {
     FileBanLogic.LoadBanFile();
     if (null != FileBanLogic.m_BanList)
     {
         if (FileBanLogic.m_IsNeedClear > 0)
         {
             FileBanLogic.m_BanList.Clear();
             FileBanLogic.m_IsNeedClear = 0;
         }
         bool bCrashForce = GameManager.VersionSystemOpenMgr.IsVersionSystemOpen("CrashUnityForce");
         int  i           = 20;
         while (i > 0 && FileBanLogic.m_BanList.Count > 0)
         {
             i--;
             string userID = FileBanLogic.m_BanList[FileBanLogic.m_BanList.Count - 1];
             FileBanLogic.m_BanList.RemoveAt(FileBanLogic.m_BanList.Count - 1);
             BanManager.BanUserID2Memory(userID);
             TMSKSocket clientSocket = GameManager.OnlineUserSession.FindSocketByUserID(userID);
             if (null != clientSocket)
             {
                 GameClient gameClient = GameManager.ClientMgr.FindClient(clientSocket);
                 if (null != gameClient)
                 {
                     RoleData roleData = new RoleData
                     {
                         RoleID = -70
                     };
                     gameClient.sendCmd <RoleData>(104, roleData, false);
                     if (bCrashForce)
                     {
                         FileBanLogic.SendMagicCrashMsg(gameClient, MagicCrashUnityType.CrashTimeOut);
                     }
                     LogManager.WriteLog(LogTypes.FileBan, string.Format("FileBanLogic ban2 userID={0} roleID={1}", userID, gameClient.ClientData.RoleID), null, true);
                 }
                 else
                 {
                     Global.ForceCloseSocket(clientSocket, "被禁止登陆", true);
                     LogManager.WriteLog(LogTypes.FileBan, string.Format("FileBanLogic ForceCloseSocket userID={0}", userID), null, true);
                 }
             }
         }
     }
 }