mudgangster

Log | Files | Refs

commit 2549499e78a242ec6423d138771882a35af34350
parent 17fba5bf58f9768a91d657e9c9e3846fdf941292
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu,  6 Sep 2018 17:11:27 +0300

Split lastInput into last_command_time and last_human_input_time

Diffstat:
src/lua/handlers.lua | 4++++
src/lua/main.lua | 2++
src/lua/mud.lua | 4++--
3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/lua/handlers.lua b/src/lua/handlers.lua @@ -260,6 +260,8 @@ local function handleCommand( input, hide ) end local function handleInput( input, display ) + mud.last_human_input_time = mud.now() + for command in ( input .. ";" ):gmatch( "([^;]*);" ) do handleCommand( command, display ) end @@ -268,6 +270,8 @@ end mud.input = handleInput local function handleMacro( key, shift, ctrl, alt ) + mud.last_human_input_time = mud.now() + if shift then key = "s" .. key end diff --git a/src/lua/main.lua b/src/lua/main.lua @@ -40,6 +40,8 @@ mud.drawChat = drawChat mud.urgent = urgent mud.now = get_time +mud.last_human_input_time = mud.now() + mud.alias( "/font", { [ "^(.-)%s+(%d+)$" ] = function( name, size ) size = tonumber( size ) diff --git a/src/lua/mud.lua b/src/lua/mud.lua @@ -5,7 +5,7 @@ local LastAddress local LastPort function mud.send( data ) - mud.lastInput = mud.now() + mud.last_command_time = mud.now() socket.send( mud_socket, data ) end @@ -55,7 +55,7 @@ function mud.connect( address, port ) LastPort = port mud.connected = true - mud.lastInput = mud.now() + mud.last_command_time = mud.now() end mud.alias( "/con", {