More work on Edit Frame

This commit is contained in:
Deon George
2019-10-02 15:47:56 +10:00
parent bb031b1b82
commit d43d5b71fd
5 changed files with 110 additions and 14 deletions

View File

@@ -184,7 +184,6 @@ abstract class Server {
if ($read != '') {
if ($read == TCP_IAC) {
// If we are not already in a TELNET LOOP
if ($control !== CONTROL_TELNET) {
$control = CONTROL_TELNET;
@@ -225,8 +224,6 @@ abstract class Server {
$action = $save->state['action'];
$control = FALSE;
}
dump(sprintf('End: Control is now: %s: Method Count: %s',is_object($control) ? get_class($control) : serialize($control),$method->count()));
}
printf("- End CONTROL: Read %s (%s): Mode: [%s], Action: [%s], Control: [%s]\n",
@@ -446,6 +443,7 @@ abstract class Server {
// List of alternate frames has been presented
case MODE_WARPTO:
// @todo If we are in a control, we need to terminate it.
if (is_numeric($read) AND $read) {
$timewarpalt = $alts->get($read-1)->id;
$action = ACTION_GOTO;
@@ -666,6 +664,7 @@ abstract class Server {
// Clear the command, we are finished processing
$cmd = '';
$mode = FALSE;
break;
}
@@ -731,7 +730,7 @@ abstract class Server {
}
$control = CONTROL_EDIT;
$method->push(Control::factory('editframe',$this,$next_fo));
$method->push(Control::factory('editframe',$this,['fo'=>$next_fo]));
$next_fo = NULL;
$method->last()->state['control'] = $control;
$method->last()->state['action'] = FALSE;
@@ -930,6 +929,24 @@ abstract class Server {
break;
// External Frame - run by a control.
case FRAME::FRAMETYPE_EXTERNAL:
$external = explode(' ',$this->fo->content());
$x = Control::factory(array_shift($external),$this,$external);
if (! $x)
{
$this->sendBaseline($client,ERR_PAGE);
$mode = $action = FALSE;
break;
}
$method->push($x);
$control = CONTROL_METHOD;
$action = FALSE;
break;
// Terminate Frame
case Frame::FRAMETYPE_TERMINATE:
$client->send($output);