| | |
| | | // <仙宫Id,玩家Id> 仙宫对应玩家字典
|
| | | public Dictionary<int, List<uint>> allPlayerDict = new Dictionary<int, List<uint>>();
|
| | | // <玩家Id,玩家详细信息> 所有玩家信息字典
|
| | | public Dictionary<uint, CelestialPalacePlayer> allPlayerInfoDict = new Dictionary<uint, CelestialPalacePlayer>();
|
| | | public Dictionary<int, Dictionary<uint, CelestialPalacePlayer>> allPlayerInfoDict = new Dictionary<int, Dictionary<uint, CelestialPalacePlayer>>();
|
| | | // <奖励索引,是否已领取> 奖励领取状态字典
|
| | | public Dictionary<int, bool> xgHaveDict = new Dictionary<int, bool>();
|
| | | // <仙宫Id,是否需要重新查询仙名录> 是否发查仙名录包字典
|
| | |
| | | public void UpdateXiangongNewPlayerInfo(HA927_tagGCXiangongNewPlayerInfo vNetData)
|
| | | {
|
| | | // 更新所有玩家信息字典
|
| | | int xgId = (int)vNetData.XiangongID;
|
| | | if (!allPlayerInfoDict.ContainsKey(xgId))
|
| | | allPlayerInfoDict[xgId] = new Dictionary<uint, CelestialPalacePlayer>();
|
| | |
|
| | | var newPlayerList = vNetData.NewPlayerList;
|
| | | for (int i = 0; i < newPlayerList.Length; i++)
|
| | | {
|
| | | uint playerId = newPlayerList[i].PlayerID;
|
| | | if (!allPlayerInfoDict.ContainsKey(playerId))
|
| | | allPlayerInfoDict[playerId] = new CelestialPalacePlayer();
|
| | | allPlayerInfoDict[playerId].AddTime = newPlayerList[i].AddTime;
|
| | | allPlayerInfoDict[playerId].ServerID = newPlayerList[i].ServerID;
|
| | | allPlayerInfoDict[playerId].PlayerID = newPlayerList[i].PlayerID;
|
| | | allPlayerInfoDict[playerId].Name = newPlayerList[i].Name;
|
| | | allPlayerInfoDict[playerId].LV = newPlayerList[i].LV;
|
| | | allPlayerInfoDict[playerId].Job = newPlayerList[i].Job;
|
| | | allPlayerInfoDict[playerId].RealmLV = newPlayerList[i].RealmLV;
|
| | | allPlayerInfoDict[playerId].EquipShowSwitch = newPlayerList[i].EquipShowSwitch;
|
| | | allPlayerInfoDict[playerId].EquipShowID = newPlayerList[i].EquipShowID;
|
| | | if (!allPlayerInfoDict[xgId].ContainsKey(playerId))
|
| | | allPlayerInfoDict[xgId][playerId] = new CelestialPalacePlayer();
|
| | | allPlayerInfoDict[xgId][playerId].AddTime = newPlayerList[i].AddTime;
|
| | | allPlayerInfoDict[xgId][playerId].ServerID = newPlayerList[i].ServerID;
|
| | | allPlayerInfoDict[xgId][playerId].PlayerID = newPlayerList[i].PlayerID;
|
| | | allPlayerInfoDict[xgId][playerId].Name = newPlayerList[i].Name;
|
| | | allPlayerInfoDict[xgId][playerId].LV = newPlayerList[i].LV;
|
| | | allPlayerInfoDict[xgId][playerId].Job = newPlayerList[i].Job;
|
| | | allPlayerInfoDict[xgId][playerId].RealmLV = newPlayerList[i].RealmLV;
|
| | | allPlayerInfoDict[xgId][playerId].EquipShowSwitch = newPlayerList[i].EquipShowSwitch;
|
| | | allPlayerInfoDict[xgId][playerId].EquipShowID = newPlayerList[i].EquipShowID;
|
| | | }
|
| | |
|
| | | // 更新仙宫对应玩家字典
|
| | | int xgId = (int)vNetData.XiangongID;
|
| | | if (!allPlayerDict.ContainsKey(xgId))
|
| | | allPlayerDict[xgId] = new List<uint>();
|
| | | for (int i = 0; i < newPlayerList.Length; i++)
|
| | |
| | | // 仙宫仙名录玩家信息
|
| | | public void UpdateXiangongRecPlayerInfo(HA928_tagGCXiangongRecPlayerInfo vNetData)
|
| | | {
|
| | | int xgId = (int)vNetData.XiangongID;
|
| | | // 更新所有玩家信息字典
|
| | | if (!allPlayerInfoDict.ContainsKey(xgId))
|
| | | allPlayerInfoDict[xgId] = new Dictionary<uint, CelestialPalacePlayer>();
|
| | |
|
| | | var recPlayerList = vNetData.RecPlayerList;
|
| | | for (int i = 0; i < recPlayerList.Length; i++)
|
| | | {
|
| | | uint playerId = recPlayerList[i].PlayerID;
|
| | | if (!allPlayerInfoDict.ContainsKey(playerId))
|
| | | allPlayerInfoDict[playerId] = new CelestialPalacePlayer();
|
| | | allPlayerInfoDict[playerId].AddTime = recPlayerList[i].AddTime;
|
| | | allPlayerInfoDict[playerId].ServerID = recPlayerList[i].ServerID;
|
| | | allPlayerInfoDict[playerId].PlayerID = recPlayerList[i].PlayerID;
|
| | | allPlayerInfoDict[playerId].Name = recPlayerList[i].Name;
|
| | | allPlayerInfoDict[playerId].LV = recPlayerList[i].LV;
|
| | | allPlayerInfoDict[playerId].Job = recPlayerList[i].Job;
|
| | | allPlayerInfoDict[playerId].RealmLV = recPlayerList[i].RealmLV;
|
| | | if (!allPlayerInfoDict[xgId].ContainsKey(playerId))
|
| | | allPlayerInfoDict[xgId][playerId] = new CelestialPalacePlayer();
|
| | | allPlayerInfoDict[xgId][playerId].AddTime = recPlayerList[i].AddTime;
|
| | | allPlayerInfoDict[xgId][playerId].ServerID = recPlayerList[i].ServerID;
|
| | | allPlayerInfoDict[xgId][playerId].PlayerID = recPlayerList[i].PlayerID;
|
| | | allPlayerInfoDict[xgId][playerId].Name = recPlayerList[i].Name;
|
| | | allPlayerInfoDict[xgId][playerId].LV = recPlayerList[i].LV;
|
| | | allPlayerInfoDict[xgId][playerId].Job = recPlayerList[i].Job;
|
| | | allPlayerInfoDict[xgId][playerId].RealmLV = recPlayerList[i].RealmLV;
|
| | | }
|
| | |
|
| | | // 更新仙宫对应玩家字典
|
| | | int xgId = (int)vNetData.XiangongID;
|
| | |
|
| | | if (!allPlayerDict.ContainsKey(xgId))
|
| | | allPlayerDict[xgId] = new List<uint>();
|
| | | for (int i = 0; i < recPlayerList.Length; i++)
|
| | |
| | | {
|
| | | newPlayerList = new List<uint>();
|
| | | var serverNow = TimeUtility.GetTodayStartTime(); // 获取服务器当前时间的当天0点
|
| | | if (!XiangongConfig.Has(xgId) || allPlayerDict == null || !allPlayerDict.TryGetValue(xgId, out var list) || list == null || allPlayerInfoDict == null)
|
| | | if (!XiangongConfig.Has(xgId) || allPlayerDict == null || !allPlayerDict.TryGetValue(xgId, out var list) || list == null || allPlayerInfoDict == null || !allPlayerInfoDict.TryGetValue(xgId, out var xgInfo) || xgInfo == null)
|
| | | return false;
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (!allPlayerInfoDict.TryGetValue(list[i], out var celestialPalacePlayer) || celestialPalacePlayer == null)
|
| | | if (!xgInfo.TryGetValue(list[i], out var celestialPalacePlayer) || celestialPalacePlayer == null)
|
| | | continue;
|
| | | uint showTimes = (uint)XiangongConfig.Get(xgId).ShowDays;
|
| | | // 获取玩家晋升的时间点,并取该天的开始时间(0点)
|
| | |
| | | public List<CelestialPalacePlayer> GetXGPlayInfo(int xgId)
|
| | | {
|
| | | List<CelestialPalacePlayer> xgPlayerList = new List<CelestialPalacePlayer>();
|
| | | if (allPlayerDict == null || !allPlayerDict.TryGetValue(xgId, out var playerIdList))
|
| | | if (allPlayerDict == null || !allPlayerDict.TryGetValue(xgId, out var playerIdList) || !allPlayerInfoDict.TryGetValue(xgId, out var xgInfo) || xgInfo == null)
|
| | | return xgPlayerList;
|
| | | for (int i = 0; i < playerIdList.Count; i++)
|
| | | {
|
| | | uint playerId = playerIdList[i];
|
| | | if (allPlayerInfoDict == null || !allPlayerInfoDict.TryGetValue(playerId, out var celestialPalacePlayerInfo))
|
| | | if (!xgInfo.TryGetValue(playerId, out var celestialPalacePlayerInfo))
|
| | | continue;
|
| | | xgPlayerList.Add(celestialPalacePlayerInfo);
|
| | | }
|