diff --git a/Assets/Scripts/Task/TaskTempl.cs b/Assets/Scripts/Task/TaskTempl.cs index c693a70598..c2548f99fb 100644 --- a/Assets/Scripts/Task/TaskTempl.cs +++ b/Assets/Scripts/Task/TaskTempl.cs @@ -2457,10 +2457,22 @@ namespace PerfectWorld.Scripts.Task } private bool LoadFixedDataFromBinFile(FileStream fp) { + for (int i = 1; i <= 8; i++) + { + for (int j = 1; j <= 8; j++) + { + Debug.LogError($"==== {i},{j} ==="); + ConvertFixedData(fp, i, j); + Debug.LogError($"=========="); + } + } + return true; + } + private void ConvertFixedData(FileStream fp, int x1, int x2) + { long readBytes = 0; BMLogger.Log($"LoadFixedDataFromBinFile: {fp.Length}"); - ATaskTemplFixedData fixedData; // Task ID @@ -2468,17 +2480,26 @@ namespace PerfectWorld.Scripts.Task BMLogger.Log($"LoadFixedDataFromBinFile: {fixedData.m_ID}"); // Task Name (task_char m_szName[MAX_TASK_NAME_LEN];) - fixedData.m_szName = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_TASK_NAME_LEN, ref readBytes); + fixedData.m_szName = AAssit.ReadArrayFromBinary(fp, x1*TaskTemplConstants.MAX_TASK_NAME_LEN, ref readBytes); + // Debug.LogError($"m_szName: {fixedData.m_szName}"); // Has Signature (bool m_bHasSign;) fixedData.m_bHasSign = AAssit.ReadFromBinaryOf(fp, ref readBytes); + Debug.LogError($"m_bHasSign: {fixedData.m_bHasSign}"); // Signature pointer (task_char* m_pszSignature;) // Only the pointer address is stored in the binary (skip 4 bytes) - fp.Seek(2, SeekOrigin.Current); + fp.Seek(x2, SeekOrigin.Current); // Task Type (unsigned long m_ulType;) fixedData.m_ulType = AAssit.ReadFromBinaryOf(fp, ref readBytes); + // Debug.LogError($"Type: {fixedData.m_ulType}"); + + if (fixedData.m_ulType == 103) + { + //fixedData.m_bHasSign ==0 && + Debug.LogError("Catch it!"); + } // Time Limit (unsigned long m_ulTimeLimit;) fixedData.m_ulTimeLimit = AAssit.ReadFromBinaryOf(fp, ref readBytes); @@ -2525,11 +2546,7 @@ namespace PerfectWorld.Scripts.Task // Random one subtask (bool m_bRandOne;) fixedData.m_bRandOne = AAssit.ReadFromBinaryOf(fp, ref readBytes); - - - return true; } - #region convert from c++ to cs