aboutsummaryrefslogtreecommitdiff
path: root/src/client/server_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/server_connection.h')
-rw-r--r--src/client/server_connection.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/client/server_connection.h b/src/client/server_connection.h
new file mode 100644
index 0000000..e5b7167
--- /dev/null
+++ b/src/client/server_connection.h
@@ -0,0 +1,27 @@
+#ifndef SERVER_CONNECTION_H
+#define SERVER_CONNECTION_H
+
+#include <basic/basic.h>
+#include <crypto/rsa.h>
+#include <os/os.h>
+#include <messages/messages.h>
+
+struct Fscord;
+
+typedef enum {
+ SERVER_CONNECTION_NOT_ESTABLISHED,
+ SERVER_CONNECTION_ESTABLISHING,
+ SERVER_CONNECTION_ESTABLISHED
+} ServerConnectionStatus;
+
+void server_connection_create(Arena *arena, struct Fscord *fscord);
+
+ServerConnectionStatus server_connection_get_status(void);
+void server_connection_establish(char *address, u16 port, EVP_PKEY *server_rsa_pub);
+void server_connection_terminate(void);
+b32 server_connection_handle_events(void);
+
+void send_c2s_login(String32 *username, String32 *password);
+void send_c2s_chat_message(String32 *content);
+
+#endif // SERVER_CONNECTION_H