Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
| | |
| | | string guid = UIHelper.ServerStringTrim(vNetData.GUID); |
| | | canAddPack = false; |
| | | |
| | | Debug.Log("战斗时序 B430 开始处理战斗 " + Time.time); |
| | | //约定 B430 内容(小包1长度WORD + 包1 + 小包2长度WORD + 包2) |
| | | //约定第一个包是B424,先发过来的过滤报错通知 |
| | | try |
| | |
| | | #if UNITY_EDITOR |
| | | string originPack = string.Empty; |
| | | BattleField battleField = BattleManager.Instance.GetBattleField(guid); |
| | | |
| | | |
| | | for (int i = 0; i < vPackList.Count; i++) |
| | | { |
| | | var pack = vPackList[i]; |
| | | |
| | | |
| | | if (pack is HB427_tagSCUseSkill skill) |
| | | { |
| | | string heroName = skill.ObjID.ToString(); |
| | |
| | | heroName = battleObj.teamHero.name; |
| | | } |
| | | } |
| | | |
| | | |
| | | string skillName = SkillConfig.Get((int)skill.SkillID)?.SkillName ?? "Unknown"; |
| | | originPack += $"[{pack.packUID}] HB427_tagSCUseSkill - ObjID:{skill.ObjID} HeroName:{heroName} SkillID:{skill.SkillID} SkillName:{skillName}\n"; |
| | | } |
| | |
| | | vPackList = AnalysisPackQueueAndDistribute(guid, vPackList); |
| | | |
| | | #if UNITY_EDITOR |
| | | if (Launch.Instance.isOpenSkillLogFile) |
| | | { |
| | | string packDetail = "处理前 : " + originPack + "\n"; |
| | | packDetail += "AnalysisPackQueueAndDistribute 处理后的包列表:\n"; |
| | | packDetail += PrintPackListDetail(vPackList, 0, guid); |
| | | if (Launch.Instance.isOpenSkillLogFile) |
| | | { |
| | | string packDetail = "处理前 : " + originPack + "\n"; |
| | | packDetail += "AnalysisPackQueueAndDistribute 处理后的包列表:\n"; |
| | | packDetail += PrintPackListDetail(vPackList, 0, guid); |
| | | |
| | | // 分段打印,避免消息被截断 |
| | | int chunkSize = 15000; // Unity日志单条消息最大长度约16000字符 |
| | | if (packDetail.Length > chunkSize) |
| | | { |
| | | int totalChunks = (packDetail.Length + chunkSize - 1) / chunkSize; |
| | | for (int i = 0; i < totalChunks; i++) |
| | | { |
| | | int startIndex = i * chunkSize; |
| | | int length = Mathf.Min(chunkSize, packDetail.Length - startIndex); |
| | | string chunk = packDetail.Substring(startIndex, length); |
| | | Debug.LogError($"[Part {i + 1}/{totalChunks}]\n{chunk}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError(packDetail); |
| | | } |
| | | // 分段打印,避免消息被截断 |
| | | int chunkSize = 15000; // Unity日志单条消息最大长度约16000字符 |
| | | if (packDetail.Length > chunkSize) |
| | | { |
| | | int totalChunks = (packDetail.Length + chunkSize - 1) / chunkSize; |
| | | for (int i = 0; i < totalChunks; i++) |
| | | { |
| | | int startIndex = i * chunkSize; |
| | | int length = Mathf.Min(chunkSize, packDetail.Length - startIndex); |
| | | string chunk = packDetail.Substring(startIndex, length); |
| | | Debug.LogError($"[Part {i + 1}/{totalChunks}]\n{chunk}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError(packDetail); |
| | | } |
| | | |
| | | // 或者写入文件 |
| | | string filePath = Application.dataPath + "/../BattleReport/PackageAnalysis_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".txt"; |
| | | System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(filePath)); |
| | | System.IO.File.WriteAllText(filePath, packDetail); |
| | | Debug.LogError("包分析结果已保存到: " + filePath); |
| | | } |
| | | // 或者写入文件 |
| | | string filePath = Application.dataPath + "/../BattleReport/PackageAnalysis_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".txt"; |
| | | System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(filePath)); |
| | | System.IO.File.WriteAllText(filePath, packDetail); |
| | | Debug.LogError("包分析结果已保存到: " + filePath); |
| | | } |
| | | #endif |
| | | |
| | | for (int i = 0; i < vPackList.Count; i++) |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B4 31 战斗战报结果 #tagSCTurnFightRet
|
| | |
|
| | | public class DTCB431_tagSCTurnFightRet : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB431_tagSCTurnFightRet vNetData = vNetPack as HB431_tagSCTurnFightRet;
|
| | | BattleSettlementManager.Instance.UpdateSettlementData(vNetData);
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 3a9eccf6a3501c24d89018d298e2cf70 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | Register(typeof(HB119_tagSCModelInfo), typeof(DTCB119_tagSCModelInfo)); |
| | | Register(typeof(HB126_tagSCTitleInfo), typeof(DTCB126_tagSCTitleInfo)); |
| | | Register(typeof(HB127_tagSCChatBoxInfo), typeof(DTCB127_tagSCChatBoxInfo)); |
| | | Register(typeof(HB431_tagSCTurnFightRet), typeof(DTCB431_tagSCTurnFightRet)); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | if (vInts.Length != vLockLeng) |
| | | Array.Resize(ref vInts, vLockLeng); |
| | | this.WriteBytes(vInts, vType); |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | if (vInts.Length != vLockLeng) |
| | | Array.Resize(ref vInts, vLockLeng); |
| | | this.WriteBytes(vInts, vType); |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | if (vWriteLen == StrWriteLen.BYTE) |
| | | this.WriteBytes(new Byte[] { (byte)vInts.Length }); |
| | | else if (vWriteLen == StrWriteLen.WORD) |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | int l = vInts.Length; |
| | | byte[] vRst; |
| | | int i; |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vInts.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | int l = vInts.Length; |
| | | byte[] vRst; |
| | | int i; |
| | |
| | | { |
| | | try |
| | | { |
| | | if (vBytes.IsNullOrEmpty()) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Array.Resize(ref _writedBytes, _writeIndex + vBytes.Length); |
| | | vBytes.CopyTo(_writedBytes, _writeIndex); |
| | | _writeIndex = _writedBytes.Length; |
| New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | // B4 31 战斗战报结果 #tagSCTurnFightRet
|
| | |
|
| | | public class HB431_tagSCTurnFightRet : GameNetPackBasic {
|
| | | public uint MapID; // 自定义地图ID,可用于绑定战斗地图场景功能(如主线boss、爬塔、竞技场等)
|
| | | public uint FuncLineID; // MapID对应的扩展值,如具体某个关卡等
|
| | | public byte TagType; // 目标类型,0-NPC阵容,1-玩家
|
| | | public uint TagID; // 目标类型对应的ID,如玩家ID
|
| | | public byte ValueCount;
|
| | | public uint[] ValueList; // 附加值列表,可选,具体含义由MapID决定
|
| | | public byte IsWin; //是否获胜
|
| | | public ushort AwardLen;
|
| | | public string AwardMsg; //功能结算奖励信息,不含战斗相关统计信息
|
| | | public ushort BatLen;
|
| | | public string BatStatMsg; //战斗相关统计信息
|
| | | public string PathDate; //战报路径日期, yyyyMMdd, 为空时代表公共类的战报,不为空时为玩家个人类战报
|
| | | public string GUID; //战报guid,前端根据功能MapID判断是否跨服功能,是的话从跨服服务器下载战报,否的话从本服下载
|
| | |
|
| | | public HB431_tagSCTurnFightRet () {
|
| | | _cmd = (ushort)0xB431;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out MapID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out FuncLineID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out TagType, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out TagID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ValueCount, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ValueList, vBytes, NetDataType.DWORD, ValueCount);
|
| | | TransBytes (out IsWin, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out AwardLen, vBytes, NetDataType.WORD);
|
| | | TransBytes (out AwardMsg, vBytes, NetDataType.Chars, AwardLen);
|
| | | TransBytes (out BatLen, vBytes, NetDataType.WORD);
|
| | | TransBytes (out BatStatMsg, vBytes, NetDataType.Chars, BatLen);
|
| | | TransBytes (out PathDate, vBytes, NetDataType.Chars, 8);
|
| | | TransBytes (out GUID, vBytes, NetDataType.Chars, 40);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9b2fa2d798559934896c3f09781aa94b |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | }
|
| | | else
|
| | | {
|
| | | Debug.unityLogger.logEnabled = false;
|
| | | Debug.unityLogger.logEnabled = true;
|
| | | }
|
| | |
|
| | | #endif
|
| | |
| | | case CodeA2U.SecretRuleOK: |
| | | { |
| | | IsAgreeSecret = true; |
| | | LocalSave.SetBool("secretToggleStart5", true); |
| | | break; |
| | | } |
| | | case CodeA2U.FreePlatformInitOk: |
| | |
| | | [SerializeField] TextEx txtFuncName; |
| | | [SerializeField] ScrollerController scroller; |
| | | JsonData jsonData; |
| | | string battleName = "ArenaBattleField"; |
| | | string battleName = BattleConst.ArenaBattleField; |
| | | protected override void InitComponent() |
| | | { |
| | | |
| | |
| | | [SerializeField] TextEx txtFuncName; |
| | | [SerializeField] ScrollerController scroller; |
| | | JsonData jsonData; |
| | | string battleName = "ArenaBattleField"; |
| | | string battleName = BattleConst.ArenaBattleField; |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | | UIManager.Instance.CloseWindow<MapLoadingWin>(); |
| | | BattleManager.Instance.onBattleFieldCreate += OnCreateBattleField; |
| | | RegisterBattleEvents(); |
| | | |
| | |
| | | typeof(TianziBillboradBattleWin), |
| | | }; |
| | | |
| | | // 战场名称 |
| | | public const string StoryBattleField = "StoryBattleField"; |
| | | public const string StoryBossBattleField = "StoryBossBattleField"; |
| | | public const string ArenaBattleField = "ArenaBattleField"; |
| | | public const string BoneBattleField = "BoneBattleField"; |
| | | public const string TianziBillboradBattleField = "TianziBillboradBattleField"; |
| | | |
| | | public static Dictionary<string, string> battleNameToWinName = new Dictionary<string, string>() |
| | | { |
| | | { "StoryBattleField", "BattleWin" }, |
| | | { "StoryBossBattleField", "StoryBossBattleWin" }, |
| | | { "ArenaBattleField", "ArenaBattleWin" }, |
| | | { "BoneBattleField", "BoneFieldBattleWin" }, |
| | | { "TianziBillboradBattleField", "TianziBillboradBattleWin" }, |
| | | { StoryBattleField, "BattleWin" }, |
| | | { StoryBossBattleField, "StoryBossBattleWin" }, |
| | | { ArenaBattleField, "ArenaBattleWin" }, |
| | | { BoneBattleField, "BoneFieldBattleWin" }, |
| | | { TianziBillboradBattleField, "TianziBillboradBattleWin" }, |
| | | }; |
| | | |
| | | public static Dictionary<string, int> FieldNameToIndex = new Dictionary<string, int>() |
| | | { |
| | | { "StoryBossBattleField", 1 }, |
| | | { "ArenaBattleField", 2 }, |
| | | { "BoneBattleField", 3}, |
| | | { "TianziBillboradBattleField", 4 }, |
| | | { StoryBossBattleField, 1 }, |
| | | { ArenaBattleField, 2 }, |
| | | { BoneBattleField, 3}, |
| | | { TianziBillboradBattleField, 4 }, |
| | | }; |
| | | |
| | | //和 CreateBattleField 里的对应 |
| | | public static Dictionary<int, string> mapIDToBattleNameDic = new Dictionary<int, string>() |
| | | { |
| | | {1, StoryBattleField}, |
| | | {2, StoryBossBattleField}, |
| | | {3, ArenaBattleField}, |
| | | {30010, BoneBattleField}, |
| | | {30020, TianziBillboradBattleField}, |
| | | }; |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | public override void Run() |
| | | { |
| | | //最低1秒 |
| | | if (Time.time - lastTime < 1f) |
| | | if (Time.time - lastTime < 0.2f) |
| | | return; |
| | | lastTime = Time.time; |
| | | if (AutoFightModel.Instance.isPause) |
| | |
| | | base.Run(); |
| | | if (autoNext) |
| | | { |
| | | if (Time.time - lastTime < 0.2f) |
| | | if (Time.time - lastTime < 0.1f) |
| | | return; |
| | | lastTime = Time.time; |
| | | if (storyBattleField.RequestFight()) |
| | |
| | | pack.ValueCount = (byte)valueList.Length; |
| | | } |
| | | GameNetSystem.Instance.SendInfo(pack); |
| | | Debug.Log("战斗时序 发起 " + Time.time); |
| | | if (mapID != 1) |
| | | { |
| | | UIManager.Instance.OpenWindow<MapLoadingWin>(); |
| | | } |
| | | } |
| | | |
| | | // 获取当前正在显示的战斗场景名称,如果没有则返回空字符串 |
| | |
| | | } |
| | | else |
| | | { |
| | | m_GameId = "xbqy"; |
| | | m_GameId = "xssg"; |
| | | } |
| | | } |
| | | |
| | |
| | | public class VersionUtility : Singleton<VersionUtility> |
| | | { |
| | | public static readonly string[] VERSION_URL = new string[] { |
| | | "http://gamecenter.secondworld.net.cn:11000/center/appversion_new.php/?"}; |
| | | "http://xssgcenter.secondworld.net.cn:11000/center/appversion_new.php/?"}; |
| | | |
| | | public string androidRoot { get { return string.Empty;/*StringUtility.Contact(SDKUtils.Instance.DeviceRootPath, "/", VersionConfig.Get().bundleIdentifier);*/ } } |
| | | |
| | |
| | | { |
| | | if (battleName == null || battleName == string.Empty) |
| | | return; |
| | | if (battleName == "TianziBillboradBattleField") |
| | | if (battleName == BattleConst.TianziBillboradBattleField) |
| | | return; |
| | | if (!IsFuncOpen()) |
| | | return; |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | |
| | | { |
| | | hawkerRect.localPosition = pos2.localPosition; |
| | | } |
| | | hawkerModel.PlayAnimation("idle", true); |
| | | // hawkerModel.PlayAnimation("zoulu", true); |
| | | } |
| | | |
| | | //isShow true走出来,false走出去 |
| | |
| | | FuncNPCManager.Instance.isHawkerShowNow = isShow; |
| | | hawkerModel.PlayAnimation("zoulu", true); |
| | | FuncNPCManager.Instance.isHawkerStandBy = false; |
| | | hawkerModel.transform.localScale = new Vector3(isShow ? hawkerModel.transform.localScale.x : -hawkerModel.transform.localScale.x, hawkerModel.transform.localScale.y, hawkerModel.transform.localScale.z); |
| | | hawkerModel.transform.localScale = new Vector3(isShow ? Math.Abs(hawkerModel.transform.localScale.x) : -Math.Abs(hawkerModel.transform.localScale.x), hawkerModel.transform.localScale.y, hawkerModel.transform.localScale.z); |
| | | hawkerRect.DOLocalMove(isShow ? pos1.localPosition : pos2.localPosition, 1f).onComplete = () => |
| | | { |
| | | hawkerModel.PlayAnimation("idle", true); |
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | int lastGuildBossTime;
|
| | |
|
| | | // 获取公会中的伤害记录做排名
|
| | | public void UpdateGuildBossInfo(HA513_tagMCFamilyActionInfo vNetData)
|
| | | {
|
| | | if (vNetData.ActionType != GuildManager.GuildBossActionType)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | GuildManager.Instance.TryGetFamilyActions(GuildManager.GuildBossActionType, out var familyActions);
|
| | | if (familyActions == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | foreach (var action in familyActions)
|
| | | {
|
| | | if (action.Value1 == 1)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public class PlayerGuildBossAtkInfo
|
| | | {
|
| | | public int playerID;
|
| | | public int atkTime;
|
| | | public int bzTime;
|
| | | public int atkCount;
|
| | | public long totalHurtValue;
|
| | | public int boxCnt;
|
| | |
|
| | | }
|
| | |
|
| | |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | TimeMgr.Instance.OnHourEvent += UpdateZBGRedpoint;
|
| | | }
|
| | | public override void Release()
|
| | | {
|
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | TimeMgr.Instance.OnHourEvent -= UpdateZBGRedpoint;
|
| | | }
|
| | |
|
| | |
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (TimeUtility.ServerNow.Hour < 10)
|
| | | return;
|
| | |
|
| | | if (zhenbaogeCutState == 0)
|
| | | {
|
| New file |
| | |
| | | |
| | | using DG.Tweening; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class MapLoadingWin : UIBase |
| | | { |
| | | [Header("加载地图时长毫秒")] |
| | | public int millSeconds = 1000; |
| | | [Header("超过时长自动关闭毫秒")] |
| | | public int autoCloseMillSeconds = 3000; |
| | | [Header("洞缩小的时长毫秒")] |
| | | public int holeCloseMillSeconds = 1000; |
| | | [SerializeField] Transform fbLoadRect; |
| | | [SerializeField] Image holeLoadImg; |
| | | |
| | | [SerializeField] Transform chapterLoadRect; |
| | | [SerializeField] Text chapterName; |
| | | [SerializeField] Text mapName; |
| | | [SerializeField] Text processText; |
| | | |
| | | |
| | | float showTime = 0; |
| | | int closeTime = 0; |
| | | protected override void OnPreOpen() |
| | | { |
| | | showTime = Time.time; |
| | | |
| | | if (functionOrder == 0) |
| | | { |
| | | fbLoadRect.SetActive(true); |
| | | chapterLoadRect.SetActive(false); |
| | | //副本切换 |
| | | holeLoadImg.SetNativeSize(); |
| | | //holeLoadImg的宽高同比1秒内缩小到0,但是不用scale的方式 |
| | | var rect = holeLoadImg.GetComponent<RectTransform>(); |
| | | rect.DOSizeDelta(new Vector2(0, 0), holeCloseMillSeconds / 1000f); |
| | | closeTime = autoCloseMillSeconds; |
| | | } |
| | | else |
| | | { |
| | | //章节切换 |
| | | chapterLoadRect.SetActive(true); |
| | | fbLoadRect.SetActive(false); |
| | | int num = PlayerDatas.Instance.baseData.ExAttr1 / 10000; |
| | | chapterName.text = Language.Get("MapLoad1", UIHelper.ChineseNumber(num)); |
| | | mapName.text = MainChapterConfig.Get(num).ChapterName; |
| | | processText.text = Language.Get("MapLoad2","0"); |
| | | closeTime = millSeconds; |
| | | } |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | |
| | | protected void LateUpdate() |
| | | { |
| | | var passTime = Time.time - showTime; |
| | | |
| | | if (passTime > closeTime / 1000f) |
| | | { |
| | | CloseWindow(); |
| | | } |
| | | if (functionOrder != 0) |
| | | { |
| | | var num = (int)(passTime*1000 / closeTime * 100) % 100; |
| | | if (num % 6 == 0) |
| | | { |
| | | processText.text = Language.Get("MapLoad2", num); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 757f19ce49125ef4fa60d9c08fe48885 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | //m_WXLogin.SetActive(false); |
| | | |
| | | // 用户协议 todo |
| | | checkRead.isOn = LocalSave.GetBool("tqsecretToggle"); |
| | | checkRead.isOn = LocalSave.GetBool("secretToggleStart5"); |
| | | } |
| | | |
| | | private void OnLoginOk(SDKUtils.FP_LoginOk arg0) |
| | |
| | | if (!checkRead.isOn) |
| | | { |
| | | ConfirmCancel.ShowPopConfirm(Language.Get("agreementTitle"), Language.Get("agreementInfo")); |
| | | LocalSave.SetBool("tqsecretToggle", false); //方便测试 |
| | | LocalSave.SetBool("secretToggleStart5", false); //方便测试 |
| | | return; |
| | | } |
| | | |
| | | LocalSave.SetBool("tqsecretToggle", true); |
| | | LocalSave.SetBool("secretToggleStart5", true); |
| | | |
| | | SDKUtils.Instance.SendHideFloatWin(); |
| | | |
| | |
| | | public class ServerListCenter : Singleton<ServerListCenter> |
| | | |
| | | { |
| | | public static readonly string[] JUMP_URL = new string[] { "http://gamecenter.secondworld.net.cn:11000/center/server_list.php/?" }; |
| | | public static readonly string[] JUMP_URL = new string[] { "http://xssgcenter.secondworld.net.cn:11000/center/server_list.php/?" }; |
| | | |
| | | public static string SERVERLIST_URL_COMMON = ""; |
| | | public static string SERVERLIST_URL_PLAYER = ""; |
| | |
| | | return data.name.Replace("@gm", ""); |
| | | } |
| | | |
| | | // 获取服务器地址 |
| | | public string GetServerUrl(int id, string defaultHead = "http://", int replacePort = 0) |
| | | { |
| | | var data = GetServerDataEx(id); |
| | | if (replacePort > 0) |
| | | { |
| | | return $"{defaultHead}{data.region_domain}:{replacePort}"; |
| | | } |
| | | return $"{defaultHead}{data.region_domain}:{data.login_port}"; |
| | | |
| | | } |
| | | |
| | | public void RequestJumpUrl() |
| | | { |
| | | if (VersionUtility.Instance.InIosAuditTime()) |
| | |
| | | return; |
| | | } |
| | | |
| | | var url = StringUtility.Contact(JUMP_URL[0], "game=xbqy&flag=", VersionConfig.Get().appId, "_", VersionConfig.Get().branch, "_", VersionConfig.Get().version); |
| | | var url = StringUtility.Contact(JUMP_URL[0], "game=xssg&flag=", VersionConfig.Get().appId, "_", VersionConfig.Get().branch, "_", VersionConfig.Get().version); |
| | | jumpUrlIndex++; |
| | | serverUrl = url; |
| | | Debug.Log("http地址:serverlist " + url); |
| | |
| | | { |
| | | [SerializeField] InputField input; |
| | | [SerializeField] Button receiveBtn; |
| | | const string exchangeUrl = "http://gamecenter.secondworld.net.cn:53003/Coupon/CouponCode.php?"; |
| | | const string exchangeUrl = "http://xssgcenter.secondworld.net.cn:53003/Coupon/CouponCode.php?"; |
| | | bool isCool = false; |
| | | float time = 0; |
| | | |
| | |
| | | |
| | | [SerializeField] Button tipEquipBtn; |
| | | [SerializeField] Button tipHeroPosBtn; |
| | | string battleName = "StoryBossBattleField"; |
| | | string battleName = BattleConst.StoryBossBattleField; |
| | | protected override void InitComponent() |
| | | { |
| | | tipEquipBtn.AddListener(() => |
| | |
| | | |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using LitJson; |
| | | using UnityEngine; |
| | | |
| | | public partial class BattleSettlementManager : GameSystemManager<BattleSettlementManager> |
| | | { |
| | | //结算后需清除 <battleName,JsonData> |
| | | Dictionary<string, JsonData> battleSettlementDic = new Dictionary<string, JsonData>(); |
| | | Dictionary<string, JsonData> battleAwardDic = new Dictionary<string, JsonData>(); //B431 另外通报奖励 |
| | | |
| | | |
| | | // public string notifyGuid = string.Empty; |
| | | |
| | |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | battleSettlementDic.Clear(); |
| | | battleAwardDic.Clear(); |
| | | } |
| | | |
| | | public void AddPop(string battleName, int result) |
| | |
| | | bool isWin = result == 1; |
| | | switch (battleName) |
| | | { |
| | | case "ArenaBattleField": |
| | | case BattleConst.ArenaBattleField: |
| | | PopupWindowsProcessor.Instance.Add(isWin ? "ArenaBattleVictoryWin" : "ArenaBattleFailWin", false); |
| | | break; |
| | | case "BoneBattleField": |
| | | case BattleConst.BoneBattleField: |
| | | PopupWindowsProcessor.Instance.Add(isWin ? "BoneBattleVictoryWin" : "BoneBattleFailWin", false); |
| | | break; |
| | | case "TianziBillboradBattleField": |
| | | case BattleConst.TianziBillboradBattleField: |
| | | PopupWindowsProcessor.Instance.Add("TianziBillboradVictoryWin", false); |
| | | break; |
| | | default: |
| | |
| | | bool isWin = result == 1; |
| | | switch (battleName) |
| | | { |
| | | case "ArenaBattleField": |
| | | case BattleConst.ArenaBattleField: |
| | | if (isWin) |
| | | { |
| | | UIManager.Instance.OpenWindow<ArenaBattleVictoryWin>(); |
| | |
| | | UIManager.Instance.OpenWindow<ArenaBattleFailWin>(); |
| | | } |
| | | break; |
| | | case "BoneBattleField": |
| | | case BattleConst.BoneBattleField: |
| | | if (isWin) |
| | | { |
| | | UIManager.Instance.OpenWindow<BoneBattleVictoryWin>(); |
| | |
| | | UIManager.Instance.OpenWindow<BoneBattleFailWin>(); |
| | | } |
| | | break; |
| | | case "TianziBillboradBattleField": |
| | | case BattleConst.TianziBillboradBattleField: |
| | | TianziBillboradManager.Instance.isSweepVictory = false; |
| | | UIManager.Instance.OpenWindow<TianziBillboradVictoryWin>(); |
| | | break; |
| | |
| | | return; |
| | | var battleName = battle.ToString(); |
| | | battleSettlementDic[battleName] = _data; |
| | | if (battleAwardDic.ContainsKey(battleName)) |
| | | { |
| | | //合并战报和结算数据 |
| | | JsonData extendData = battleAwardDic[battleName]; |
| | | foreach (var key in extendData.Keys) |
| | | { |
| | | _data[key] = extendData[key]; |
| | | } |
| | | } |
| | | |
| | | string activeBattleName = BattleManager.Instance.GetActiveBattleName(); |
| | | |
| | |
| | | public void WinShowOver(string battleName) |
| | | { |
| | | battleSettlementDic.Remove(battleName); |
| | | battleAwardDic.Remove(battleName); |
| | | |
| | | var battle = BattleManager.Instance.GetActiveBattleFieldByName(battleName); |
| | | if (battle != null) |
| | |
| | | } |
| | | return battleSettlementDic[battleName]; |
| | | } |
| | | |
| | | public JsonData GetBattleSettlementByMapID(int mapID) |
| | | { |
| | | if (BattleConst.mapIDToBattleNameDic.ContainsKey(mapID)) |
| | | { |
| | | return GetBattleSettlement(BattleConst.mapIDToBattleNameDic[mapID]); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void UpdateSettlementData(HB431_tagSCTurnFightRet netData) |
| | | { |
| | | // 先获得战斗结果,如果需要展示战斗,则请求战报 (如有些跳过战斗表现直接结算) |
| | | bool needBattleData = true; |
| | | var guid = UIHelper.ServerStringTrim(netData.GUID); |
| | | var mapID = (int)netData.MapID; |
| | | JsonData extendData2 = JsonMapper.ToObject(netData.AwardMsg); |
| | | |
| | | battleAwardDic[BattleConst.mapIDToBattleNameDic[mapID]] = extendData2; |
| | | |
| | | if (needBattleData) |
| | | { |
| | | Debug.Log("战斗时序 收到B431 并请求下载战报" + Time.time); |
| | | var date = UIHelper.ServerStringTrim(netData.PathDate); |
| | | RequestTurnFightData(guid, date, mapID); |
| | | } |
| | | else |
| | | { |
| | | JsonData extendData1 = JsonMapper.ToObject(netData.BatStatMsg); |
| | | |
| | | JsonData turnFightStateData = new JsonData(); |
| | | foreach (var key in extendData1.Keys) |
| | | { |
| | | turnFightStateData[key] = extendData1[key]; |
| | | } |
| | | foreach (var key in extendData2.Keys) |
| | | { |
| | | turnFightStateData[key] = extendData2[key]; |
| | | } |
| | | |
| | | EventBroadcast.Instance.Broadcast<string, JsonData>(EventName.BATTLE_END, guid, turnFightStateData); |
| | | } |
| | | |
| | | } |
| | | public void RequestTurnFightData(string guid, string date, int mapID) |
| | | { |
| | | //mobile.secondworld.net.cn:53080\S9006\20251202\3042602\5b11338f-cf2c-11f0-a0a0-000c29b22418.tfr |
| | | var serverID = UIHelper.GetServerIDByAccount(PlayerDatas.Instance.baseData.AccID); |
| | | |
| | | var url = ServerListCenter.Instance.GetServerUrl(serverID); |
| | | string assetVersionUrl = string.Empty; |
| | | |
| | | if (string.IsNullOrEmpty(date)) |
| | | { |
| | | //公共战报 路径: C:\TurnFightReport\S服务器编号\功能地图ID\战报GUID |
| | | assetVersionUrl = $"{url}/S{serverID}/{mapID}/{guid}.tfr"; |
| | | } |
| | | else |
| | | { |
| | | //个人战报 路径: C:\TurnFightReport\S服务器编号\日期\玩家ID\功能地图ID\战报GUID |
| | | assetVersionUrl = $"{url}/S{serverID}/{date}/{PlayerDatas.Instance.baseData.PlayerID}/{mapID}/{guid}.tfr"; |
| | | } |
| | | |
| | | HttpRequest.Instance.UnityWebRequestTurnFightGet(assetVersionUrl, guid, 3, OnGetTurnFightData); |
| | | } |
| | | |
| | | void OnGetTurnFightData(bool _ok, string guid, byte[] _result) |
| | | { |
| | | if (_ok) |
| | | { |
| | | ReadTurnFightInfo(_result); |
| | | } |
| | | } |
| | | |
| | | //战报存储的是B430封包,所以需要转发B430封包 |
| | | private void ReadTurnFightInfo(byte[] vBytes) |
| | | { |
| | | try |
| | | { |
| | | byte[] vPackBytes = vBytes; |
| | | GameNetPackBasic vNetpack; |
| | | byte[] vCmdBytes = new byte[2]; |
| | | ServerType socketType = ServerType.B430; |
| | | |
| | | Array.Copy(vPackBytes, 0, vCmdBytes, 0, 2); |
| | | var cmd = (ushort)((ushort)(vCmdBytes[0] << 8) + vCmdBytes[1]); |
| | | |
| | | // 处理主工程的封包 |
| | | if (PackageRegedit.Contain(cmd)) |
| | | { |
| | | vNetpack = PackageRegedit.TransPack(socketType, cmd, vPackBytes); |
| | | if (vNetpack != null) |
| | | { |
| | | GameNetSystem.Instance.PushPackage(vNetpack, socketType); |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Debug.LogErrorFormat("ReadTurnFightInfo 分析战报异常:{0}", ex); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | string battleName = "StoryBossBattleField"; |
| | | string battleName = BattleConst.StoryBossBattleField; //绑死战场就不通用了根据情况修改 |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | |
| | | { |
| | | scroller.OnRefreshCell -= OnRefreshCell; |
| | | BattleSettlementManager.Instance.WinShowOver(battleName); |
| | | // 如果点击回放等,请根据表现情况不表现加载 |
| | | OpenLoading(); |
| | | } |
| | | |
| | | List<Item> showItems = new List<Item>(); |
| | |
| | | |
| | | var resultStr = jsonData["itemInfo"]; |
| | | for (int i = 0; i < resultStr.Count; i++) |
| | | { |
| | | { |
| | | showItems.Add(new Item((int)resultStr[i]["ItemID"], (long)resultStr[i]["Count"])); |
| | | } |
| | | |
| | | showItems.Sort(SortItem); |
| | | for (int i = 0; i < showItems.Count; i++) |
| | | { |
| | | { |
| | | scroller.AddCell(ScrollerDataType.Header, i); |
| | | } |
| | | scroller.Restart(); |
| | |
| | | _cell?.Display(item.id, item.countEx); |
| | | } |
| | | |
| | | |
| | | void OpenLoading() |
| | | { |
| | | if (PlayerDatas.Instance.baseData.ExAttr1 / 100 % 100 == 1) |
| | | { |
| | | UIManager.Instance.OpenWindow<MapLoadingWin>(1); |
| | | } |
| | | } |
| | | } |
| | |
| | | [SerializeField] TextEx txtFuncName; |
| | | [SerializeField] Button tipEquipBtn; |
| | | [SerializeField] Button tipHeroPosBtn; |
| | | string battleName = "BoneBattleField"; |
| | | string battleName = BattleConst.BoneBattleField; |
| | | protected override void InitComponent() |
| | | { |
| | | tipEquipBtn.AddListener(() => |
| | |
| | | [SerializeField] TextEx txtFuncName; |
| | | [SerializeField] ScrollerController scroller; |
| | | |
| | | string battleName = "BoneBattleField"; |
| | | string battleName = BattleConst.BoneBattleField; |
| | | protected override void OnPreOpen() |
| | | { |
| | | scroller.OnRefreshCell += OnRefreshCell; |
| | |
| | | [SerializeField] ScrollerController scroller; |
| | | [SerializeField] TextEx txtHunt; |
| | | bool isSweepVictory = false; |
| | | string battleName = "TianziBillboradBattleField"; |
| | | string battleName = BattleConst.TianziBillboradBattleField; |
| | | protected override void OnPreOpen() |
| | | { |
| | | base.OnPreOpen(); |
| | |
| | | if (battle == null) |
| | | return; |
| | | var battleName = battle.ToString(); |
| | | if (battleName != "TianziBillboradBattleField") |
| | | if (battleName != BattleConst.TianziBillboradBattleField) |
| | | return; |
| | | if (data == null || !data.ContainsKey("totalHurt")) |
| | | return; |