From 140e6bfad831f48ab2b7d3dcaf8659bd6d4e5d5b Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 11 Apr 2019 15:46:04 -0700 Subject: [PATCH] Changed flatbuffers to use union of message types --- core/src/com/riiablo/net/packet/Packet.fbs | 15 +++++++++++++++ .../src/com/riiablo/net/packet/WalkToLocation.fbs | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 core/src/com/riiablo/net/packet/Packet.fbs create mode 100644 core/src/com/riiablo/net/packet/WalkToLocation.fbs diff --git a/core/src/com/riiablo/net/packet/Packet.fbs b/core/src/com/riiablo/net/packet/Packet.fbs new file mode 100644 index 00000000..34262b04 --- /dev/null +++ b/core/src/com/riiablo/net/packet/Packet.fbs @@ -0,0 +1,15 @@ +include "WalkToLocation.fbs"; +include "Connection.fbs"; + +namespace com.riiablo.net.packet; + +union PacketData { + WalkToLocation, + Connection +} + +table Packet { + data:PacketData; +} + +root_type Packet; \ No newline at end of file diff --git a/core/src/com/riiablo/net/packet/WalkToLocation.fbs b/core/src/com/riiablo/net/packet/WalkToLocation.fbs new file mode 100644 index 00000000..07b29602 --- /dev/null +++ b/core/src/com/riiablo/net/packet/WalkToLocation.fbs @@ -0,0 +1,6 @@ +namespace com.riiablo.net.packet; + +table WalkToLocation { + x:int16; + y:int16; +} \ No newline at end of file