crankycyclops / trogdor-pp

A unified engine for building text adventures and MUDs with batteries included.
GNU General Public License v3.0
15 stars 2 forks source link

Investigate: Command timeout event #47

Closed crankycyclops closed 4 years ago

crankycyclops commented 11 years ago

Some things I might want to do will involve both a command timeout event (if user doesn't enter a command in a given number of seconds, a commandTimeout event will be triggered) and knowing how many clock ticks have elapsed since user entered the last command. Investigate this.

crankycyclops commented 11 years ago

Every time a call to processCommand(player) is made, spin up a timer job with the interval set to how long to wait for a command before timing out, and set the number of executions to 1. Once the user types a command, call timer->removeJob() (might have to wrap this in a try/catch block?) If the timeout time passes, the job will execute once and then go away. If the user types a command in time, then the job is removed before it can execute.

The timer job should fire an event.

crankycyclops commented 4 years ago

This is now irrelevant due to the way input is now processed.