Joining a session 'works' but neither the client nor the host reacts to one another, yet.

This commit is contained in:
2025-12-14 21:47:26 +01:00
parent e9080d7332
commit 996b1a3404
5 changed files with 138 additions and 16 deletions

View File

@@ -28,7 +28,7 @@ bool game_instance_host_session(Game_Instance *instance, const Game_Session_Sett
return false;
}
instance->game_session = (Game_Session *)calloc(1, sizeof(Game_Session));
instance->game_session = (Game_Session *)calloc(1, sizeof(Game_Session)); // LEAK
if(settings.online) {
if(instance->game_networking.api != NULL) {
@@ -57,7 +57,7 @@ bool game_instance_host_session(Game_Instance *instance, const Game_Session_Sett
bool game_instance_join_session(Game_Instance *instance, const char *session_id) {
assert(instance != NULL);
printf("Trying to join a session ...\n");
printf("Trying to join a session '%s' ...\n", session_id);
if(instance->game_session != NULL) {
printf("Failed. A session is already active.\n");
@@ -68,8 +68,14 @@ bool game_instance_join_session(Game_Instance *instance, const char *session_id)
printf("Failed. Network is already active.\n");
return false;
}
return false;
instance->game_session = (Game_Session *)calloc(1, sizeof(Game_Session)); // LEAK
if(!networking_try_join(&instance->game_networking, instance->game_session, session_id)) {
return false;
}
return true;
}
bool game_instance_push_local_input(Game_Instance *instance, Simulation_Game_Input input) {