mirror of
https://github.com/LibreSplit/LibreSplit.git
synced 2026-03-16 09:50:32 +00:00
Trying to do something...
This commit is contained in:
parent
917f61cbc2
commit
51617745ba
4 changed files with 28 additions and 0 deletions
|
|
@ -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
16
src/therun.c
Normal 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
7
src/therun.h
Normal 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
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue