Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // C1 06 跨服NPC对话 #tagCMCrossNPCTalk |
| | | |
| | | public class CC106_tagCMCrossNPCTalk : GameNetPackBasic |
| | | { |
| | | public uint ObjID; |
| | | public uint NPCID; |
| | | public ushort PosX; |
| | | public ushort PosY; |
| | | |
| | | public CC106_tagCMCrossNPCTalk() |
| | | { |
| | | combineCmd = (ushort)0x03FE; |
| | | _cmd = (ushort)0xC106; |
| | | } |
| | | |
| | | public override void WriteToBytes() |
| | | { |
| | | WriteBytes(ObjID, NetDataType.DWORD); |
| | | WriteBytes(NPCID, NetDataType.DWORD); |
| | | WriteBytes(PosX, NetDataType.WORD); |
| | | WriteBytes(PosY, NetDataType.WORD); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: de7e7a1d27996e841928dbab57fe1d9f |
| | | timeCreated: 1547469409 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public byte DayPKCount; // 当日已PK次数
|
| | | public byte DayWinCount; // 当日已胜利次数
|
| | | public byte DayBuyCount; // 当日已购买次数
|
| | | public byte DayItemAddCount; // 当日物品增加次数
|
| | |
|
| | | public HC101_tagMCCrossRealmPKPlayerInfo () {
|
| | | _cmd = (ushort)0xC101;
|
| | |
| | | TransBytes (out DayPKCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out DayWinCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out DayBuyCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out DayItemAddCount, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | if (!TryGetValidPos(_clntPos, ref _adjustPos))
|
| | | {
|
| | | Debug.LogErrorFormat("服务端给定坐标: {0} 映射至客户端坐标: {1} 为客户端无法矫正的障碍点...当前地图: {2}",
|
| | | Debug.LogWarningFormat("服务端给定坐标: {0} 映射至客户端坐标: {1} 为客户端无法矫正的障碍点...当前地图: {2}",
|
| | | new Vector2(sPosX, sPosY), new Vector2(_clntPos.x, _clntPos.z), PlayerDatas.Instance.baseData.MapID);
|
| | | return;
|
| | | }
|
| | |
| | | if (onOrOff)
|
| | | {
|
| | | EquipInfo _equipInfo;
|
| | | int _itemID = 4100;
|
| | | int _itemID = 7000;
|
| | |
|
| | | if (!m_EquipDict.TryGetValue((int)RoleEquipType.retFashionClothes, out _equipInfo))
|
| | | {
|
| | | if (!m_EquipDict.TryGetValue((int)RoleEquipType.retClothes, out _equipInfo))
|
| | | {
|
| | | _itemID = 4100;
|
| | | _itemID = 7000;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | _itemID = (int)_equipInfo.itemID;
|
| | | }
|
| | |
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>(_itemID);
|
| | | int _resID = ModelResConfig.GetHandByClothesID(_itemConfig.ChangeOrd);
|
| | | int _resID = 7000;
|
| | | if (_itemID != 7000)
|
| | | {
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>(_itemID);
|
| | | _resID = ModelResConfig.GetHandByClothesID(_itemConfig.ChangeOrd);
|
| | | }
|
| | |
|
| | | if (m_HandModel)
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | m_HandModel = null;
|
| | | HandResID = 0;
|
| | | }
|
| | | }
|
| | |
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | PackModelInterface modelInterface { get { return ModelCenter.Instance.GetModel<PackModelInterface>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | CrossServerOneVsOneModel crossOneVsOneModel { get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); } }
|
| | |
|
| | | public PreciousItem currentShowItem { get; private set; }
|
| | | public event Action showItemRefreshEvent;
|
| | |
| | | {
|
| | | isGetNewItem = false;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= RefreshRealm;
|
| | | CrossServerOneVsOnePlayerInfo.Instance.UpdateMatchNumEvent -= UpdateCrossOneVsOneMatchNum;
|
| | | }
|
| | |
|
| | | public void OnSwitchAccount()
|
| | |
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += RefreshRealm;
|
| | | CrossServerOneVsOnePlayerInfo.Instance.UpdateMatchNumEvent += UpdateCrossOneVsOneMatchNum;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateCrossOneVsOneMatchNum()
|
| | | {
|
| | | if (!TryRemindMatchTick()) return;
|
| | | |
| | | var itemModels = playerPack.GetItemModelsById(PackType.rptItem,1506);
|
| | | if(itemModels != null && itemModels.Count > 0)
|
| | | {
|
| | | var itemModel = itemModels[0];
|
| | | OnGetPreciousItem(PackType.rptItem,itemModel.itemInfo.ItemGUID);
|
| | | }
|
| | | }
|
| | |
|
| | | private bool TryRemindMatchTick()
|
| | | {
|
| | | if (NewBieCenter.Instance.inGuiding || !CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch) return false;
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (remainNum > 0) return false;
|
| | |
|
| | | return true;
|
| | | }
|
| | |
|
| | | private void RefreshRealm(PlayerDataRefresh type)
|
| | | {
|
| | | int realmLv = PlayerDatas.Instance.baseData.realmLevel;
|
| | |
| | |
|
| | | private void ClickBuyTimes()
|
| | | {
|
| | | if(!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching21");
|
| | | return;
|
| | | }
|
| | |
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (remainNum >= crossServerModel.freeMaxMatchNum)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching13");
|
| | | return;
|
| | | }
|
| | | if (!crossServerModel.TryGetBuyMatchTimes()) return;
|
| | |
|
| | | WindowCenter.Instance.Open<CrossSeverOneVsOneBuyMatchTimesWin>();
|
| | | }
|
| | |
| | | return false;
|
| | |
|
| | | }
|
| | |
|
| | | public bool TryGetBuyMatchTimes()
|
| | | {
|
| | | if (!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching21");
|
| | | return false;
|
| | | }
|
| | |
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (remainNum >= freeMaxMatchNum)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("CrossMatching13");
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region 历史记录
|
| | |
| | |
|
| | | public int DayBuyCount { get; private set; } // 当日已购买次数
|
| | |
|
| | | public int DayItemAddCount { get; private set; } // 当日物品增加次数
|
| | |
|
| | | private int preDayPkCount;
|
| | | CrossServerOneVsOneModel crossServerModel { get { return ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>(); } }
|
| | | public event Action UpdatePlayerInfoEvent;
|
| | | public event Action UpdateMatchNumEvent;
|
| | |
|
| | | public void InitData()
|
| | | {
|
| | | preDayPkCount = 0;
|
| | | Score = 0;
|
| | | DanLV = 0;
|
| | | PKCount = 0;
|
| | |
| | | this.PKCount = playerInfo.PKCount;
|
| | | this.WinCount = playerInfo.WinCount;
|
| | | this.CWinCount = playerInfo.CWinCount;
|
| | | this.DayPKCount = playerInfo.DayPKCount;
|
| | | this.DayBuyCount = playerInfo.DayBuyCount;
|
| | | this.DayWinCount = playerInfo.DayWinCount;
|
| | | this.DayItemAddCount = playerInfo.DayItemAddCount;
|
| | | this.DayPKCount = playerInfo.DayPKCount;
|
| | |
|
| | | if (this.preDayPkCount != playerInfo.DayPKCount)
|
| | | {
|
| | | this.preDayPkCount = playerInfo.DayPKCount;
|
| | | if (UpdateMatchNumEvent != null)
|
| | | {
|
| | | UpdateMatchNumEvent();
|
| | | }
|
| | | }
|
| | | |
| | | if (UpdatePlayerInfoEvent != null)
|
| | | {
|
| | | UpdatePlayerInfoEvent();
|
| | |
| | |
|
| | | public int GetDayRemainNum()
|
| | | {
|
| | | int remainNum = DayBuyCount + crossServerModel.freeMaxMatchNum - DayPKCount;
|
| | | int remainNum = DayBuyCount + DayItemAddCount + crossServerModel.freeMaxMatchNum - DayPKCount;
|
| | | return remainNum > 0 ? remainNum : 0;
|
| | | }
|
| | |
|
| | |
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | case 127:
|
| | | int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
|
| | | if (!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch
|
| | | || remainNum > 0)
|
| | | {
|
| | | isReach = false;
|
| | | return isReach;
|
| | | }
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
| | | fashionModel.jumpFashionDress = useItemModel.chinItemModel.EffectValueA1;
|
| | | break;
|
| | | }
|
| | | if (useItemModel.itemId == 951)
|
| | | {
|
| | | int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
| | | int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex);
|
| | | modelInterface.OpenGrid(chooseGridCnt, PackType.rptItem);
|
| | | return;
|
| | | }
|
| | |
|
| | | if(playerPack.CheckIsDrugById(useItemModel.itemInfo.ItemID))
|
| | | switch(useItemModel.chinItemModel.ID)
|
| | | {
|
| | | case 951:
|
| | | int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt;
|
| | | int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex);
|
| | | modelInterface.OpenGrid(chooseGridCnt, PackType.rptItem);
|
| | | return;
|
| | | case 1506:
|
| | | var crossOneVsOneModel = ModelCenter.Instance.GetModel<CrossServerOneVsOneModel>();
|
| | | if (!crossOneVsOneModel.TryGetBuyMatchTimes())
|
| | | {
|
| | | return;
|
| | | }
|
| | | break;
|
| | | }
|
| | | if (playerPack.CheckIsDrugById(useItemModel.itemInfo.ItemID))
|
| | | {
|
| | | if(CheckItemUselimit(useItemModel.chinItemModel))
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | if(itemModel.chinItemModel.Type == 59)
|
| | | {
|
| | | playerPack.SetWashAttrPointModel(itemModel.itemInfo.ItemGUID);
|
| | |
| | | return itemModel;
|
| | | }
|
| | |
|
| | | public List<ItemModel> GetItemModelsById(PackType type, int id)
|
| | | {
|
| | | List<ItemModel> itemModels= null;
|
| | | if (playerPackDict.ContainsKey(type))
|
| | | {
|
| | | var singlePack = playerPackDict[type];
|
| | | singlePack.GetItemCountByID(id,out itemModels);
|
| | | }
|
| | | return itemModels;
|
| | | }
|
| | |
|
| | | public string GetItemGUIDByID(int itemId)
|
| | | {
|
| | | string guid = string.Empty;
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | C0801_tagCNPCTalk _C0801 = new C0801_tagCNPCTalk();
|
| | | _C0801.NPCID = instanceId;
|
| | | _C0801.PosX = (ushort)Posx;
|
| | | _C0801.PosY = (ushort)PosY;
|
| | |
|
| | | if (CrossServerUtility.IsCrossServer())
|
| | | {
|
| | | GameNetSystem.Instance.SendToCrossServer(_C0801);
|
| | | var sendInfo = new CC106_tagCMCrossNPCTalk();
|
| | | sendInfo.ObjID = instanceId;
|
| | | sendInfo.NPCID = (uint)NPcID;
|
| | | sendInfo.PosX = (ushort)Posx;
|
| | | sendInfo.PosY = (ushort)PosY;
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | | else
|
| | | {
|
| | | C0801_tagCNPCTalk _C0801 = new C0801_tagCNPCTalk();
|
| | | _C0801.NPCID = instanceId;
|
| | | _C0801.PosX = (ushort)Posx;
|
| | | _C0801.PosY = (ushort)PosY;
|
| | | GameNetSystem.Instance.SendInfo(_C0801);
|
| | | }
|
| | | }
|
| | |
| | | int rewardNum = model.GetRewardNumber(model.SelectedNow, ID);//已领奖次数
|
| | | int carryOutNum = model.GetCarryOutNum(model.SelectedNow, ID);//已完成次数
|
| | | int number = WeekPartyAction.TotalTimes / WeekPartyAction.SingleTimes;
|
| | | if (number - rewardNum > 0)
|
| | | var RemainingNum = 0;
|
| | | if (WeekPartyAction.TotalTimes - rewardNum > 0)
|
| | | {
|
| | | m_TextA.text = Language.Get("OSA_1", (number - rewardNum));
|
| | | RemainingNum = (WeekPartyAction.TotalTimes - rewardNum) / WeekPartyAction.SingleTimes;
|
| | | }
|
| | | if (WeekPartyAction.TotalTimes -carryOutNum> 0)
|
| | | {
|
| | | m_TextA.text = Language.Get("OSA_1", RemainingNum);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (rewardNum >= number)//已经领完
|
| | | if (rewardNum >= WeekPartyAction.TotalTimes)//已经领完
|
| | | {
|
| | | m_TextNumber.gameObject.SetActive(false);
|
| | | m_Btn.gameObject.SetActive(false);
|
| | |
| | | var WeekPartyAction = model.WeekPartyActionDic[ID];
|
| | | int rewardNum = model.GetRewardNumber(model.SelectedNow, ID);//已领奖次数
|
| | | int carryOutNum = model.GetCarryOutNum(model.SelectedNow, ID);//已完成次数
|
| | | int number = WeekPartyAction.TotalTimes / WeekPartyAction.SingleTimes;
|
| | | int TaypeNumber = 0;
|
| | | if (carryOutNum - rewardNum > 0)
|
| | | {
|
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | WeekPartyDayInfoDic.Clear();
|
| | | WeekPartyDayDic.Clear();
|
| | | WeekPartyActionDic.Clear();
|
| | | isOpenNow = false;
|
| | | isPreviewTime = false;
|
| | | }
|
| | |
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= secondEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += secondEvent;
|
| | | SetRedPoint();
|
| | |
|
| | | }
|
| | |
|
| | | private void secondEvent()
|
| | |
| | | }
|
| | | }
|
| | | GetIsOpen();//判断功能是否开启
|
| | | GetDayNow();
|
| | |
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | Day = 0;
|
| | | }
|
| | | DebugEx.LogError("输出当前的天数" + Day);
|
| | | DayNow = Day;
|
| | | // DebugEx.LogError("输出当前的天数" + Day);
|
| | | if (DayNow != Day && Day<7)
|
| | | {
|
| | | DayNow = Day;
|
| | | if (WeekPartyDayInfoUpdate != null)
|
| | | {
|
| | | WeekPartyDayInfoUpdate();
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | public void SendGetWeekParty(int day, int temdayplateID)//领取周狂欢活动奖励
|
| | |
| | | bool IsBool = IsDayReward(day, type);
|
| | | if (point >= item.NeedPoint && !IsBool)
|
| | | {
|
| | | return RedPointState.Simple;
|
| | | return RedPointState.GetReward;
|
| | | }
|
| | | }
|
| | | for (int i = 0; i < WeekPartyDay.TemplateList.Length; i++)
|
| | |
| | | }
|
| | | if (TaypeNumber > 0 && rewardNum< number)
|
| | | {
|
| | | return RedPointState.Simple;
|
| | | return RedPointState.GetReward;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | SetTextIntegral();
|
| | | OnCreateGridLineCell1(m_ScrollerController1);
|
| | | OnCreateGridLineCell2(m_ScrollerController2); |
| | | if (model.SelectedNow >= 5)
|
| | | {
|
| | | m_ScrollerController1.JumpIndex(5);
|
| | | } |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | }
|
| | | private void WeekPartyDayInfoUpdate()//列表刷新
|
| | | {
|
| | | GetPointRewardObj();//获取积分领奖信息
|
| | | m_ScrollerController1.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | m_ScrollerController2.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | }
|
| | |
| | | int number = WeekPartyAction.TotalTimes / WeekPartyAction.SingleTimes;
|
| | | int rewardNum = model.GetRewardNumber(model.SelectedNow, ID);//已领奖次数
|
| | | int carryOutNum = model.GetCarryOutNum(model.SelectedNow, ID);//已完成次数
|
| | | int TaypeNumber = 0;
|
| | | if (carryOutNum - rewardNum > 0)
|
| | | {
|
| | | TaypeNumber = (carryOutNum - rewardNum) / WeekPartyAction.SingleTimes;
|
| | | }
|
| | | if (TaypeNumber <= 0 && number> rewardNum)
|
| | | if (WeekPartyAction.TotalTimes> rewardNum)
|
| | | {
|
| | | Bool = true;
|
| | | }
|
| | | } |
| | | }
|
| | | return Bool;
|
| | | } |
| | |
| | | if (model.WeekPartyActionDic.ContainsKey(ID))
|
| | | {
|
| | | var WeekPartyAction = model.WeekPartyActionDic[ID];
|
| | | int number = WeekPartyAction.TotalTimes / WeekPartyAction.SingleTimes;
|
| | | int rewardNum = model.GetRewardNumber(model.SelectedNow, ID);//已领奖次数
|
| | | int carryOutNum = model.GetCarryOutNum(model.SelectedNow, ID);//已完成次数
|
| | | if (rewardNum >= number)
|
| | | if (rewardNum >= WeekPartyAction.TotalTimes)
|
| | | {
|
| | | Bool = true;
|
| | | }
|
| | |
| | | }
|
| | | foreach (var key in model.RedPointDic.Keys)//红点选择可领取的天
|
| | | {
|
| | | if (model.RedPointDic[key].state == RedPointState.Simple)
|
| | | if (model.RedPointDic[key].state == RedPointState.GetReward)
|
| | | {
|
| | | model.SelectedNow = key;
|
| | | return;
|