diff --git a/.vscode/settings.json b/.vscode/settings.json index f8acc26..1535e13 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,5 @@ { "deno.enable": true, "deno.lint": true, - "deno.unstable": true, - "deno.import_intellisense_origins": { - "https://deno.land": true - } + "deno.unstable": true } \ No newline at end of file diff --git a/deps.ts b/deps.ts index e6111ea..62b6ba9 100644 --- a/deps.ts +++ b/deps.ts @@ -1 +1,2 @@ -export { concat, equals } from 'https://deno.land/std@0.92.0/bytes/mod.ts'; +export { concat, equals } from 'https://deno.land/std@0.135.0/bytes/mod.ts'; +export { iterateReader } from 'https://deno.land/std@0.135.0/streams/conversion.ts'; diff --git a/rcon.ts b/rcon.ts index 7df6d76..3bca3a1 100644 --- a/rcon.ts +++ b/rcon.ts @@ -1,5 +1,4 @@ -import { concat, equals } from './deps.ts'; -import { iterateReader } from 'https://deno.land/std@0.117.0/streams/conversion.ts'; +import { concat, equals, iterateReader } from './deps.ts'; const FrameBuffer = new Uint8Array([0, 1, 0, 0]); @@ -74,7 +73,7 @@ export class Rcon { port: this.port, }); - void this.read(); + this.read().catch(() => {}); await this.sendData( new Uint8Array([0, 0, 0, 0]), diff --git a/terminal.ts b/terminal.ts index 8b37d41..444cc2a 100644 --- a/terminal.ts +++ b/terminal.ts @@ -1,6 +1,6 @@ // https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html -import { equals } from './deps.ts'; +import { equals, iterateReader } from './deps.ts'; const ENTER = new Uint8Array([13]); const CTRL_C = new Uint8Array([3]); @@ -30,7 +30,7 @@ export async function* terminal(prompt = "> ") { await Deno.stdout.write(encoder.encode(prompt)); while (true) { - for await (const chunk of Deno.iter(Deno.stdin)) { + for await (const chunk of iterateReader(Deno.stdin)) { const key = { enter: equals(chunk, ENTER), up: equals(chunk, ARROW_UP),