diff options
author | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:11:21 +0200 |
---|---|---|
committer | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:51:35 +0200 |
commit | ae44478b30d890fe0fb04022f44d474dcdcc3f9d (patch) | |
tree | 5f462459ae4b47d22114eed717d1382d08cf4dfe /mcproto/status/ping.ha |
Diffstat (limited to 'mcproto/status/ping.ha')
-rw-r--r-- | mcproto/status/ping.ha | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mcproto/status/ping.ha b/mcproto/status/ping.ha new file mode 100644 index 0000000..00ff7cf --- /dev/null +++ b/mcproto/status/ping.ha @@ -0,0 +1,9 @@ +use mcproto; +use trace; + +export fn decode_ping(ctx: *mcproto::Context) (i64 | trace::failed) = { + const ctx_ = mcproto::context(ctx, "ping id"); + const ping_id = mcproto::decode_long(&ctx_)?: i64; + mcproto::expect_end(ctx)?; + return ping_id; +}; |