-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement utils module and WIP readme
- Loading branch information
1 parent
7299ae6
commit 713cd36
Showing
5 changed files
with
210 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { EventEmitter } from "https://deno.land/[email protected]/node/events.ts"; | ||
import { iter } from "https://deno.land/[email protected]/io/util.ts"; | ||
import { Config } from "./config.ts"; | ||
import { Buffer } from "https://deno.land/[email protected]/node/buffer.ts"; | ||
|
||
export interface JavaServerConfig { | ||
jar: string; | ||
|
@@ -71,6 +72,12 @@ export class JavaServer extends EventEmitter { | |
this.stderrIter(); | ||
} | ||
|
||
public send(message: string) { | ||
if (!this.process || !this.process.stdin) return; | ||
|
||
this.process.stdin.write(Buffer.from(message + "\n")); | ||
} | ||
|
||
private async stdoutIter() { | ||
try { | ||
if (this.process?.stdout && this.config.javaServer.pipeStdout) { | ||
|
Oops, something went wrong.