From b9e3ab8e8213efa260ff3b0030d2c399f3afc653 Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Mon, 1 Jun 2026 22:25:56 +0200 Subject: init --- test_client.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 test_client.lua (limited to 'test_client.lua') diff --git a/test_client.lua b/test_client.lua new file mode 100755 index 0000000..aac6fe6 --- /dev/null +++ b/test_client.lua @@ -0,0 +1,33 @@ +#!/usr/bin/env lua5.1 +local client = require("client") + +local invite = assert(arg[1]) +local clt = client.join(invite) +local started + +while true do + client.update(clt) + local status = client.status(clt) + + if status == "timeout_match" then + print("failed to connect to match server") + break + elseif status == "fail_match" then + print("game not found (invalid invite?)") + break + elseif status == "timeout_server" then + print("failed to connect to server") + break + elseif status == "fail_server" then + print("incorrect secret (invalid invite?)") + break + elseif status == "disco" then + print("lost connection to server") + break + elseif status == "active" and not started then + started = true + print("connected to " .. tostring(clt.server)) + end +end + +client.close(clt) -- cgit v1.2.3