From f2e6a250cca9bb6044cee5f04c2416475531a9b2 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 2 Jan 2019 20:56:03 +1100 Subject: [PATCH] Increase page length for ANSI, and minor updates --- .gitattributes | 1 + app/Classes/Frame.php | 4 +- app/Classes/Frame/Ansi.php | 4 +- app/Classes/Server.php | 12 +++++- app/Console/Commands/FrameImport.php | 13 +++++-- data/1a-main.ans | 38 +++++++++---------- data/99a-goodbye.ans | 14 +++---- .../2018_12_09_103357_create_framemeta.php | 3 +- 8 files changed, 51 insertions(+), 38 deletions(-) diff --git a/.gitattributes b/.gitattributes index 967315d..66b049d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,5 @@ *.css linguist-vendored *.scss linguist-vendored *.js linguist-vendored +*.ans text eol=crlf CHANGELOG.md export-ignore diff --git a/app/Classes/Frame.php b/app/Classes/Frame.php index 4461ea2..19704c0 100644 --- a/app/Classes/Frame.php +++ b/app/Classes/Frame.php @@ -346,7 +346,7 @@ abstract class Frame */ private function render_page(int $num,string $frame) { - if ($num > 999999999) + if ($num > (int)str_repeat(9,static::$pagenum_length)) throw new \Exception('Page Number too big',500); if (strlen($frame) !== 1) @@ -400,7 +400,7 @@ abstract class Frame // Header $sid = R_RED.'T'.R_BLUE.'E'.R_GREEN.'S'.R_YELLOW.'T'; $content .= substr($sid.'-'.str_repeat('12345678901234567890',4),0,static::$header_length+(strlen($sid)-$so->strlenv($sid))). - R_WHITE.'999999999a'.R_RED.sprintf('%07.0f',999).'u'; + R_WHITE.str_repeat('9',static::$pagenum_length).'a'.R_RED.sprintf('%07.0f',999).'u'; $content .= R_WHITE.str_repeat('+-',static::$frame_width/2-3).' '.R_RED.'01'; $content .= R_WHITE.'Name: '.ESC.str_repeat('t',5).' |'.str_repeat('+-',static::$frame_width/2-8).'|'; diff --git a/app/Classes/Frame/Ansi.php b/app/Classes/Frame/Ansi.php index 2253f6b..84bfdce 100644 --- a/app/Classes/Frame/Ansi.php +++ b/app/Classes/Frame/Ansi.php @@ -12,8 +12,8 @@ class Ansi extends AbstractFrame public static $frame_length = 22; public static $frame_width = 80; - public static $header_length = 60; - public static $pagenum_length = 9; + public static $header_length = 58; + public static $pagenum_length = 11; public static $cost_length = 7; public static $cost_unit = 'u'; diff --git a/app/Classes/Server.php b/app/Classes/Server.php index 1aa6452..ab36449 100644 --- a/app/Classes/Server.php +++ b/app/Classes/Server.php @@ -584,10 +584,18 @@ abstract class Server { break; } + // Bookmark page + if ($cmd === '05') { + $this->sendBaseline($client, RED.'NOT IMPLEMENTED YET?'); + $mode = FALSE; + + break; + } + // Report a problem if ($cmd === '08') { $this->sendBaseline($client, RED.'NOT IMPLEMENTED YET?'); - $read = STAR; + $mode = FALSE; break; } @@ -617,7 +625,7 @@ abstract class Server { $current['fieldreset'] = TRUE; } else { - $mode = false; + $mode = FALSE; } break; diff --git a/app/Console/Commands/FrameImport.php b/app/Console/Commands/FrameImport.php index fb165d8..0c85b5b 100644 --- a/app/Console/Commands/FrameImport.php +++ b/app/Console/Commands/FrameImport.php @@ -76,16 +76,21 @@ class FrameImport extends Command $o->frame = $this->argument('frame'); $o->index = $this->argument('index'); $o->mode_id = $mo->id; + $o->access = $this->option('access'); + $o->public = $this->option('public'); + $o->cost = $this->option('cost'); + $o->type = $this->option('type'); } + // We need to escape any back slashes. $o->content = str_replace('\\','\\\\',($this->option('trim')) ? substr(file_get_contents($this->argument('file')),40) : file_get_contents($this->argument('file'))); - $o->access = $this->option('access'); - $o->public = $this->option('public'); - $o->cost = $this->option('cost'); - $o->type = $this->option('type'); + // If we have 0x1aSAUCE, we'll discard the sauce. + if ($x = strpos($o->content,chr(0x1a).'SAUCE')) { + $o->content = substr($o->content,0,$x-1).chr(0x0a); + } $o->save(); } diff --git a/data/1a-main.ans b/data/1a-main.ans index 9bae560..c7f2a18 100644 --- a/data/1a-main.ans +++ b/data/1a-main.ans @@ -1,19 +1,19 @@ - ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ -ͳù Õ¸Õ¸ú³Í³ù Õ͸ù³Ô͸ù Õ;ͳù Õ͸ú³  ddddddddddddddddd ³ ³Ô¾³ ³ ³ ÀÄÙ ³²²³ ³°² ³ ³²³ ³ -°³ ³²±³ ³°³ Õ͸ ³°°³ ³²Û°³ ³±³ ³ -±³ ³±°³ ³±³ ³°³ ³±±³ ³°±±³ ³°³ ³ -ͳù ³Íͳù³Í³ù ³Í³ù³ÚÄÙù ÀĿͳù ³Í³ù³  *0# to get back here anytime ÔÍ; Ô; ÔÍÍ; Ô;ÔÍÍÍÍÍÍ; ÔÍÍ; Ô; - - ß ß ßßß ßßÜ ßßß ßßß - Ü Ü Ü Ü Ü Ü Üß  ÜßÜ - ßßß ß ß ßß ßßß ß ß -ßßß ßßß ßßß ßßß ßßß ßßß ß ß ßßß ßßß ß ßßß ßßß -Ü Ü Ü Ü Ü ßßÜ Ü ÜßÜ Ü Ü ÜÜ Ü Ü Ü Ü Ü -ßßß ßßß ß ß ßßß ß ß ß ßßß ßßß ß ß ßßß ß ß - - - 1 Messages*90# User Menu - 3 Fido Networks*91# Messages - 5 Directory*95# Help - 8 Help*97# Directory - 9 About this System*99# Log Off + ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ +ͳù Õ¸Õ¸ú³Í³ù Õ͸ù³Ô͸ù Õ;ͳù Õ͸ú³Í  ddddddddddddddddd ³ ³Ô¾³ ³ ³ ÀÄÙ ³²²³ ³°² ³ ³²³ ³  +°³ ³²±³ ³°³ Õ͸ ³°°³ ³²Û°³ ³±³ ³° +±³ ³±°³ ³±³ ³°³ ³±±³ ³°±±³ ³°³ ³± +ͳù ³Íͳù³Í³ù ³Í³ù³ÚÄÙù ÀĿͳù ³Í³ù³Í  *0# to get back here anytime ÔÍ; Ô; ÔÍÍ; Ô;ÔÍÍÍÍÍÍ; ÔÍÍ; Ô; + + ß ß ßßß ßßÜ ßßß ßßß + Ü Ü Ü Ü Ü Ü Üß  ÜßÜ + ßßß ß ß ßß ßßß ß ß +ßßß ßßß ßßß ßßß ßßß ßßß ß ß ßßß ßßß ß ßßß ßßß +Ü Ü Ü Ü Ü ßßÜ Ü ÜßÜ Ü Ü ÜÜ Ü Ü Ü Ü Ü +ßßß ßßß ß ß ßßß ß ß ß ßßß ßßß ß ß ßßß ß ß + + + 1 Messages*90# User Menu + 3 Fido Networks*91# Messages + 5 Directory*95# Help + 8 Help*97# Directory + 9 About this System*99# Log Off \ No newline at end of file diff --git a/data/99a-goodbye.ans b/data/99a-goodbye.ans index 24dd406..04b6aac 100644 --- a/data/99a-goodbye.ans +++ b/data/99a-goodbye.ans @@ -1,8 +1,8 @@  ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄ¿ ÚÄÄÄ¿ ÚÄ¿ ÚÄÄÄÄÄÄÄ¿ -ͳù ÕÍÍ;ͳù Õ͸ù³Í³ù Õ͸ù³Í³ù Õ͸À¿Í³ù Õ͸ù³Í³ù ³Í³ù³Í³ù Õ͸ù³ - ³ ³ÚÄÄ¿°³ ³Û³ ³°³ ³Û³ ³°³ ³Û³ ³ ³ ÀÄÙÚÙ ³ ÀÄÙ ³ ³ À¿ÀÄÙ -°³ ³À¿ú³±³ ³²³ ³±³ ³²³ ³±³ ³²³ ³°³ ÚÄ¿Ô¸°ÔÍÍÍÍ͸ ³°³ ÚÙÚÄ¿ -±³ ³°³ ³²³ ÀÄÙ ³²³ ÀÄÙ ³²³ ÀÄÙ ³±³ ³°³ ³±ÚÄÄÄÄÄÙ ³±³ ³°³ ³ -ͳù Ô;ù³Í³ùù³Í³ùù³Í³ùÚÙͳù Ô;ù³Í³ùù³Í³ù Ô;ù³ - ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; - Thanks for calling. Please come back again... \ No newline at end of file +ͳù ÕÍÍ;ͳù Õ͸ù³Í³ù Õ͸ù³Í³ù Õ͸À¿Í³ù Õ͸ù³Í³ù ³Í³ù³Í³ù Õ͸ù³Í + ³ ³ÚÄÄ¿°³ ³Û³ ³°³ ³Û³ ³°³ ³Û³ ³ ³ ÀÄÙÚÙ ³ ÀÄÙ ³ ³ À¿ÀÄÙ  +°³ ³À¿ú³±³ ³²³ ³±³ ³²³ ³±³ ³²³ ³°³ ÚÄ¿Ô¸°ÔÍÍÍÍ͸ ³°³ ÚÙÚÄ¿° +±³ ³°³ ³²³ ÀÄÙ ³²³ ÀÄÙ ³²³ ÀÄÙ ³±³ ³°³ ³±ÚÄÄÄÄÄÙ ³±³ ³°³ ³± +ͳù Ô;ù³Í³ùù³Í³ùù³Í³ùÚÙͳù Ô;ù³Í³ùù³Í³ù Ô;ù³Í + ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; ÔÍÍÍÍÍÍ; + Thanks for calling. Please come back again...  diff --git a/database/migrations/2018_12_09_103357_create_framemeta.php b/database/migrations/2018_12_09_103357_create_framemeta.php index d430b31..42ca864 100644 --- a/database/migrations/2018_12_09_103357_create_framemeta.php +++ b/database/migrations/2018_12_09_103357_create_framemeta.php @@ -16,7 +16,7 @@ class CreateFramemeta extends Migration $this->down(); Schema::create('framemeta', function (Blueprint $table) { - $table->integer('frame_id')->index(); + $table->integer('frame_id')->index()->unique(); $table->string('r0')->default('*'); $table->string('r1')->default('*'); $table->string('r2')->default('*'); @@ -27,7 +27,6 @@ class CreateFramemeta extends Migration $table->string('r7')->default('*'); $table->string('r8')->default('*'); $table->string('r9')->default('*'); - }); Schema::table('framemeta', function (Blueprint $table) {