aboutsummaryrefslogtreecommitdiff
path: root/src/client/server_connection.h
diff options
context:
space:
mode:
authorfschildt <florian.schildt@protonmail.com>2025-08-22 15:23:11 +0200
committerfschildt <florian.schildt@protonmail.com>2025-08-22 15:23:11 +0200
commit2050c0e0576f05156f192aa4caf48834d2f28b14 (patch)
treeee58bd35b0df0a1bacfbc9700ed99ce80c99294e /src/client/server_connection.h
first commitHEADmaster
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