diff options
author | David McMackins II <contact@mcmackins.org> | 2017-08-07 06:42:06 -0500 |
---|---|---|
committer | David McMackins II <contact@mcmackins.org> | 2017-08-07 06:42:06 -0500 |
commit | 65d18f5251830a30288a930ff8cf156806ac15b6 (patch) | |
tree | e7405ae084b88be4c76c6c7e48f98e7aad228340 | |
parent | 919ef470cca678f0adafed540b53ebb081b6b7a7 (diff) |
Add move logic stub
-rw-r--r-- | serverthread.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/serverthread.lua b/serverthread.lua index cd0cf2b..ac4aa96 100644 --- a/serverthread.lua +++ b/serverthread.lua @@ -205,6 +205,10 @@ function Server:_getmove(dx, dy, wantsplit) return self:_trymove(quad, 1) end +function Server:_move(move, wantsplit) + +end + function Server:_sendall(msg) for _,sock in ipairs(self._socks) do sock:send(msg) @@ -324,16 +328,13 @@ function Server:_process() break end - self._socks[this]:send( - table.concat({'Y', move.x, move.y, 'END'}, '\n')) - - for _,queue in ipairs(self._updatequeue) do - table.insert(queue, line[1] .. ' ' .. self._selected.id - .. ' ' move.x .. ' ' .. move.y) + self._socks[this]:send(AFFIRMATIVE) - if not line[1]:startswith('TRY') then - table.insert(queue, 'DESELECTED') - end + if line[1]:startswith('TRY') then + self:_updateall({'POINT ' .. move.x .. ' ' .. move.y}) + else + self:_move(move, split) + self:_updateall({'DESELECTED'}) end end end |