aboutsummaryrefslogtreecommitdiff
path: root/bin/client/main.lua
diff options
context:
space:
mode:
Diffstat (limited to 'bin/client/main.lua')
-rw-r--r--bin/client/main.lua43
1 files changed, 0 insertions, 43 deletions
diff --git a/bin/client/main.lua b/bin/client/main.lua
deleted file mode 100644
index 5a036e8..0000000
--- a/bin/client/main.lua
+++ /dev/null
@@ -1,43 +0,0 @@
-io.stdout:setvbuf("no")
-local thread = nil
-local socket = nil
-local asynReceive = [[
-io.stdout:setvbuf("no")
-local thread = jin.thread.getThread()
-local socket = thread:demand(1)
-local buf = nil
-while true do
- buf = socket:receive()
- thread:send(2, buf)
-end
-]]
-jin.core.onLoad = function()
- jin.net.init()
- socket = jin.net.Socket("TCP", "127.0.0.1", 8708)
-
- thread = jin.thread.Thread("asynReceive", asynReceive)
- thread:start()
- thread:send(1, socket)
-end
-
-jin.core.onEvent = function(e)
- if e.type == "quit" then
- jin.core.stop() elseif e.type == "keydown" then
- if e.key == "Escape" then
- jin.core.stop()
- end
- end
-end
-local x = 0
-local y = 0
-jin.core.onUpdate = function(dt)
- if thread:receive(2) then
- local buf = thread:fetch(2)
- x, xl = buf:grabFloat(0)
- y, yl = buf:grabFloat(xl)
- end
-end
-
-jin.core.onDraw = function()
- jin.graphics.circle("fill", x, y, 12)
-end