From ae44478b30d890fe0fb04022f44d474dcdcc3f9d Mon Sep 17 00:00:00 2001 From: Lassi Pulkkinen Date: Thu, 31 Oct 2024 03:11:21 +0200 Subject: Initial commit (import old repo) --- main+android.ha | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 main+android.ha (limited to 'main+android.ha') diff --git a/main+android.ha b/main+android.ha new file mode 100644 index 0000000..3ccd4d1 --- /dev/null +++ b/main+android.ha @@ -0,0 +1,38 @@ +use bufio; +use fmt; +use getopt; +use io; +use mcproto; +use memio; +use net; +use net::dial; +use os; +use strings; +use trace; +use unix::signal; +use uuid; + +export fn main() void = { + signal::ignore(signal::sig::PIPE); + dial::registersvc("tcp", "minecraft", [], 25565); + + let tracer = newtracer(); + trace::setroot(&tracer); + defer trace::setroot(&trace::silent); + + // (2024 note): change this as needed, obviously. + window_run("192.168.8.2", "Player"); +}; + +fn error(fmt: str, args: fmt::field...) void = { + let s = memio::dynamic(); + defer io::close(&s)!; + fmt::fprintf(&s, "hacraft: ")!; + fmt::fprintfln(&s, fmt, args...)!; + androlog(7, memio::string(&s)!); +}; + +fn die(fmt: str, args: fmt::field...) never = { + error(fmt, args...); + os::exit(1); +}; -- cgit v1.2.3