* Introduce MCI cache: Art files are hashed and MCI info (per client) is cached. Term resizes invalidate the cache

* Bring in farmhash for art file hashing (and perhaps other uses soon)
* Re-write of art.js display(). Better system, use MCI cache, etc.
* Update package.json engines node req.
This commit is contained in:
Bryan Ashby 2016-08-31 22:06:28 -06:00
parent 5112506e14
commit e7ba6c406e
7 changed files with 183 additions and 10 deletions

View file

@ -599,9 +599,11 @@ TelnetClient.prototype.handleSbCommand = function(evt) {
self.setTermType(evt.envVars[name]);
} else if('COLUMNS' === name && 0 === self.term.termWidth) {
self.term.termWidth = parseInt(evt.envVars[name]);
self.clearMciCache(); // term size changes = invalidate cache
self.log.debug({ termWidth : self.term.termWidth, source : 'NEW-ENVIRON'}, 'Window width updated');
} else if('ROWS' === name && 0 === self.term.termHeight) {
self.term.termHeight = parseInt(evt.envVars[name]);
self.clearMciCache(); // term size changes = invalidate cache
self.log.debug({ termHeight : self.term.termHeight, source : 'NEW-ENVIRON'}, 'Window height updated');
} else {
if(name in self.term.env) {
@ -636,6 +638,8 @@ TelnetClient.prototype.handleSbCommand = function(evt) {
self.term.env.ROWS = evt.height;
}
self.clearMciCache(); // term size changes = invalidate cache
self.log.debug({ termWidth : evt.width , termHeight : evt.height, source : 'NAWS' }, 'Window size updated');
} else {
self.log(evt, 'SB');