Trying to do something...

This commit is contained in:
tepiloxtl 2026-02-16 21:24:17 +01:00
parent 917f61cbc2
commit 51617745ba
4 changed files with 28 additions and 0 deletions

View file

@ -31,6 +31,7 @@ libresplit_sources = files(
'src/server.c',
'src/shared.c',
'src/timer.c',
'src/therun.c',
# Settings
'src/settings/definitions.c',

16
src/therun.c Normal file
View file

@ -0,0 +1,16 @@
#include "timer.h"
#include <jansson.h>
char* build_therun_live_payload(ls_timer *timer) {
printf("tesrt");
json_t *root = json_object();
json_t *metadata = json_object();
json_object_set_new(metadata, "game", json_string(timer->game->title));
json_object_set_new(root, "metadata", metadata);
char *payload = json_dumps(root, 0);
json_decref(root);
fprintf(stderr, payload);
return payload;
}

7
src/therun.h Normal file
View file

@ -0,0 +1,7 @@
#ifndef THERUN_H
#define THERUN_H
#include "timer.h"
char* build_therun_live_payload(ls_timer *timer);
#endif // THERUN_H

View file

@ -5,6 +5,7 @@
#include "timer.h"
#include "gui/dialogs.h"
#include "settings/utils.h"
#include "therun.h"
#include "lasr/auto-splitter.h"
@ -884,6 +885,9 @@ int ls_timer_split(ls_timer* timer)
ls_run_save(timer, "FINISHED");
}
}
// char* therun;
build_therun_live_payload(timer);
// fprintf(stderr, therun);
return timer->curr_split;
}
}