summaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
authorLizzy Fleckenstein <lizzy@vlhl.dev>2026-06-03 22:31:42 +0200
committerLizzy Fleckenstein <lizzy@vlhl.dev>2026-06-03 23:30:17 +0200
commit341af788ffb60b1066f7735c10a2ef8480ec0aa9 (patch)
treeb1acbfe48184a263098e6146922730dd7ece8808 /util.lua
parenta42c94e103ecf7cb365a8888c3f5afc785def284 (diff)
downloadr6p-341af788ffb60b1066f7735c10a2ef8480ec0aa9.tar.xz
add player selectionHEADmain
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/util.lua b/util.lua
index 0628691..dda250e 100644
--- a/util.lua
+++ b/util.lua
@@ -16,7 +16,11 @@ local function json_enc(x)
return json:encode(x)
end
-local mkdir, rand_string
+local function send(peer, x)
+ peer:send(json_enc(x))
+end
+
+local rand_string
if love then
rand_string = function(n)
@@ -33,11 +37,6 @@ else
local rand_file = rand_file or io.open("/dev/random")
return rand_file:read(n)
end
- -- awful
- mkdir = function(x)
- local status = os.execute("mkdir -p " .. x)
- return status == true
- end
end
return {
@@ -47,4 +46,5 @@ return {
base64_enc = base64.encode,
json_dec = json_dec,
json_enc = json_enc,
+ send = send,
}