aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-12 06:00:03 -0700
committerFuwn <[email protected]>2024-06-12 06:03:20 -0700
commit8efcb39ada60dc1ec7362ccb979df2a9445525ea (patch)
tree491f157c8d7b903e143701645b6963e026f3c3f0 /build
downloadworldserver-protobufs-8efcb39ada60dc1ec7362ccb979df2a9445525ea.tar.xz
worldserver-protobufs-8efcb39ada60dc1ec7362ccb979df2a9445525ea.zip
feat: initial commit
Diffstat (limited to 'build')
-rw-r--r--build/test.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/test.py b/build/test.py
new file mode 100644
index 0000000..00cc0f4
--- /dev/null
+++ b/build/test.py
@@ -0,0 +1,24 @@
+import NetPacket_pb2
+import BuddyListNotifyCmd_pb2
+
+request = NetPacket_pb2.NetPacket()
+
+request.length = 3
+request.short_object_id = 0xFF
+request.command_type = 0x0A
+request.buddy_list_notify_cmd.CopyFrom(BuddyListNotifyCmd_pb2.BuddyListNotifyCmd())
+request.buddy_list_notify_cmd.buddy_name = "Whirl"
+request.buddy_list_notify_cmd.logged_on = 1
+
+print(request.SerializeToString())
+print(request.WhichOneof("packet"))
+
+deserialised_request = NetPacket_pb2.NetPacket()
+
+deserialised_request.ParseFromString(request.SerializeToString())
+
+print(deserialised_request.length)
+print(deserialised_request.short_object_id)
+print(deserialised_request.command_type)
+print(deserialised_request.buddy_list_notify_cmd.buddy_name)
+print(deserialised_request.buddy_list_notify_cmd.logged_on)