summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2022-11-14 19:32:14 -0600
committerthe lemons <citrons@mondecitronne.com>2022-11-14 19:37:13 -0600
commit18ce3029371941b4684e5fdea8b9d275957a6114 (patch)
tree5129a9ae81d02d36135ddb1c8bdcf2f138bdda43
parent25dbdeffb288f7677c7ec7885be35eec91519af9 (diff)
properly localize all functionsHEADmaster
-rw-r--r--main.lua4
-rw-r--r--server_logic.lua6
2 files changed, 5 insertions, 5 deletions
diff --git a/main.lua b/main.lua
index 18fe919..03f4431 100644
--- a/main.lua
+++ b/main.lua
@@ -16,7 +16,7 @@ local function reject(stream, code, reason)
stream:write_chunk(reason, true)
end
-function onstream(server, stream)
+local function onstream(server, stream)
print("stream you.")
local head = stream:get_headers()
@@ -37,7 +37,7 @@ function onstream(server, stream)
logic.onsocket(ws,room)
local ws_open = true
- function close()
+ local function close()
logic.onclose(ws)
if ws_open then ws:close() end
ws_open = false
diff --git a/server_logic.lua b/server_logic.lua
index 4c6c229..02f6718 100644
--- a/server_logic.lua
+++ b/server_logic.lua
@@ -7,7 +7,7 @@ local ping_interval = 6
M.ping_interval = ping_interval
local debug_mode = true
-function debug(...)
+local function debug(...)
if debug_mode then print(...) end
end
@@ -76,7 +76,7 @@ local client_metatable = {
}
}
-function try_room(r)
+local function try_room(r)
if activerooms[r] then return activerooms[r] end
local res = {
users = {},
@@ -125,4 +125,4 @@ function M.ping(s)
client:ping()
end
-return M \ No newline at end of file
+return M