From a591d0b868bf7b0b440eeeafd4c58beb36e035e2 Mon Sep 17 00:00:00 2001 From: HungDK <> Date: Tue, 14 Oct 2025 10:51:36 +0700 Subject: [PATCH] Fix data type wrong convert --- .../Debug/netstandard2.1/CSNetwork.dll.meta | 2 ++ Assets/NetworkLib/Release.meta | 8 ++++++++ Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs | 12 ++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll.meta create mode 100644 Assets/NetworkLib/Release.meta diff --git a/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll.meta b/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll.meta new file mode 100644 index 0000000000..fb396d45e8 --- /dev/null +++ b/Assets/NetworkLib/Debug/netstandard2.1/CSNetwork.dll.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3b9d74e7123c6e144ae35ceb982d00de \ No newline at end of file diff --git a/Assets/NetworkLib/Release.meta b/Assets/NetworkLib/Release.meta new file mode 100644 index 0000000000..fa7ce81bd6 --- /dev/null +++ b/Assets/NetworkLib/Release.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4ed0dfeaea062ad4b9990837c319097b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs b/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs index 9e9e64ff92..9b8e607b73 100644 --- a/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs +++ b/Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs @@ -56,7 +56,7 @@ namespace PerfectWorld.Scripts.Managers { Debug.Log("MATTERINFO"); //ENABLE LATER: It fetch all matters in the game world, causing performance issues - //OnMsgMatterInfo(Msg); + OnMsgMatterInfo(Msg); break; } case int value when value == EC_MsgDef.MSG_MM_MATTERENTWORLD: @@ -83,9 +83,9 @@ namespace PerfectWorld.Scripts.Managers // Parse the data structure: count + info_matter array int offset = 0; - // Read count (int) - int count = BitConverter.ToInt32(data, offset); - offset += sizeof(int); + // Read count (ushort) + ushort count = BitConverter.ToUInt16(data, offset); + offset += sizeof(ushort); Debug.Log($"MATTERINFO: Received {count} matter entries"); @@ -137,11 +137,11 @@ namespace PerfectWorld.Scripts.Managers private void SpawnMatterCube(int matterId) { // Check if matter is within 1000 units of the host player - if (!IsMatterWithinPlayerRange(matterId, 10000f)) + /*if (!IsMatterWithinPlayerRange(matterId, 10000f)) { Debug.Log($"Matter {matterId} is too far from player, skipping spawn"); return; - } + }*/ // Find the pickupItem component in the scene and create cube for this specific matter pickupItem pickupScript = UnityEngine.Object.FindFirstObjectByType();