Jnnshschl / AmeisenNavigation

Navigationmesh Server for my bot based on the TrinityCore MMAP's and Recast & Detour

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data Protocol

lucas-jones opened this issue · comments

Hey,

We're trying to use this project with NodeJS. And are slightly confused on the communication protocol. I guess with the recent refactor the documentations not been updated yet

For example when trying to get a RANDOM_POINT:

byteBuffer.writeByte(6); // Length in bytes
byteBuffer.writeByte(MessageType.RANDOM_POINT); // Value 2
byteBuffer.writeInt(1); // MapID (Kalimdor)

But don't get a response. Unless I remove writing the length

byteBuffer.writeByte(MessageType.RANDOM_POINT);
byteBuffer.writeInt(1);

Which seems to get a response:

0d 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00

Which I assume is Vector3.Zero as it some how failed to find a random point..

Yes, the server received a complete rewrite, have a look at this https://github.com/Jnnshschl/AnTCP/blob/master/AnTCP.Client/AnTcpClient.cs and https://github.com/Jnnshschl/AmeisenBotX/blob/master/AmeisenBotX.Core/Engines/Movement/Pathfinding/AmeisenNavigationHandler.cs. It is a client implementation in C#. The protocol is very simple, it only sends 1 byte as an identifier and the parameter bytes.