[Parity][net-world][S1][R] 别的玩家进入视野(0x59 坐标非零)时,selfId 会被改成那个玩家 #563
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
来源审计项:
net-world#2— [S1][R] F2 别的玩家进入视野(0x59 坐标非零)时,selfId会被改成那个玩家src/netproto/d2gs/s2c/units.ts:208(isSelf: x !== 0 || y !== 0)→src/client/world/client-world.ts:1765-1782(UnitAssign:if (ev.isSelf === true || this.selfId === 0) { this.selfId = unit.id ... },随后覆盖_self.name/charClass/x/y)SUnitMsg.cpp:52-55→SCmd.cpp:605-616 sub_6FC3D1F0),坐标取自UNITS_GetCoords,对其他玩家就是真实坐标。自己的身份由进游戏时单独发的 0x0B(unit type + GUID)告知(Clients.cpp:413SendPacketSize06(pClient, 0x0B, nUnitType, nUnitGUID))(V-src)。仓库 14 份 d2gs 抓包里,自己的 0x59 都是 x=y=0,序号 4,早于 0x0B(序号 11–15)(V-data 抓包tests/fixtures/netproto/*.d2cap)。所以这个启发式正好反了:自己被判成非 self,别人被判成 self。selfId=1;再 apply 另一个玩家的 0x59(id=2, 野蛮人, 5120,5130),selfId=2,_self.name="Other",charClass=4,_self.x/y变成对方坐标。isSelf;selfId === 0时"第一个玩家就是自己"的兜底一并去掉(见 F21)。