diff --git a/core/gen/com/riiablo/net/packet/d2gs/RunToEntity.java b/core/gen/com/riiablo/net/packet/d2gs/RunToEntity.java index 5f12bdcf..bc9b4b01 100644 --- a/core/gen/com/riiablo/net/packet/d2gs/RunToEntity.java +++ b/core/gen/com/riiablo/net/packet/d2gs/RunToEntity.java @@ -14,21 +14,21 @@ public final class RunToEntity extends Table { public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); } public RunToEntity __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } - public int type() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; } - public int id() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; } + public int type() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; } + public int entityId() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; } public static int createRunToEntity(FlatBufferBuilder builder, int type, - int id) { + int entityId) { builder.startObject(2); - RunToEntity.addId(builder, id); + RunToEntity.addEntityId(builder, entityId); RunToEntity.addType(builder, type); return RunToEntity.endRunToEntity(builder); } public static void startRunToEntity(FlatBufferBuilder builder) { builder.startObject(2); } - public static void addType(FlatBufferBuilder builder, int type) { builder.addInt(0, type, 0); } - public static void addId(FlatBufferBuilder builder, int id) { builder.addInt(1, id, 0); } + public static void addType(FlatBufferBuilder builder, int type) { builder.addByte(0, (byte)type, (byte)0); } + public static void addEntityId(FlatBufferBuilder builder, int entityId) { builder.addInt(1, entityId, 0); } public static int endRunToEntity(FlatBufferBuilder builder) { int o = builder.endObject(); return o; diff --git a/core/gen/com/riiablo/net/packet/d2gs/WalkToEntity.java b/core/gen/com/riiablo/net/packet/d2gs/WalkToEntity.java index 606ead68..d9c6559e 100644 --- a/core/gen/com/riiablo/net/packet/d2gs/WalkToEntity.java +++ b/core/gen/com/riiablo/net/packet/d2gs/WalkToEntity.java @@ -14,21 +14,21 @@ public final class WalkToEntity extends Table { public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); } public WalkToEntity __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } - public int type() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; } - public int id() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; } + public int type() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; } + public int entityId() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; } public static int createWalkToEntity(FlatBufferBuilder builder, int type, - int id) { + int entityId) { builder.startObject(2); - WalkToEntity.addId(builder, id); + WalkToEntity.addEntityId(builder, entityId); WalkToEntity.addType(builder, type); return WalkToEntity.endWalkToEntity(builder); } public static void startWalkToEntity(FlatBufferBuilder builder) { builder.startObject(2); } - public static void addType(FlatBufferBuilder builder, int type) { builder.addInt(0, type, 0); } - public static void addId(FlatBufferBuilder builder, int id) { builder.addInt(1, id, 0); } + public static void addType(FlatBufferBuilder builder, int type) { builder.addByte(0, (byte)type, (byte)0); } + public static void addEntityId(FlatBufferBuilder builder, int entityId) { builder.addInt(1, entityId, 0); } public static int endWalkToEntity(FlatBufferBuilder builder) { int o = builder.endObject(); return o; diff --git a/core/src/com/riiablo/net/d2gs/D2GS.fbs b/core/src/com/riiablo/net/d2gs/D2GS.fbs index fb949639..48246de4 100644 --- a/core/src/com/riiablo/net/d2gs/D2GS.fbs +++ b/core/src/com/riiablo/net/d2gs/D2GS.fbs @@ -1,9 +1,6 @@ -include "WalkToLocation.fbs"; -include "WalkToEntity.fbs"; -include "RunToLocation.fbs"; -include "RunToEntity.fbs"; include "Connection.fbs"; include "Disconnect.fbs"; +include "PlayerController.fbs"; include "Sync.fbs"; include "ItemManagement.fbs"; diff --git a/core/src/com/riiablo/net/d2gs/PlayerController.fbs b/core/src/com/riiablo/net/d2gs/PlayerController.fbs new file mode 100644 index 00000000..b7a6794d --- /dev/null +++ b/core/src/com/riiablo/net/d2gs/PlayerController.fbs @@ -0,0 +1,33 @@ +namespace com.riiablo.net.packet.d2gs; + +table WalkToLocation { + // request + x:int16; + y:int16; + + // response +} + +table WalkToEntity { + // request + type:uint8; + entityId:int32; + + // response +} + +table RunToLocation { + // request + x:int16; + y:int16; + + // response +} + +table RunToEntity { + // request + type:uint8; + entityId:int32; + + // response +} \ No newline at end of file diff --git a/core/src/com/riiablo/net/d2gs/RunToEntity.fbs b/core/src/com/riiablo/net/d2gs/RunToEntity.fbs deleted file mode 100644 index e3adbf15..00000000 --- a/core/src/com/riiablo/net/d2gs/RunToEntity.fbs +++ /dev/null @@ -1,6 +0,0 @@ -namespace com.riiablo.net.packet.d2gs; - -table RunToEntity { - type:int32; - id:int32; -} \ No newline at end of file diff --git a/core/src/com/riiablo/net/d2gs/RunToLocation.fbs b/core/src/com/riiablo/net/d2gs/RunToLocation.fbs deleted file mode 100644 index 4a0c7d75..00000000 --- a/core/src/com/riiablo/net/d2gs/RunToLocation.fbs +++ /dev/null @@ -1,6 +0,0 @@ -namespace com.riiablo.net.packet.d2gs; - -table RunToLocation { - x:int16; - y:int16; -} \ No newline at end of file diff --git a/core/src/com/riiablo/net/d2gs/WalkToEntity.fbs b/core/src/com/riiablo/net/d2gs/WalkToEntity.fbs deleted file mode 100644 index 05f0e463..00000000 --- a/core/src/com/riiablo/net/d2gs/WalkToEntity.fbs +++ /dev/null @@ -1,6 +0,0 @@ -namespace com.riiablo.net.packet.d2gs; - -table WalkToEntity { - type:int32; - id:int32; -} \ No newline at end of file diff --git a/core/src/com/riiablo/net/d2gs/WalkToLocation.fbs b/core/src/com/riiablo/net/d2gs/WalkToLocation.fbs deleted file mode 100644 index adf8a453..00000000 --- a/core/src/com/riiablo/net/d2gs/WalkToLocation.fbs +++ /dev/null @@ -1,6 +0,0 @@ -namespace com.riiablo.net.packet.d2gs; - -table WalkToLocation { - x:int16; - y:int16; -} \ No newline at end of file