summaryrefslogtreecommitdiff
path: root/src/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.c')
-rw-r--r--src/client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client.c b/src/client.c
index 3bf3649..d15ba8e 100644
--- a/src/client.c
+++ b/src/client.c
@@ -10,6 +10,7 @@
#include "net.h"
#include "ticker.h"
#include "sig.h"
+#include "content.h"
typedef struct {
peer conn;
@@ -80,10 +81,16 @@ int main()
int socket = socket_create("127.0.0.1", "4560", false);
if (socket < 0)
client_exit(&c, EXIT_FAILURE);
- peer_init(&c.conn, socket);
+ str server_name = S("server");
+ peer_init(&c.conn, socket, &server_name);
gfx_alt_buffer(true);
+ SEND_PKT(c.conn, SPKT_HI,
+ ser_str(&pkt, c.name);
+ ser_str(&pkt, c.pass);
+ )
+
ticker t;
ticker_init(&t, NANOS/60);
@@ -122,7 +129,7 @@ int main()
if (c.conn.disco)
client_exit(&c, EXIT_SUCCESS);
if (pkt.len > 0 && !handle_pkt(&c, pkt))
- invalid_pkt(S("server"), pkt);
+ invalid_pkt(&c.conn, pkt);
uint64_t dtime;
if (ticker_tick(&t, &dtime))