Esempio n. 1
0
 public static void ProcessHuangChengZhanResult()
 {
     if (Global.GetBangHuiFightingLineID() == GameManager.ServerLineID)
     {
         if (HuangChengZhanStates.None == HuangChengManager.HuangChengZhanState)
         {
             if (HuangChengManager.IsInHuangChengFightingTime())
             {
                 HuangChengManager.HuangChengZhanState     = HuangChengZhanStates.Fighting;
                 HuangChengManager.HuangDiRoleTicks        = TimeUtil.NOW();
                 HuangChengManager.WaitingHuangChengResult = true;
                 HuangChengManager.NotifyAllHuangChengMapInfoData();
                 HuangChengManager.HandleOutMapHuangDiRoleChanging();
             }
         }
         else if (HuangChengManager.IsInHuangChengFightingTime())
         {
             if (HuangChengManager.WaitingHuangChengResult)
             {
                 HuangChengManager.HandleOutMapHuangDiRoleChanging();
                 if (HuangChengManager.HuangDiRoleID > 0)
                 {
                     long ticks = TimeUtil.NOW();
                     if (ticks - HuangChengManager.HuangDiRoleTicks > (long)HuangChengManager.MaxHavingSheLiZhiYuanSecs)
                     {
                         HuangChengManager.WaitingHuangChengResult = false;
                         HuangChengManager.HandleHuangChengResult();
                         HuangChengManager.NotifyAllHuangChengMapInfoData();
                     }
                 }
             }
         }
         else
         {
             HuangChengManager.HuangChengZhanState = HuangChengZhanStates.None;
             if (HuangChengManager.WaitingHuangChengResult)
             {
                 HuangChengManager.WaitingHuangChengResult = false;
                 HuangChengManager.HandleHuangChengResult();
                 HuangChengManager.NotifyAllHuangChengMapInfoData();
             }
         }
     }
 }
Esempio n. 2
0
        public static void HandleDeadHuangDiRoleChanging(GameClient client)
        {
            if (null != client)
            {
                if (client.ClientData.RoleID != HuangChengManager.HuangDiRoleID)
                {
                    return;
                }
                if (2 != JunQiManager.GetLingDiIDBy2MapCode(client.ClientData.MapCode))
                {
                    return;
                }
                if (!HuangChengManager.IsInHuangChengFightingTime())
                {
                    return;
                }
                if (!HuangChengManager.WaitingHuangChengResult)
                {
                    return;
                }
            }
            int oldHuangDiRoleID = 0;

            lock (HuangChengManager.SheLiZhiYuanMutex)
            {
                oldHuangDiRoleID = HuangChengManager.ProcessTakeSheLiZhiYuan(0, "", "", true);
            }
            if (oldHuangDiRoleID > 0)
            {
                GameClient oldClient = GameManager.ClientMgr.FindClient(oldHuangDiRoleID);
                if (null != oldClient)
                {
                    Global.RemoveBufferData(oldClient, 14);
                }
            }
            GameManager.ClientMgr.NotifyAllChgHuangDiRoleIDMsg(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, oldHuangDiRoleID, HuangChengManager.GetHuangDiRoleID());
            HuangChengManager.NotifyAllHuangChengMapInfoData();
        }