Пример #1
0
 public static void OnCreateTeamCopyRoleLog(GameClient client)
 {
     try
     {
         if (ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(client.ClientData.MapCode))
         {
             ZSSLScene mapInfo;
             if (ZhuanShengShiLian.SceneDict.TryGetValue(client.ClientData.FuBenSeqID, out mapInfo))
             {
                 lock (ZhuanShengShiLian.ZhuanShengRunTimeData.Mutex)
                 {
                     BossAttackLog bossAttackLog = mapInfo.AttackLog;
                     if (null != bossAttackLog)
                     {
                         long        tID_Role        = ZhuanShengShiLian.GetGUID(0, client.ClientData.RoleID);
                         long        tID_Team        = ZhuanShengShiLian.GetGUID(client.ClientData.TeamID, client.ClientData.RoleID);
                         BHAttackLog tAttackLog_Role = null;
                         if (bossAttackLog.BHInjure.TryGetValue(tID_Role, out tAttackLog_Role))
                         {
                             bossAttackLog.BHInjure.Remove(tID_Role);
                         }
                         if (null != tAttackLog_Role)
                         {
                             bossAttackLog.BHInjure[tID_Team] = tAttackLog_Role;
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Error, string.Format("ZhuanShengShiLian :: 处理拷贝角色伤害记录异常。", new object[0]), ex, true);
     }
 }
Пример #2
0
        public static int CheckInviteOrApplyTeam(GameClient client, GameClient otherClient)
        {
            int result;

            if (!ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(client.ClientData.MapCode) && !ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(otherClient.ClientData.MapCode))
            {
                result = 0;
            }
            else if (ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(client.ClientData.MapCode) && !ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(otherClient.ClientData.MapCode))
            {
                result = -101;
            }
            else if (!ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(client.ClientData.MapCode) && ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(otherClient.ClientData.MapCode))
            {
                result = -102;
            }
            else if (client.ClientData.FuBenSeqID != otherClient.ClientData.FuBenSeqID)
            {
                result = -101;
            }
            else
            {
                result = 0;
            }
            return(result);
        }
Пример #3
0
 public static void ProcessClearRoleLog(GameClient client)
 {
     try
     {
         if (ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(client.ClientData.MapCode))
         {
             ZSSLScene mapInfo;
             if (ZhuanShengShiLian.SceneDict.TryGetValue(client.ClientData.FuBenSeqID, out mapInfo))
             {
                 long     tID    = ZhuanShengShiLian.GetGUID(client.ClientData.TeamID, client.ClientData.RoleID);
                 int      leader = -1;
                 TeamData td     = GameManager.TeamMgr.FindData(client.ClientData.TeamID);
                 if (null != td)
                 {
                     leader = td.LeaderRoleID;
                 }
                 bool top5Chg = false;
                 lock (ZhuanShengShiLian.ZhuanShengRunTimeData.Mutex)
                 {
                     BossAttackLog bossAttackLog = mapInfo.AttackLog;
                     if (null == bossAttackLog)
                     {
                         return;
                     }
                     BHAttackLog tAttackLog;
                     if (bossAttackLog.BHInjure.TryGetValue(tID, out tAttackLog))
                     {
                         if (leader == -1)
                         {
                             tAttackLog.BHInjure = 0L;
                             bossAttackLog.BHInjure.Remove(tID);
                         }
                         else
                         {
                             long roleInjure = 0L;
                             if (tAttackLog.RoleInjure.TryGetValue(client.ClientData.RoleID, out roleInjure))
                             {
                                 tAttackLog.RoleInjure.Remove(client.ClientData.RoleID);
                                 tAttackLog.BHInjure -= roleInjure;
                                 if (tAttackLog.BHInjure <= 0L)
                                 {
                                     bossAttackLog.BHInjure.Remove(tID);
                                 }
                             }
                         }
                         top5Chg = ZhuanShengShiLian.TrySortAttackRank(bossAttackLog, tAttackLog);
                     }
                 }
                 ZhuanShengShiLian.BroadBossLife(mapInfo, client, top5Chg);
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Error, string.Format("ZhuanShengShiLian :: 处理清除角色伤害记录异常。", new object[0]), ex, true);
     }
 }
Пример #4
0
 public static void ProcessChangeTeamName(GameClient client, bool needBroad = false)
 {
     try
     {
         if (ZhuanShengShiLian.IsZhuanShengShiLianCopyScene(client.ClientData.MapCode))
         {
             ZSSLScene mapInfo;
             if (ZhuanShengShiLian.SceneDict.TryGetValue(client.ClientData.FuBenSeqID, out mapInfo))
             {
                 TeamData td = GameManager.TeamMgr.FindData(client.ClientData.TeamID);
                 if (null != td)
                 {
                     string newName = "";
                     long   tID     = ZhuanShengShiLian.GetGUID(client.ClientData.TeamID, client.ClientData.RoleID);
                     lock (td)
                     {
                         if (td.LeaderRoleID == client.ClientData.RoleID)
                         {
                             return;
                         }
                         TeamMemberData member = td.GetLeader();
                         if (null == member)
                         {
                             return;
                         }
                         newName = member.RoleName;
                     }
                     BHAttackLog tAttackLog;
                     lock (ZhuanShengShiLian.ZhuanShengRunTimeData.Mutex)
                     {
                         if (null == mapInfo.AttackLog)
                         {
                             return;
                         }
                         if (!mapInfo.AttackLog.BHInjure.TryGetValue(tID, out tAttackLog))
                         {
                             return;
                         }
                         tAttackLog.BHName = newName;
                     }
                     if (needBroad)
                     {
                         int  myRank  = mapInfo.AttackLog.BHAttackRank.FindIndex((BHAttackLog x) => object.ReferenceEquals(x, tAttackLog));
                         bool top5Chg = myRank >= 0 && myRank < 5;
                         ZhuanShengShiLian.BroadBossLife(mapInfo, client, top5Chg);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Error, string.Format("ZhuanShengShiLian :: 处理清除角色伤害记录异常。", new object[0]), ex, true);
     }
 }