summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-05 02:01:34 +0100
committerubq323 <ubq323@ubq323.website>2024-04-05 02:01:34 +0100
commitd097561c1ee24f20d5dd48fbe35301e8d9cc7cac (patch)
tree2a54e6611fc07127909531eb0ccdca5979e60591 /client
parentdf26827a3f00d64f5af01271818c7c8bd7eaa387 (diff)
refactor slightly
Diffstat (limited to 'client')
-rw-r--r--client/main.ha9
1 files changed, 8 insertions, 1 deletions
diff --git a/client/main.ha b/client/main.ha
index a0c25d8..0065eb6 100644
--- a/client/main.ha
+++ b/client/main.ha
@@ -1,6 +1,7 @@
use fmt;
use sdl2;
use math;
+use net;
use net::dial;
def CHUNKSIZE = 512;
@@ -26,11 +27,17 @@ export fn main() void = {
append(pictures, picture_from_surface(surf, offs[i]));
};
+ const conn = match(dial::dial("tcp","localhost","41460")) {
+ case let c: net::socket => yield c;
+ case let err: net::error =>
+ fmt::fatal("couldn't connect to server:",net::strerror(err));
+ };
+
let dstate = drawing_state {
drawing = false,
pos = (0,0),
pictures = pictures,
- conn = dial::dial("tcp","localhost:41460","unknown")!,
+ conn = conn,
};
let camera_pos: pos = (25, 50);