This commit is contained in:
VDH
2025-09-23 17:31:59 +07:00
parent 0728230c71
commit eeaa84cc64
3 changed files with 52 additions and 1 deletions
@@ -1,4 +1,5 @@
using CSNetwork;
using CSNetwork.GPDataType;
using System;
using UnityEngine;
@@ -20,6 +21,48 @@ public class CECNPCMan : IMsgHandler
private void OnMsgNPCInfo(ECMSG msg)
{
switch (msg.dwParam2)
{
case CommandID.NPC_INFO_LIST:
{
/* cmd_npc_info_list* pCmd = (cmd_npc_info_list*)Msg.dwParam1;
BYTE* pDataBuf = &pCmd->placeholder;
for (int i = 0; i < pCmd->count; i++)
{
const info_npc&Info = *(const info_npc*)pDataBuf;
// Calculate npc info data size and skip it
int iSize = sizeof(info_npc);
if (Info.state & GP_STATE_EXTEND_PROPERTY)
iSize += sizeof(DWORD) * OBJECT_EXT_STATE_COUNT;
if (Info.state & GP_STATE_NPC_PET)
iSize += sizeof(int);
if (Info.state & GP_STATE_NPC_NAME)
{
BYTE len = *(BYTE*)(pDataBuf + iSize);
iSize += sizeof(BYTE) + len;
}
if (Info.state & GP_STATE_MULTIOBJ_EFFECT)
{
int count = *(int*)(pDataBuf + iSize);
iSize += sizeof(int);
iSize += count * (sizeof(int) + sizeof(char));
}
if (Info.state & GP_STATE_NPC_MAFIA)
{
iSize += sizeof(int);
}
a_LogOutput(1, "HoangDev: NPC_INFO_LIST, nid: %d, tid: %d, vis_tid: %d, pos: %f %f %f", Info.nid, Info.tid, Info.vis_tid, Info.pos.x, Info.pos.y, Info.pos.z);
NPCEnter(Info, false);
pDataBuf += iSize;*/
}
break;
}
}
}
+1
View File
@@ -1,6 +1,7 @@
{
"dependencies": {
"com.boxqkrtm.ide.cursor": "https://github.com/boxqkrtm/com.unity.ide.cursor.git",
"com.github-glitchenzo.nugetforunity": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity",
"com.unity.ai.navigation": "2.0.8",
"com.unity.collab-proxy": "2.9.1",
"com.unity.ide.rider": "3.0.36",
+7
View File
@@ -9,6 +9,13 @@
},
"hash": "38fecf55e4fd94ccfe58a92ed8ad1a529ba1694e"
},
"com.github-glitchenzo.nugetforunity": {
"version": "https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "a7c6b49a0141a5bff9b1983e38137522ef61977d"
},
"com.unity.ai.navigation": {
"version": "2.0.8",
"depth": 0,