diff options
author | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:11:21 +0200 |
---|---|---|
committer | Lassi Pulkkinen <lassi@pulk.fi> | 2024-10-31 03:51:35 +0200 |
commit | ae44478b30d890fe0fb04022f44d474dcdcc3f9d (patch) | |
tree | 5f462459ae4b47d22114eed717d1382d08cf4dfe /main+android.ha |
Diffstat (limited to 'main+android.ha')
-rw-r--r-- | main+android.ha | 38 |
1 files changed, 38 insertions, 0 deletions
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); +}; |