From 58b3c3640af997a75bc2ef37c1449b4dad03b5fd Mon Sep 17 00:00:00 2001 From: NguyenVanDat Date: Wed, 17 Dec 2025 17:30:27 +0700 Subject: [PATCH] update log --- Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs | 5 ++++- Assets/PerfectWorld/Scripts/Task/ATaskTemplMan.cs | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs b/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs index 21465983b9..c431dd82cb 100644 --- a/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs +++ b/Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs @@ -349,7 +349,10 @@ namespace BrewMonster.Network } public static void c2s_CmdTaskNotify( byte[] pBuf, uint sz) { - Instance._gameSession.c2s_SendCmdTaskNotify( pBuf, sz); + if (Instance != null && Instance._gameSession != null) + { + Instance._gameSession.c2s_SendCmdTaskNotify( pBuf, sz); + } } public static void c2s_CmdAutoTeamSetGoal(int type, int goal_id, int op) diff --git a/Assets/PerfectWorld/Scripts/Task/ATaskTemplMan.cs b/Assets/PerfectWorld/Scripts/Task/ATaskTemplMan.cs index afbceb3d08..500a3489ba 100644 --- a/Assets/PerfectWorld/Scripts/Task/ATaskTemplMan.cs +++ b/Assets/PerfectWorld/Scripts/Task/ATaskTemplMan.cs @@ -191,11 +191,18 @@ namespace BrewMonster.Scripts.Task // background thread loadedTasks = await UniTask.RunOnThreadPool(() => LoadTasksFromPack_Internal(szPackPath, onProgress, token), cancellationToken: token); } + catch (OperationCanceledException) + { + // ❗ Đây là cancel bình thường → KHÔNG log error + Debug.Log("LoadTasksFromPack canceled"); + return false; + } catch (Exception e) { Debug.LogException(e); return false; } + Debug.Log($" Starting to load {loadedTasks.Count} task templates...");