Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Monday, October 15, 2018 |
| | | // [ Date ]: Monday, November 12, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public int DataMapID { get ; private set ; } |
| | | public string FBName { get ; private set; } |
| | | public int OpenServerDay { get ; private set ; } |
| | | public int CanEnterTime { get ; private set ; } |
| | | public int DayTimes { get ; private set ; } |
| | | public int DayReKind { get ; private set ; } |
| | |
| | | |
| | | FBName = rawContents[1].Trim(); |
| | | |
| | | OpenServerDay=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | CanEnterTime=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | CanEnterTime=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | DayTimes=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | DayTimes=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | DayReKind=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | |
| | | DayReKind=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; |
| | | WeekTimes=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; |
| | | |
| | | WeekTimes=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | WeekReKind=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | |
| | | WeekReKind=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; |
| | | FBType=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; |
| | | |
| | | FBType=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; |
| | | |
| | | string[] RewardRateStringArray = rawContents[9].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] RewardRateStringArray = rawContents[8].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | RewardRate = new int[RewardRateStringArray.Length]; |
| | | for (int i=0;i<RewardRateStringArray.Length;i++) |
| | | { |
| | | int.TryParse(RewardRateStringArray[i],out RewardRate[i]); |
| | | } |
| | | |
| | | BuyTimesID=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; |
| | | BuyTimesID=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; |
| | | |
| | | ExtraTimesID=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; |
| | | ExtraTimesID=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; |
| | | |
| | | DeathTime=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; |
| | | DeathTime=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; |
| | | |
| | | GuardPick=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; |
| | | GuardPick=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; |
| | | |
| | | DoFight=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0; |
| | | DoFight=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; |
| | | |
| | | HelpPoint=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0; |
| | | HelpPoint=IsNumeric(rawContents[14]) ? int.Parse(rawContents[14]):0; |
| | | |
| | | DelayTime=IsNumeric(rawContents[16]) ? int.Parse(rawContents[16]):0; |
| | | DelayTime=IsNumeric(rawContents[15]) ? int.Parse(rawContents[15]):0; |
| | | |
| | | Movable=IsNumeric(rawContents[17]) ? int.Parse(rawContents[17]):0; |
| | | Movable=IsNumeric(rawContents[16]) ? int.Parse(rawContents[16]):0; |
| | | |
| | | Skillable=IsNumeric(rawContents[18]) ? int.Parse(rawContents[18]):0; |
| | | Skillable=IsNumeric(rawContents[17]) ? int.Parse(rawContents[17]):0; |
| | | |
| | | SelectPlayerable=IsNumeric(rawContents[19]) ? int.Parse(rawContents[19]):0; |
| | | SelectPlayerable=IsNumeric(rawContents[18]) ? int.Parse(rawContents[18]):0; |
| | | |
| | | ExitDescription = rawContents[20].Trim(); |
| | | ExitDescription = rawContents[19].Trim(); |
| | | |
| | | PanelImg = rawContents[21].Trim(); |
| | | PanelImg = rawContents[20].Trim(); |
| | | |
| | | string[] ElixirHintStringArray = rawContents[22].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] ElixirHintStringArray = rawContents[21].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | ElixirHint = new int[ElixirHintStringArray.Length]; |
| | | for (int i=0;i<ElixirHintStringArray.Length;i++) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: bf6b02af80ae8d84c9c211ed6753c6b6 |
| | | timeCreated: 1539589748 |
| | | timeCreated: 1542014433 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, January 30, 2018 |
| | | // [ Date ]: Monday, November 12, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | |
| | | public int ID { get ; private set ; } |
| | | public int DataMapID { get ; private set ; } |
| | | public int OpenServerWeek { get ; private set ; } |
| | | public int OpenServerDay { get ; private set ; } |
| | | public int StartWeekday { get ; private set ; } |
| | | public int StartHour { get ; private set ; } |
| | | public int StartMinute { get ; private set ; } |
| | |
| | | |
| | | DataMapID=IsNumeric(rawContents[1]) ? int.Parse(rawContents[1]):0; |
| | | |
| | | OpenServerWeek=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | StartWeekday=IsNumeric(rawContents[2]) ? int.Parse(rawContents[2]):0; |
| | | |
| | | OpenServerDay=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | StartHour=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | |
| | | StartWeekday=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | StartMinute=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | |
| | | StartHour=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; |
| | | EndWeekday=IsNumeric(rawContents[5]) ? int.Parse(rawContents[5]):0; |
| | | |
| | | StartMinute=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | EndHour=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | |
| | | EndWeekday=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; |
| | | EndMinute=IsNumeric(rawContents[7]) ? int.Parse(rawContents[7]):0; |
| | | |
| | | EndHour=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; |
| | | CanEnter=IsNumeric(rawContents[8]) ? int.Parse(rawContents[8]):0; |
| | | |
| | | EndMinute=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; |
| | | |
| | | CanEnter=IsNumeric(rawContents[10]) ? int.Parse(rawContents[10]):0; |
| | | |
| | | StateValue=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0; |
| | | StateValue=IsNumeric(rawContents[9]) ? int.Parse(rawContents[9]):0; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 129779f57e965b04ea321a2a004eb9ba |
| | | timeCreated: 1517296599 |
| | | timeCreated: 1542014691 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | else
|
| | | {
|
| | | ClearFairyData();
|
| | | LocalChatHistory.Clear(ChatInfoType.Fairy);
|
| | | //Z-xw写
|
| | | playerFairyAuTreasureData._DicfamilyStoreItem.Clear();
|
| | | }
|
| | |
| | | string str = list[Random.Range(0, cnt)].RandomName2;
|
| | | return str;
|
| | | }
|
| | |
|
| | | public static string GetFirstName(ref List<int> randoms)
|
| | | {
|
| | | var list = m_RandomFirstNames;
|
| | | if (randoms.Count == 0)
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | randoms.Add(i);
|
| | | }
|
| | | }
|
| | | var index = Random.Range(0, randoms.Count);
|
| | | var name = list[randoms[index]].RandomName1;
|
| | | randoms.RemoveAt(index);
|
| | | return name;
|
| | | }
|
| | |
|
| | | public static string GetSecondName(ref List<int> randoms)
|
| | | {
|
| | | List<RandomNameConfig> list = null;
|
| | | var name = string.Empty;
|
| | | if (m_RandomNameCfgs.TryGetValue(1, out list))
|
| | | {
|
| | | if (randoms.Count == 0)
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | randoms.Add(i);
|
| | | }
|
| | | }
|
| | | var index = Random.Range(0, randoms.Count);
|
| | | name = list[randoms[index]].RandomName2;
|
| | | randoms.RemoveAt(index);
|
| | | }
|
| | | return name;
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | m_PaymentTable["ProductID"] = "snxxz";
|
| | | m_PaymentTable["OperatorID"] = VersionConfig.Get().appId;
|
| | | m_PaymentTable["RegionName"] = "s" + ServerListCenter.Instance.currentServer.region_flag;
|
| | | // 取玩家区服ID
|
| | | string _region_flag = "s" + PlayerDatas.Instance.baseData.AccID.Split('@')[2];
|
| | | m_PaymentTable["RegionName"] = _region_flag;
|
| | | m_PaymentTable["TimeStamp"] = ((long)(System.DateTime.Now - System.TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1))).TotalSeconds).ToString();
|
| | | m_PaymentTable["Time"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
| | | m_PaymentTable["EventID"] = "12001";
|
| | |
| | | m_Json["roleID"] = PlayerDatas.Instance.baseData.PlayerID;
|
| | | m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName;
|
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV.ToString();
|
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag;
|
| | | m_Json["sid"] = _region_flag;
|
| | | }
|
| | |
|
| | | if (ChannelPlatform == E_ChannelPlatform.Mr)
|
| | |
| | |
|
| | | m_Json["roleID"] = roleID;
|
| | | m_Json["roleName"] = roleName;
|
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag;
|
| | | m_Json["sid"] = "s" + PlayerDatas.Instance.baseData.AccID.Split('@')[2];
|
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
|
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
|
| | | m_Json["level"] = "1";
|
| | |
| | |
|
| | | m_Json["roleID"] = roleID;
|
| | | m_Json["roleName"] = roleName;
|
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag;
|
| | | m_Json["sid"] = "s" + PlayerDatas.Instance.baseData.AccID.Split('@')[2];
|
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
|
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
|
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV;
|
| | |
| | |
|
| | | m_Json["roleID"] = PlayerDatas.Instance.PlayerId.ToString();
|
| | | m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName;
|
| | | m_Json["sid"] = ServerListCenter.Instance.currentServer.region_flag;
|
| | | m_Json["sid"] = "s" + PlayerDatas.Instance.baseData.AccID.Split('@')[2];
|
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
|
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
|
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV;
|
| | |
| | | {
|
| | | CheckActivity();
|
| | | TimeMgr.Instance.OnMinuteEvent -= CheckActivity;
|
| | | TimeMgr.Instance.OnMinuteEvent += CheckActivity; |
| | | TimeMgr.Instance.OnMinuteEvent += CheckActivity;
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ancientRandomName.Clear();
|
| | | firstNameRandoms.Clear();
|
| | | secondNameRandoms.Clear();
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_StageLoad()
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | if (type == (int)DailyQuestType.FairyGrabBoss)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | DailyQuestConfig cfg = Config.Instance.Get<DailyQuestConfig>(type);
|
| | | if (cfg == null)
|
| | | {
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | private bool CheckLimit(int type)
|
| | | public bool CheckLimit(int type)
|
| | | {
|
| | | DailyQuestConfig cfg = Config.Instance.Get<DailyQuestConfig>(type);
|
| | | DailyQuestConfig config = Config.Instance.Get<DailyQuestConfig>(type);
|
| | | switch ((DailyQuestType)type)
|
| | | {
|
| | | case DailyQuestType.FairyGrabBoss:
|
| | |
| | | }
|
| | | break;
|
| | | }
|
| | | if (cfg.UnLockFuncID != 0)
|
| | | if (config.UnLockFuncID != 0)
|
| | | {
|
| | | if (!FuncOpen.Instance.IsFuncOpen(cfg.UnLockFuncID))
|
| | | if (!FuncOpen.Instance.IsFuncOpen(config.UnLockFuncID))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
|
| | | int entertimes = dailyQuestModel.GetDailyQuestCompletedTimes(type);
|
| | | if (dailyQuestModel.GetDailyQuestTotalTimes(cfg.ID) <= entertimes)
|
| | | if (dailyQuestModel.GetDailyQuestTotalTimes(config.ID) <= entertimes)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | public string Icon;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | Dictionary<int, Dictionary<int, string>> ancientRandomName = new Dictionary<int, Dictionary<int, string>>();
|
| | | List<int> firstNameRandoms = new List<int>();
|
| | | List<int> secondNameRandoms = new List<int>();
|
| | | public string GetAncientRobotName(int objId, int npcId)
|
| | | {
|
| | | if (ancientRandomName.ContainsKey(objId)
|
| | | && ancientRandomName[objId].ContainsKey(npcId))
|
| | | {
|
| | | return ancientRandomName[objId][npcId];
|
| | | }
|
| | | var firstName = RandomNameConfig.GetFirstName(ref firstNameRandoms);
|
| | | var secondName = RandomNameConfig.GetSecondName(ref secondNameRandoms);
|
| | | var name = StringUtility.Contact(firstName, secondName);
|
| | | Dictionary<int, string> dict;
|
| | | if (!ancientRandomName.ContainsKey(objId))
|
| | | {
|
| | | dict = new Dictionary<int, string>();
|
| | | dict.Add(npcId, name);
|
| | | ancientRandomName.Add(objId, dict);
|
| | | }
|
| | | else
|
| | | {
|
| | | ancientRandomName[objId].Add(npcId, name);
|
| | | }
|
| | | return name;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | PlayerRealmData.OnPlayerCollectEnd += OnPlayerCollectEnd;
|
| | | SnxxzGame.Instance.AddApplicationOutAction(OnApplicationQuit);
|
| | |
|
| | | var time = bandTime;
|
| | | banTimeArray[0] = time.Year;
|
| | |
| | |
|
| | | public int chatCharacterLimit { get; private set; }
|
| | | public int bugleItem { get; private set; }
|
| | | public bool beforeDungeon { get; private set; }
|
| | | public List<ChatInfoType> chatChannels { get; private set; }
|
| | |
|
| | | public int chatInputLength { get; set; }
|
| | |
| | | repeatCountLimit = int.Parse(config.Numerical2);
|
| | | maliceCheckCount = int.Parse(config.Numerical3);
|
| | | maliceLimitCount = int.Parse(config.Numerical4);
|
| | |
|
| | | config = Config.Instance.Get<FuncConfigConfig>("LocalChatHistoryCount");
|
| | | if (config != null)
|
| | | {
|
| | | LocalChatHistory.localSaveCount = int.Parse(config.Numerical1);
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action<string, bool, bool> UpdateChatValueEvent;
|
| | |
| | | {
|
| | | openChatAfterCollect = false;
|
| | | }
|
| | | if (!beforeDungeon && isDungeon)
|
| | | {
|
| | | LocalChatHistory.Read();
|
| | | }
|
| | | if (beforeDungeon && !isDungeon)
|
| | | {
|
| | | LocalChatHistory.Save();
|
| | | }
|
| | | beforeDungeon = isDungeon;
|
| | | }
|
| | |
|
| | | void ClearAllVoice()
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OnApplicationQuit()
|
| | | {
|
| | | LocalChatHistory.Save();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | content = StringUtility.Contact(content, Language.Get("InviteTeam", vNetData.PlayerID));
|
| | | }
|
| | | chatData = new ChatWorldData(content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | LocalChatHistory.Save(chatData as ChatUeseData);
|
| | | KeepChatInfo(chatData);
|
| | | }
|
| | | /// <summary>
|
| | |
| | | public void RevChatInfo(H0207_tagTalkArea vNetData)
|
| | | {
|
| | | ChatData chatData = new ChatAreaData(vNetData.Content, (int)vNetData.PlayerID, vNetData.SrcName, vNetData.Extras);
|
| | | LocalChatHistory.Save(chatData as ChatUeseData);
|
| | | KeepChatInfo(chatData);
|
| | | }
|
| | | /// <summary>
|
| | |
| | | public void RevChatInfo(HA9A3_tagGCPYSpeakerContent vNetData)
|
| | | {
|
| | | ChatData chatData = new ChatTrumpetData(vNetData.Text, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras, vNetData.SpeakerType, vNetData.AccID);
|
| | | LocalChatHistory.Save(chatData as ChatUeseData);
|
| | | KeepChatInfo(chatData);
|
| | | ServerTipDetails.ShowTrumpetTip(chatData as ChatTrumpetData);
|
| | | }
|
| | |
| | | content = StringUtility.Contact(content, Language.Get("InviteTeam", vNetData.PlayerID));
|
| | | }
|
| | | ChatData chatData = new ChatFamilyData(content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | LocalChatHistory.Save(chatData as ChatUeseData);
|
| | | KeepChatInfo(chatData);
|
| | | ReceiveNewChat(ChatInfoType.Fairy);
|
| | | }
|
| | |
| | | ChatFriendData chatData = new ChatFriendData(vNetData.Content, (int)vNetData.PlayerID, vNetData.SrcName, vNetData.Extras, vNetData.ToName, vNetData.TalkType, vNetData.ToPlayerID);
|
| | | FitterChat(chatData);
|
| | | AddPteChat(chatData);
|
| | | LocalChatHistory.Save(chatData as ChatUeseData);
|
| | | if (chatData.player == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | if (OnRefreshSelf != null)
|
| | |
| | | break;
|
| | | }
|
| | | if (chatData != null)
|
| | | {
|
| | | KeepChatInfo(chatData);
|
| | | }
|
| | | }
|
| | | /// <summary>
|
| | | /// 获取频道聊天数据
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | public void KeepLocalChat(ChatData chat)
|
| | | {
|
| | | if (chat.type == ChatInfoType.Friend)
|
| | | {
|
| | | FitterChat(chat);
|
| | | AddPteChat(chat as ChatFriendData);
|
| | | }
|
| | | else
|
| | | {
|
| | | KeepChatInfo(chat);
|
| | | }
|
| | | }
|
| | |
|
| | | private void KeepChatInfo(ChatData data)
|
| | | {
|
| | | KeepAllTypeChat(data);
|
| | |
| | | data.richText.Append(content.Substring(index, content.Length - index));
|
| | | }
|
| | | if (data.type == ChatInfoType.Friend)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (data.content.Equals(string.Empty))
|
| | | {
|
| | | return true;
|
| | |
| | | chatDics.Clear();
|
| | | chatlist.Clear();
|
| | | chatUpList.Clear();
|
| | | pteChatDics.Clear();
|
| | | if (OnRefreshChat != null)
|
| | | {
|
| | | OnRefreshChat(presentChatType);
|
| | |
| | |
|
| | | public ChatInfoType type { get; protected set; }
|
| | |
|
| | | public DateTime createTime { get; private set; }
|
| | | public DateTime createTime { get; set; }
|
| | |
|
| | | private ChatInfoType m_DetailType = ChatInfoType.World;
|
| | | public ChatInfoType detailType
|
| | |
| | |
|
| | | public class ChatTeamData : ChatUeseData
|
| | | {
|
| | | public ChatTeamData(string content, int player, string name, string extra, ChatInfoType detailType = ChatInfoType.World) : base(content, player, name, extra)
|
| | | public ChatTeamData(string content, int player, string name, string extra, ChatInfoType detailType = ChatInfoType.Team) : base(content, player, name, extra)
|
| | | {
|
| | | type = ChatInfoType.Team;
|
| | | this.detailType = detailType;
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Text;
|
| | | using UnityEngine; |
| | | using System; |
| | | using System.IO;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class LocalChatHistory
|
| | | {
|
| | | public static Dictionary<ChatInfoType, List<string>> chatHistory = new Dictionary<ChatInfoType, List<string>>();
|
| | |
|
| | | const string fileName = "ChatHistory";
|
| | |
|
| | | public static int localSaveCount = 50;
|
| | |
|
| | | static StringBuilder sb = new StringBuilder();
|
| | |
|
| | | public static void Save()
|
| | | {
|
| | | if (!ExistAnyLocalChatHistory())
|
| | | {
|
| | | return;
|
| | | }
|
| | | var playerId = PlayerDatas.Instance.baseData.PlayerID;
|
| | | var path = StringUtility.Contact(Application.persistentDataPath, "//", fileName, "_", playerId, ".log");
|
| | | using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write))
|
| | | {
|
| | | using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8))
|
| | | {
|
| | | foreach (var type in chatHistory.Keys)
|
| | | {
|
| | | var list = chatHistory[type];
|
| | | if (list.Count > 0)
|
| | | {
|
| | | sw.WriteLine(StringUtility.Contact("channel:", (int)type));
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | sw.WriteLine(list[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | Clear();
|
| | | }
|
| | |
|
| | | static bool ExistAnyLocalChatHistory()
|
| | | {
|
| | | foreach (var list in chatHistory.Values)
|
| | | {
|
| | | if (list.Count > 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static void Save<T>(T chat) where T : ChatUeseData
|
| | | {
|
| | | if (null == chat)
|
| | | {
|
| | | return;
|
| | | }
|
| | | switch (chat.type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | case ChatInfoType.Area:
|
| | | case ChatInfoType.Trumpet:
|
| | | case ChatInfoType.Fairy:
|
| | | case ChatInfoType.Friend:
|
| | | if (chat.IsSound && string.IsNullOrEmpty(chat.content))
|
| | | {
|
| | | return;
|
| | | }
|
| | | var jsonString = ChatToString(chat);
|
| | | if (!string.IsNullOrEmpty(jsonString))
|
| | | {
|
| | | List<string> list;
|
| | | if (!chatHistory.TryGetValue(chat.type, out list))
|
| | | {
|
| | | list = new List<string>();
|
| | | chatHistory.Add(chat.type, list);
|
| | | }
|
| | | if (list.Count >= localSaveCount)
|
| | | {
|
| | | list.RemoveAt(0);
|
| | | }
|
| | | list.Add(jsonString);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | static void Save(ChatInfoType type, string line)
|
| | | {
|
| | | if (!string.IsNullOrEmpty(line))
|
| | | {
|
| | | List<string> list;
|
| | | if (!chatHistory.TryGetValue(type, out list))
|
| | | {
|
| | | list = new List<string>();
|
| | | chatHistory.Add(type, list);
|
| | | }
|
| | | if (list.Count >= localSaveCount)
|
| | | {
|
| | | list.RemoveAt(0);
|
| | | }
|
| | | list.Add(line);
|
| | | }
|
| | | }
|
| | |
|
| | | public static string ChatToString(ChatUeseData chat)
|
| | | {
|
| | | switch (chat.type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | case ChatInfoType.Area:
|
| | | case ChatInfoType.Team:
|
| | | case ChatInfoType.Fairy:
|
| | | {
|
| | | LocalChat localChat = new LocalChat();
|
| | | localChat.type = chat.type;
|
| | | localChat.player = chat.player;
|
| | | localChat.name = chat.name;
|
| | | localChat.extra = chat.extra;
|
| | | localChat.content = chat.content;
|
| | | localChat.time = chat.createTime;
|
| | | return LitJson.JsonMapper.ToJson(localChat);
|
| | | }
|
| | | case ChatInfoType.Trumpet:
|
| | | {
|
| | | var chatTrumpet = chat as ChatTrumpetData;
|
| | | LocalTrumpetChat localChat = new LocalTrumpetChat();
|
| | | localChat.player = chat.player;
|
| | | localChat.name = chat.name;
|
| | | localChat.extra = chat.extra;
|
| | | localChat.content = chat.content;
|
| | | localChat.speakType = chatTrumpet.speakType;
|
| | | localChat.accId = chatTrumpet.accId;
|
| | | localChat.time = chat.createTime;
|
| | | return LitJson.JsonMapper.ToJson(localChat);
|
| | | }
|
| | | case ChatInfoType.Friend:
|
| | | {
|
| | | var chatFriend = chat as ChatFriendData;
|
| | | LocalFriendChat localChat = new LocalFriendChat();
|
| | | localChat.player = chat.player;
|
| | | localChat.name = chat.name;
|
| | | localChat.extra = chat.extra;
|
| | | localChat.toName = chatFriend.toName;
|
| | | localChat.toPlayer = chatFriend.toPlayer;
|
| | | localChat.talkType = chatFriend.talkType;
|
| | | localChat.content = chat.content;
|
| | | localChat.time = chat.createTime;
|
| | | return LitJson.JsonMapper.ToJson(localChat);
|
| | | }
|
| | | }
|
| | | return string.Empty;
|
| | | }
|
| | |
|
| | | public static void Read()
|
| | | {
|
| | | Clear();
|
| | | var playerId = PlayerDatas.Instance.baseData.PlayerID;
|
| | | var path = StringUtility.Contact(Application.persistentDataPath, "//", fileName, "_", playerId, ".log");
|
| | | if (!File.Exists(path))
|
| | | {
|
| | | return;
|
| | | }
|
| | | using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read))
|
| | | {
|
| | | using (StreamReader sr = new StreamReader(fs, Encoding.UTF8))
|
| | | {
|
| | | ChatInfoType type = ChatInfoType.World;
|
| | | while (!sr.EndOfStream)
|
| | | {
|
| | | try
|
| | | {
|
| | | var line = sr.ReadLine();
|
| | | if (line.StartsWith("channel"))
|
| | | {
|
| | | type = (ChatInfoType)int.Parse(line.Split(':')[1]);
|
| | | continue;
|
| | | }
|
| | | if (type == ChatInfoType.Fairy)
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.Family == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | ChatData chat = null;
|
| | | switch (type)
|
| | | {
|
| | | case ChatInfoType.World:
|
| | | case ChatInfoType.Area:
|
| | | case ChatInfoType.Team:
|
| | | case ChatInfoType.Fairy:
|
| | | {
|
| | | LocalChat localChat = LitJson.JsonMapper.ToObject<LocalChat>(line);
|
| | | if (type == ChatInfoType.World)
|
| | | {
|
| | | chat = new ChatWorldData(localChat.content, localChat.player, localChat.name, localChat.extra);
|
| | | }
|
| | | else if (type == ChatInfoType.Area)
|
| | | {
|
| | | chat = new ChatAreaData(localChat.content, localChat.player, localChat.name, localChat.extra);
|
| | | }
|
| | | else if (type == ChatInfoType.Team)
|
| | | {
|
| | | chat = new ChatTeamData(localChat.content, localChat.player, localChat.name, localChat.extra);
|
| | | }
|
| | | else if (type == ChatInfoType.Fairy)
|
| | | {
|
| | | chat = new ChatFamilyData(localChat.content, localChat.player, localChat.name, localChat.extra);
|
| | | }
|
| | | chat.createTime = localChat.time;
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Trumpet:
|
| | | {
|
| | | LocalTrumpetChat localChat = LitJson.JsonMapper.ToObject<LocalTrumpetChat>(line);
|
| | | chat = new ChatTrumpetData(localChat.content, localChat.player, localChat.name,
|
| | | localChat.extra, localChat.speakType, localChat.accId);
|
| | | chat.createTime = localChat.time;
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Friend:
|
| | | {
|
| | | LocalFriendChat localChat = LitJson.JsonMapper.ToObject<LocalFriendChat>(line);
|
| | | chat = new ChatFriendData(localChat.content, localChat.player, localChat.name,
|
| | | localChat.extra, localChat.toName, localChat.talkType, (uint)localChat.toPlayer);
|
| | | chat.createTime = localChat.time;
|
| | | }
|
| | | break;
|
| | | }
|
| | | if (chat != null)
|
| | | {
|
| | | ChatCtrl.Inst.KeepLocalChat(chat);
|
| | | }
|
| | | Save(type, line);
|
| | | }
|
| | | catch (Exception e)
|
| | | {
|
| | | DebugEx.Log(e.Message);
|
| | | continue;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public static void Clear(ChatInfoType type)
|
| | | {
|
| | | if (chatHistory.ContainsKey(type))
|
| | | {
|
| | | chatHistory.Remove(type);
|
| | | }
|
| | | }
|
| | |
|
| | | public static void Clear()
|
| | | {
|
| | | chatHistory.Clear();
|
| | | }
|
| | |
|
| | | public struct LocalChat
|
| | | {
|
| | | public ChatInfoType type;
|
| | | public DateTime time;
|
| | | public int player;
|
| | | public string name;
|
| | | public string extra;
|
| | | public string content;
|
| | | }
|
| | |
|
| | | public struct LocalFriendChat
|
| | | {
|
| | | public DateTime time;
|
| | | public int player;
|
| | | public string name;
|
| | | public string extra;
|
| | | public string content;
|
| | | public string toName;
|
| | | public byte talkType;
|
| | | public int toPlayer;
|
| | | }
|
| | |
|
| | | public struct LocalTrumpetChat
|
| | | {
|
| | | public DateTime time;
|
| | | public int player;
|
| | | public string name;
|
| | | public string extra;
|
| | | public string content;
|
| | | public byte speakType;
|
| | | public string accId;
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 518a87d1c24619f4b855261679120f6b |
| | | timeCreated: 1541992350 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | DropItemManager.pickUpCallBack -= OnPickItem;
|
| | | MainInterfaceWin.Event_Duplicates -= OnChangeFuncBtnPosEvent;
|
| | | model.dungeonCoolDownEvent -= OnLeaveMapTimeEvent;
|
| | |
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | if (mapId != 31250)
|
| | | {
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | try
|
| | | {
|
| | | if (mapConfig != null && mapConfig.MapFBType != (int)MapType.OpenCountry)
|
| | | {
|
| | | throw new NullReferenceException();
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.Log(ex);
|
| | | var content = StringUtility.Contact("当前地图:", PlayerDatas.Instance.baseData.MapID, ";堆栈信息:", ex.StackTrace);
|
| | | ExceptionCatcher.ReportException("副本战斗界面异常关闭", content);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | [SerializeField] ElderGodAngerBehaviour m_ElderGodAnger;
|
| | | [SerializeField] Transform m_ContainerPlayer;
|
| | | [SerializeField] PlayerLifeBar m_PlayerLifeBar;
|
| | | [SerializeField] FairyGrabBossBuffTip m_FairyGrabBossBuffTip;
|
| | |
|
| | | public static uint currentBossInstanceId = 0;
|
| | | public static uint currentPlayerInstanceId = 0;
|
| | |
| | |
|
| | | m_ContainerPlayer.gameObject.SetActive(false);
|
| | | m_ContainerBoss.gameObject.SetActive(true);
|
| | | m_FairyGrabBossBuffTip.Init();
|
| | |
|
| | | var boss = GAMgr.Instance.GetBySID(_instanceId) as GActorNpcFight;
|
| | | if (boss != null)
|
| | |
| | | }
|
| | |
|
| | | m_ElderGodAnger.Display(_npcId);
|
| | | m_FairyGrabBossBuffTip.Display(_npcId);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerBoss.gameObject.SetActive(false);
|
| | | m_FairyGrabBossBuffTip.UnInit();
|
| | | currentBossInstanceId = 0;
|
| | | }
|
| | | }
|
| | |
| | | var player = GAMgr.Instance.GetBySID(currentPlayerInstanceId) as GActorPlayerBase;
|
| | | m_ContainerPlayer.gameObject.SetActive(true);
|
| | | m_ContainerBoss.gameObject.SetActive(false);
|
| | | m_FairyGrabBossBuffTip.UnInit();
|
| | |
|
| | | var job = player.ActorInfo.Job;
|
| | | var reincarnationLv = player.ActorInfo.ReincarnationLv;
|
| | |
| | | GlobalTimeEvent.Instance.secondEvent += DisplayTimer;
|
| | | Display();
|
| | | DisplayTimer();
|
| | | //DisplayEffect();
|
| | | DisplayEffect();
|
| | | }
|
| | |
|
| | | public void UnInit()
|
| | |
| | | void Display()
|
| | | {
|
| | | m_CallMember.gameObject.SetActive(CheckCallMember());
|
| | | //DisplayEffect();
|
| | | DisplayEffect();
|
| | | }
|
| | |
|
| | | bool CheckCallMember()
|
| | |
| | | if (seconds <= 0 && m_Timer.gameObject.activeSelf)
|
| | | {
|
| | | m_Timer.gameObject.SetActive(false);
|
| | | //DisplayEffect();
|
| | | DisplayEffect();
|
| | | }
|
| | | else if (seconds > 0)
|
| | | {
|
| | | if (!m_Timer.gameObject.activeSelf)
|
| | | {
|
| | | m_Timer.gameObject.SetActive(true);
|
| | | //DisplayEffect();
|
| | | DisplayEffect();
|
| | | }
|
| | | m_Timer.text = StringUtility.Contact(seconds, Language.Get("RealmWin_Bewrite_35"));
|
| | | }
|
| | |
| | | if (m_Tween.enabled)
|
| | | {
|
| | | m_Tween.enabled = false;
|
| | | m_Tween.transform.localEulerAngles = Vector3.zero;
|
| | | }
|
| | | }
|
| | | else
|
| New file |
| | |
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig;
|
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyGrabBossBuffTip : MonoBehaviour
|
| | | {
|
| | | [SerializeField] Text m_BuffDescription;
|
| | |
|
| | | int selectNpcId = 0;
|
| | |
|
| | | FairyGrabBossModel model
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); }
|
| | | }
|
| | |
|
| | | PlayerBuffDatas buffModel
|
| | | {
|
| | | get { return ModelCenter.Instance.GetModel<PlayerBuffDatas>(); }
|
| | | }
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | PlayerBuffDatas.Even_ObjAddBuf -= AddBuff;
|
| | | PlayerBuffDatas.Even_ObjDelBuff -= DeleteBuff;
|
| | |
|
| | | PlayerBuffDatas.Even_ObjAddBuf += AddBuff;
|
| | | PlayerBuffDatas.Even_ObjDelBuff += DeleteBuff;
|
| | | }
|
| | |
|
| | | public void UnInit()
|
| | | {
|
| | | PlayerBuffDatas.Even_ObjAddBuf -= AddBuff;
|
| | | PlayerBuffDatas.Even_ObjDelBuff -= DeleteBuff;
|
| | | }
|
| | |
|
| | | public void Display(int _npcId)
|
| | | {
|
| | | selectNpcId = _npcId;
|
| | | DisplayBuff();
|
| | | }
|
| | |
|
| | | private void DisplayBuff()
|
| | | {
|
| | | bool isFairyGrabBoss = model.bosses.Contains(selectNpcId);
|
| | | var reduceInjuryBuffId = 0;
|
| | | if (isFairyGrabBoss)
|
| | | {
|
| | | var buffDict = buffModel._BuffDic;
|
| | | if (buffDict != null)
|
| | | {
|
| | | foreach (var buffData in buffDict.Values)
|
| | | {
|
| | | if (model.reduceInjuryBuffId == buffData.SkillTypeID
|
| | | && buffData.SkillID > reduceInjuryBuffId)
|
| | | {
|
| | | reduceInjuryBuffId = buffData.SkillID;
|
| | | }
|
| | | }
|
| | | }
|
| | | var config = Config.Instance.Get<SkillConfig>(reduceInjuryBuffId);
|
| | | if (config != null)
|
| | | {
|
| | | m_BuffDescription.text = Language.Get("FairyGrabBossDeBuff", config.EffectValue11 / 100);
|
| | | }
|
| | | }
|
| | | this.gameObject.SetActive(isFairyGrabBoss && reduceInjuryBuffId != 0);
|
| | | }
|
| | |
|
| | | private void DeleteBuff()
|
| | | {
|
| | | DisplayBuff();
|
| | | }
|
| | |
|
| | | private void AddBuff()
|
| | | {
|
| | | DisplayBuff();
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 02fac49a82d1f084db2a67ae6aaf9ce4 |
| | | timeCreated: 1541576034 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | public int cacheGotoBossId { get; private set; }
|
| | |
|
| | | public int reduceInjuryBuffId { get; private set; }
|
| | |
|
| | | private bool serverInited = false;
|
| | | //private DateTime lastQueryProgressTime = DateTime.Now;
|
| | |
|
| | |
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | PlayerDeadModel deadModel { get { return ModelCenter.Instance.GetModel<PlayerDeadModel>(); } }
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | deadModel.AllPlayerDieEvent += PlayerDieEvent;
|
| | | deadModel.AllPlayerRebornEvent += AllPlayerRebornEvent;
|
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += WindowAfterCloseEvent;
|
| | | NewBieCenter.Instance.guideCompletedEvent += GuideCompletedEvent;
|
| | | TreasureNewGotWin.CloseTreasureNewGotWinEvent += CloseTreasureNewGotWinEvent;
|
| | | OpenServerActivityCenter.Instance.Register(13, this);
|
| | | }
|
| | |
|
| | |
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | deadModel.AllPlayerDieEvent -= PlayerDieEvent;
|
| | | deadModel.AllPlayerRebornEvent -= AllPlayerRebornEvent;
|
| | | WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterOpenEvent;
|
| | | NewBieCenter.Instance.guideCompletedEvent -= GuideCompletedEvent;
|
| | | TreasureNewGotWin.CloseTreasureNewGotWinEvent -= CloseTreasureNewGotWinEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterCloseEvent;
|
| | | }
|
| | |
|
| | | private void AllPlayerRebornEvent(H0419_tagPlayerReborn package)
|
| | |
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | {
|
| | | grabBossHintOpen = false;
|
| | | notified = false;
|
| | | fairyGrabBossHelps.Clear();
|
| | | ClearGrabBossInfo();
|
| | | }
|
| | |
| | | gotoBossStateUpdate();
|
| | | }
|
| | | }
|
| | | if (serverInited)
|
| | | {
|
| | | notified = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenNotifyWin());
|
| | | }
|
| | | RecheckGrabBoss();
|
| | | if (stateUpdate != null)
|
| | |
| | | {
|
| | | noticeSessions = int.Parse(config.Numerical1);
|
| | | }
|
| | | config = Config.Instance.Get<FuncConfigConfig>("FairyGrabBossBuff");
|
| | | reduceInjuryBuffId = int.Parse(config.Numerical1);
|
| | | }
|
| | |
|
| | | public bool TryGetDropItems(int bossId, out List<Item> dropItems)
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | #region Boss争夺战活动开始通知
|
| | | public bool notified { get; private set; }
|
| | |
|
| | | private void WindowAfterOpenEvent(Window win)
|
| | | {
|
| | | if (win is MainInterfaceWin)
|
| | | {
|
| | | if (CheckNotifyFairyGrabBossOpen())
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenNotifyWin());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void WindowAfterCloseEvent(Window win)
|
| | | {
|
| | | if (win is LoginAdWin || win is OffLineOnHookWin)
|
| | | {
|
| | | if (CheckNotifyFairyGrabBossOpen())
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenNotifyWin());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_OpenNotifyWin()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS600;
|
| | | TryOpenFairyGrabBossNotifyWin();
|
| | | }
|
| | |
|
| | | void TryOpenFairyGrabBossNotifyWin()
|
| | | {
|
| | | if (CheckNotifyFairyGrabBossOpen())
|
| | | {
|
| | | notified = true;
|
| | | WindowCenter.Instance.Open<FairyGrabBossOpenWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | private void GuideCompletedEvent(int obj)
|
| | | {
|
| | | if (CheckNotifyFairyGrabBossOpen())
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenNotifyWin());
|
| | | }
|
| | | }
|
| | |
|
| | | private void CloseTreasureNewGotWinEvent()
|
| | | {
|
| | | if (CheckNotifyFairyGrabBossOpen())
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenNotifyWin());
|
| | | }
|
| | | }
|
| | |
|
| | | private bool CheckNotifyFairyGrabBossOpen()
|
| | | {
|
| | | if (notified)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var activityModel = ModelCenter.Instance.GetModel<ActivityModel>();
|
| | | if (activityModel.CheckLimit((int)DailyQuestType.FairyGrabBoss))
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID);
|
| | | if (mapConfig == null || mapConfig.MapFBType != 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (treasureModel.newGotShowing)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (WindowCenter.Instance.IsOpen<OffLineOnHookWin>())
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (WindowCenter.Instance.ExitAnyFullScreenOrMaskWin())
|
| | | {
|
| | | return false;
|
| | | }
|
| | | if (InActivityTime)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | public class FairyGrabBossInfo
|
| | | {
|
| | | public int npcId { get; private set; }
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Wednesday, November 07, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class FairyGrabBossOpenWin : Window
|
| | | {
|
| | | [SerializeField] Button m_Close;
|
| | | [SerializeField] Button m_Goto;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Close.onClick.AddListener(CloseClick);
|
| | | m_Goto.onClick.AddListener(Goto);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | | #endregion
|
| | | private void Goto()
|
| | | {
|
| | | CloseImmediately();
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FairyGrabBoss);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 52ff1f0c7eeab2241bd32a33f925ea49 |
| | | timeCreated: 1541562612 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | //得到单个玩家信息
|
| | | public FriendPlayer GetFirendInfo(int friendId)
|
| | | {
|
| | | FriendPlayer player = null;
|
| | | _socialPlayerDict.TryGetValue((uint)friendId,out player);
|
| | | return player;
|
| | | }
|
| | |
|
| | | //得到所有请求加好友的玩家信息
|
| | | public Dictionary<uint, FriendPlayer> GetFriendQuestDict()
|
| | | {
|
| | |
| | |
|
| | | if (useDefautBackGround)
|
| | | {
|
| | | var sprite = BuiltInLoader.LoadSprite("Launch");
|
| | | var sprite = BuiltInLoader.LoadSprite("Launch_1");
|
| | | m_BackGround.overrideSprite = sprite;
|
| | | m_ContainerMapName.gameObject.SetActive(false);
|
| | | m_ContainerMapDescription.gameObject.SetActive(false);
|
| | |
| | | [SerializeField] FairyGrabBossHelpBehaviour m_FairyGrabBossHelpBehaviour;
|
| | | [SerializeField] DogzNotifyBehaviour m_DogzNotifyBehaviour;
|
| | | [SerializeField] InSevenDayBehavior m_InSevenDayBehavior;
|
| | | [SerializeField] FlashRushToBuyNotify flashRushToBuyNotify;
|
| | |
|
| | | OpenServerActivityNotifyModel activityNotifyModel { get { return ModelCenter.Instance.GetModel<OpenServerActivityNotifyModel>(); } }
|
| | | WorldBossModel worldBossModel { get { return ModelCenter.Instance.GetModel<WorldBossModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | ElderGodAreaModel elderGodAreaModel { get { return ModelCenter.Instance.GetModel<ElderGodAreaModel>(); } }
|
| | |
| | | CheckFairyGrabBossHelp();
|
| | | CheckDogzNotify();
|
| | | InSevenDayShow();
|
| | | CheckFlashRushToBuy();
|
| | | activityNotifyModel.UpdateFlashRushToBuyEvent += CheckFlashRushToBuy;
|
| | | playerPack.RefreshDecomAttrAct += CheckEquipDecompose;
|
| | | betterEquipGetModel.showEquipRefreshEvent += CheckBetterEquip;
|
| | | realmEquipModel.showEquipRefreshEvent += CheckRealmBetterEquip;
|
| | |
| | | realmEquipModel.showEquipRefreshEvent -= CheckRealmBetterEquip;
|
| | | fairyGrabBossModel.fairyGrabBossHelpUpdate -= CheckFairyGrabBossHelp;
|
| | | dogzModel.UpdateDogzPutRedEvent -= CheckDogzNotify;
|
| | | activityNotifyModel.UpdateFlashRushToBuyEvent -= CheckFlashRushToBuy;
|
| | | }
|
| | |
|
| | | private void CheckFlashRushToBuy()
|
| | | {
|
| | | OperationFlashRushToBuy.FlashSaleShop saleShop = null;
|
| | | if (activityNotifyModel.flashSaleShops.Count > 0)
|
| | | {
|
| | | saleShop = activityNotifyModel.flashSaleShops[activityNotifyModel.flashSaleShops.Count - 1];
|
| | | }
|
| | | if (saleShop != null && !activityNotifyModel.closeflashSaleShops.Contains(saleShop))
|
| | | {
|
| | | flashRushToBuyNotify.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | flashRushToBuyNotify.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | private void CheckRealmBetterEquip()
|
| | |
| | | [SerializeField] Button m_SendRedbagBtn;
|
| | | [SerializeField] Button WishingAwardImg;
|
| | | [SerializeField] Button m_GotoFairyGrabBoss;
|
| | | //[SerializeField] Button m_FlyToFairyGrabBoss;
|
| | | [SerializeField] Button m_FlyToFairyGrabBoss;
|
| | |
|
| | | [SerializeField] Transform m_EffectTask;//任务完成特效播放位置
|
| | | private int m_CollectNPCID;
|
| | |
| | | m_SendRedbagBtn.AddListener(SendRedpacketBtn);
|
| | | WishingAwardImg.AddListener(ClickWishAward);
|
| | | m_GotoFairyGrabBoss.AddListener(GotoFairyGrabBoss);
|
| | | //m_FlyToFairyGrabBoss.AddListener(FlyToFairyGrabBoss);
|
| | | m_FlyToFairyGrabBoss.AddListener(FlyToFairyGrabBoss);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | //private void FlyToFairyGrabBoss()
|
| | | //{
|
| | | // if (fairyGrabBossModel.cacheGotoBossId != 0)
|
| | | // {
|
| | | // var error = 0;
|
| | | // if (fairyGrabBossModel.TestEnterDungeon(fairyGrabBossModel.cacheGotoBossId, out error))
|
| | | // {
|
| | | // var bossInfoConfig = Config.Instance.Get<BossInfoConfig>(fairyGrabBossModel.cacheGotoBossId);
|
| | | // var flyItemCount = ModelCenter.Instance.GetModel<PlayerPackModel>().GetItemCountByID(PackType.rptItem, GeneralDefine.flyBootItemId);
|
| | | // var freeFly = ModelCenter.Instance.GetModel<VipModel>().GetVipPrivilegeCnt(VipPrivilegeType.FreeTransfer) > 0;
|
| | | // if (bossInfoConfig != null)
|
| | | // {
|
| | | // if (freeFly || flyItemCount > 0)
|
| | | // {
|
| | | // MapTransferUtility.Instance.MissionFlyTo(bossInfoConfig.MapID, fairyGrabBossModel.cacheGotoBossId);
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // FlyShoseConfirmwin.useEnvironment = FlyShoseConfirmwin.UseEnvironment.FairyGrabBoss;
|
| | | // FlyShoseConfirmwin.confirmCallBack = FlyShoesUseCallback;
|
| | | // WindowCenter.Instance.Open<FlyShoseConfirmwin>();
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // fairyGrabBossModel.DisplayErrorTip(error);
|
| | | // }
|
| | | // }
|
| | | //}
|
| | | private void FlyToFairyGrabBoss()
|
| | | {
|
| | | if (fairyGrabBossModel.cacheGotoBossId != 0)
|
| | | {
|
| | | var error = 0;
|
| | | if (fairyGrabBossModel.TestEnterDungeon(fairyGrabBossModel.cacheGotoBossId, out error))
|
| | | {
|
| | | var bossInfoConfig = Config.Instance.Get<BossInfoConfig>(fairyGrabBossModel.cacheGotoBossId);
|
| | | var flyItemCount = ModelCenter.Instance.GetModel<PlayerPackModel>().GetItemCountByID(PackType.rptItem, GeneralDefine.flyBootItemId);
|
| | | var freeFly = ModelCenter.Instance.GetModel<VipModel>().GetVipPrivilegeCnt(VipPrivilegeType.FreeTransfer) > 0;
|
| | | if (bossInfoConfig != null)
|
| | | {
|
| | | if (freeFly || flyItemCount > 0)
|
| | | {
|
| | | MapTransferUtility.Instance.MissionFlyTo(bossInfoConfig.MapID, fairyGrabBossModel.cacheGotoBossId);
|
| | | }
|
| | | else
|
| | | {
|
| | | FlyShoseConfirmwin.useEnvironment = FlyShoseConfirmwin.UseEnvironment.FairyGrabBoss;
|
| | | FlyShoseConfirmwin.confirmCallBack = FlyShoesUseCallback;
|
| | | WindowCenter.Instance.Open<FlyShoseConfirmwin>();
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | fairyGrabBossModel.DisplayErrorTip(error);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void FlyShoesUseCallback()
|
| | | {
|
| | |
| | | TIP,//信息提示
|
| | | GetWay,//获取途径
|
| | | JOINTEAM,//加入队伍
|
| | | AncientRobotName,//上古战场随机名字
|
| | | }
|
| | |
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.TIP, this);
|
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.GetWay, this);
|
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.JOINTEAM, this);
|
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.AncientRobotName, this);
|
| | | }
|
| | |
|
| | | public override bool Execute(RichTextEventEnum type, RichTextMgr.HrefInfo href)
|
| | |
| | |
|
| | | public override string GetDisplay(RichTextEventEnum type, Dictionary<string, string> dic)
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case RichTextEventEnum.AncientRobotName:
|
| | | {
|
| | | if (dic.ContainsKey("objid") && dic.ContainsKey("npcid"))
|
| | | {
|
| | | var objId = 0;
|
| | | var npcId = 0;
|
| | | if (int.TryParse(dic["objid"], out objId)
|
| | | && int.TryParse(dic["npcid"], out npcId))
|
| | | {
|
| | | var model = ModelCenter.Instance.GetModel<ActivityModel>();
|
| | | return model.GetAncientRobotName(objId, npcId);
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
| | | displayDic.Add(split_value, array[1].ToLower());
|
| | | }
|
| | | break;
|
| | | case "ancientrobotname":
|
| | | {
|
| | | eventType = RichTextEventEnum.AncientRobotName;
|
| | | }
|
| | | break;
|
| | | default:
|
| | | {
|
| | | displayDic.Add(split_value, array[1]);
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | timeText.text = Language.Get("FlashRushToBuy109", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | timeText.text = Language.Get("FlashRushToBuy109", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | timeText.text = Language.Get("FlashRushToBuy106", operation.ToDisplayBuyTime(operationTime.startHour, operationTime.startMinute));
|
| | | }
|
| | | break;
|
| | | case FlashRushToBuyModel.FlashRushToBuySate.Begining:
|
| | |
| | | NewBieCenter.Instance.guideCompletedEvent += GuideCompletedEvent;
|
| | | GlobalTimeEvent.Instance.minuteEvent += UpdateMinute;
|
| | | SetFlashRushToBuyNotify();
|
| | | if(!WindowCenter.Instance.IsOpen<OpenServerActivityNotifyWin>())
|
| | | {
|
| | | WindowCenter.Instance.Open<OpenServerActivityNotifyWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| New file |
| | |
| | | using System;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class OpenServerActivityNotifyWin : Window
|
| | | {
|
| | | [SerializeField] FlashRushToBuyNotify flashRushToBuyNotify;
|
| | | OpenServerActivityNotifyModel activityNotifyModel { get { return ModelCenter.Instance.GetModel<OpenServerActivityNotifyModel>(); } }
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | { |
| | | activityNotifyModel.UpdateFlashRushToBuyEvent += CheckFlashRushToBuy;
|
| | | CheckFlashRushToBuy();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | activityNotifyModel.UpdateFlashRushToBuyEvent -= CheckFlashRushToBuy;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | private void CheckFlashRushToBuy()
|
| | | {
|
| | | OperationFlashRushToBuy.FlashSaleShop saleShop = null;
|
| | | if(activityNotifyModel.flashSaleShops.Count > 0)
|
| | | {
|
| | | saleShop = activityNotifyModel.flashSaleShops[activityNotifyModel.flashSaleShops.Count - 1];
|
| | | }
|
| | | if (saleShop != null && !activityNotifyModel.closeflashSaleShops.Contains(saleShop))
|
| | | {
|
| | | flashRushToBuyNotify.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | flashRushToBuyNotify.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: aa084ec4d5a2ea446b5ec00c0e1cc687 |
| | | timeCreated: 1539422752 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
|
| | | }
|
| | |
|
| | | ActivityModel activityModel { get { return ModelCenter.Instance.GetModel<ActivityModel>(); } }
|
| | |
|
| | | private DungeonOpenTimeConfig _dungeonOpenTimeModel;
|
| | |
|
| | | public bool IsCanReborn { get; private set; }
|
| | |
| | | isKillByPlayer = false;
|
| | | }
|
| | | break;
|
| | | case "RobotKill_1":
|
| | | if (infolist.Count > 1)
|
| | | { |
| | | int objId = int.Parse(infolist[0].ToString());
|
| | | int npcId = int.Parse(infolist[1].ToString());
|
| | | killerName = activityModel.GetAncientRobotName(objId,npcId);
|
| | | isKillByPlayer = false;
|
| | | }
|
| | | |
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return point;
|
| | | }
|
| | |
|
| | | public int GetAllTalentPoint()
|
| | | {
|
| | | var point = 0;
|
| | | var job = (int)Math.Pow(2, PlayerDatas.Instance.baseData.Job);
|
| | | if (jobTalentTypeDict.ContainsKey(job))
|
| | | {
|
| | | var list = jobTalentTypeDict[job];
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | point += GetTalentTypePoint(list[i]);
|
| | | }
|
| | | }
|
| | | return point;
|
| | | }
|
| | |
|
| | | public int GetSeriesPoint(int talentType, int talentSeries)
|
| | | {
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | |
| | | m_SelectSkillIcon.SetSprite(config.IconName);
|
| | | m_SelectSkillLevel.text = StringUtility.Contact(Language.Get("TalentLevel"), talent.level, "/", talent.maxLevel);
|
| | | m_SelectSkillName.text = config.SkillName;
|
| | | m_SelectSkillLevel.color = UIHelper.GetUIColor(talent.level >= talent.maxLevel ? TextColType.Green : TextColType.NavyBrown, true);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | private void ResetPoint()
|
| | | {
|
| | | if (model.GetAllTalentPoint() <= 0)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("NoNeedResetTalentPoint");
|
| | | return;
|
| | | }
|
| | | var count = pack.GetItemCountByID(PackType.rptItem, model.talentResetBook);
|
| | | var config = Config.Instance.Get<ItemConfig>(model.talentResetBook);
|
| | | if (count > 0)
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFunctionStateChange;
|
| | | packageModel.RefreshItemCountAct += OnPackageItemChange;
|
| | | WindowCenter.Instance.windowAfterOpenEvent += OnWindowOpen;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += OnWindowClose;
|
| | | NewBieCenter.Instance.guideCompletedEvent += GuideComplete;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | }
|
| | |
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFunctionStateChange;
|
| | | packageModel.RefreshItemCountAct -= OnPackageItemChange;
|
| | | WindowCenter.Instance.windowAfterOpenEvent -= OnWindowOpen;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= OnWindowClose;
|
| | | StageManager.Instance.onStageLoadFinish -= OnStageLoadFinish;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnWindowClose(Window win)
|
| | | {
|
| | | if (win is LoginAdWin)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenTreasureNewGot());
|
| | | }
|
| | | }
|
| | |
|
| | | void GuideComplete(int _id)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenTreasureNewGot());
|
| | | if (newGotTreasureId != 0)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(Co_OpenTreasureNewGot());
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_OpenTreasureNewGot()
|