mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-09 23:38:15 +07:00
Created PlayerController flatbuffer spec file
Removed individual fbs for player movement packet definitions Changed (Walk|Run)ToEntity packets from id to entityId
This commit is contained in:
@ -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 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 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 type() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
|
||||||
public int id() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
public int entityId() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||||
|
|
||||||
public static int createRunToEntity(FlatBufferBuilder builder,
|
public static int createRunToEntity(FlatBufferBuilder builder,
|
||||||
int type,
|
int type,
|
||||||
int id) {
|
int entityId) {
|
||||||
builder.startObject(2);
|
builder.startObject(2);
|
||||||
RunToEntity.addId(builder, id);
|
RunToEntity.addEntityId(builder, entityId);
|
||||||
RunToEntity.addType(builder, type);
|
RunToEntity.addType(builder, type);
|
||||||
return RunToEntity.endRunToEntity(builder);
|
return RunToEntity.endRunToEntity(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startRunToEntity(FlatBufferBuilder builder) { builder.startObject(2); }
|
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 addType(FlatBufferBuilder builder, int type) { builder.addByte(0, (byte)type, (byte)0); }
|
||||||
public static void addId(FlatBufferBuilder builder, int id) { builder.addInt(1, id, 0); }
|
public static void addEntityId(FlatBufferBuilder builder, int entityId) { builder.addInt(1, entityId, 0); }
|
||||||
public static int endRunToEntity(FlatBufferBuilder builder) {
|
public static int endRunToEntity(FlatBufferBuilder builder) {
|
||||||
int o = builder.endObject();
|
int o = builder.endObject();
|
||||||
return o;
|
return o;
|
||||||
|
@ -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 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 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 type() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
|
||||||
public int id() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
public int entityId() { int o = __offset(6); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
|
||||||
|
|
||||||
public static int createWalkToEntity(FlatBufferBuilder builder,
|
public static int createWalkToEntity(FlatBufferBuilder builder,
|
||||||
int type,
|
int type,
|
||||||
int id) {
|
int entityId) {
|
||||||
builder.startObject(2);
|
builder.startObject(2);
|
||||||
WalkToEntity.addId(builder, id);
|
WalkToEntity.addEntityId(builder, entityId);
|
||||||
WalkToEntity.addType(builder, type);
|
WalkToEntity.addType(builder, type);
|
||||||
return WalkToEntity.endWalkToEntity(builder);
|
return WalkToEntity.endWalkToEntity(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startWalkToEntity(FlatBufferBuilder builder) { builder.startObject(2); }
|
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 addType(FlatBufferBuilder builder, int type) { builder.addByte(0, (byte)type, (byte)0); }
|
||||||
public static void addId(FlatBufferBuilder builder, int id) { builder.addInt(1, id, 0); }
|
public static void addEntityId(FlatBufferBuilder builder, int entityId) { builder.addInt(1, entityId, 0); }
|
||||||
public static int endWalkToEntity(FlatBufferBuilder builder) {
|
public static int endWalkToEntity(FlatBufferBuilder builder) {
|
||||||
int o = builder.endObject();
|
int o = builder.endObject();
|
||||||
return o;
|
return o;
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
include "WalkToLocation.fbs";
|
|
||||||
include "WalkToEntity.fbs";
|
|
||||||
include "RunToLocation.fbs";
|
|
||||||
include "RunToEntity.fbs";
|
|
||||||
include "Connection.fbs";
|
include "Connection.fbs";
|
||||||
include "Disconnect.fbs";
|
include "Disconnect.fbs";
|
||||||
|
include "PlayerController.fbs";
|
||||||
include "Sync.fbs";
|
include "Sync.fbs";
|
||||||
include "ItemManagement.fbs";
|
include "ItemManagement.fbs";
|
||||||
|
|
||||||
|
33
core/src/com/riiablo/net/d2gs/PlayerController.fbs
Normal file
33
core/src/com/riiablo/net/d2gs/PlayerController.fbs
Normal file
@ -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
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
namespace com.riiablo.net.packet.d2gs;
|
|
||||||
|
|
||||||
table RunToEntity {
|
|
||||||
type:int32;
|
|
||||||
id:int32;
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
namespace com.riiablo.net.packet.d2gs;
|
|
||||||
|
|
||||||
table RunToLocation {
|
|
||||||
x:int16;
|
|
||||||
y:int16;
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
namespace com.riiablo.net.packet.d2gs;
|
|
||||||
|
|
||||||
table WalkToEntity {
|
|
||||||
type:int32;
|
|
||||||
id:int32;
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
namespace com.riiablo.net.packet.d2gs;
|
|
||||||
|
|
||||||
table WalkToLocation {
|
|
||||||
x:int16;
|
|
||||||
y:int16;
|
|
||||||
}
|
|
Reference in New Issue
Block a user