Skip to content
Snippets Groups Projects
Commit 3f1ff66d authored by mcmlxxix's avatar mcmlxxix
Browse files

moved communication cycle inside key processing function

to simplify use and implementation of chat module
parent 1db8590d
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,6 @@ function Chat(Engine) ...@@ -21,7 +21,6 @@ function Chat(Engine)
{ {
while(1) while(1)
{ {
Engine.Cycle();
var key=console.inkey(K_NOCRLF|K_NOSPIN|K_NOECHO,25); var key=console.inkey(K_NOCRLF|K_NOSPIN|K_NOECHO,25);
if(!Engine.ProcessKey(key)) return; if(!Engine.ProcessKey(key)) return;
} }
...@@ -92,6 +91,7 @@ function ChatEngine(root,name,log_) ...@@ -92,6 +91,7 @@ function ChatEngine(root,name,log_)
} }
this.ProcessKey=function(key) this.ProcessKey=function(key)
{ {
this.Cycle();
switch(key.toUpperCase()) switch(key.toUpperCase())
{ {
case 'Q': case 'Q':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment