From: Holger Schemel Date: Fri, 24 Sep 2021 23:45:30 +0000 (+0200) Subject: merged API functions X-Git-Tag: 4.3.0.0~37 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9e18c7b845bf154f0b1a4603ad907aa20c3b3e90;p=rocksndiamonds.git merged API functions --- diff --git a/src/files.c b/src/files.c index 668a697f..5459194f 100644 --- a/src/files.c +++ b/src/files.c @@ -9171,7 +9171,7 @@ static void ApiGetScoreExt(struct HttpRequest *request, server_scores.updated = TRUE; } -static void ApiGetScore(void *data_raw) +static int ApiGetScoreThread(void *data_raw) { struct HttpRequest *request = checked_calloc(sizeof(struct HttpRequest)); struct HttpResponse *response = checked_calloc(sizeof(struct HttpResponse)); @@ -9179,15 +9179,10 @@ static void ApiGetScore(void *data_raw) ApiGetScoreExt(request, response, data_raw); + FreeThreadData_ApiGetScore(data_raw); + checked_free(request); checked_free(response); -} - -static int ApiGetScoreThread(void *data_raw) -{ - ApiGetScore(data_raw); - - FreeThreadData_ApiGetScore(data_raw); return 0; } @@ -9485,7 +9480,7 @@ static void ApiAddScoreExt(struct HttpRequest *request, server_scores.uploaded = TRUE; } -static void ApiAddScore(void *data_raw) +static int ApiAddScoreThread(void *data_raw) { struct HttpRequest *request = checked_calloc(sizeof(struct HttpRequest)); struct HttpResponse *response = checked_calloc(sizeof(struct HttpResponse)); @@ -9493,15 +9488,10 @@ static void ApiAddScore(void *data_raw) ApiAddScoreExt(request, response, data_raw); + FreeThreadData_ApiAddScore(data_raw); + checked_free(request); checked_free(response); -} - -static int ApiAddScoreThread(void *data_raw) -{ - ApiAddScore(data_raw); - - FreeThreadData_ApiAddScore(data_raw); return 0; } diff --git a/src/screens.c b/src/screens.c index 3f64b882..bb7a2b5b 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4120,22 +4120,17 @@ static void ApiRenamePlayerExt(struct HttpRequest *request, } } -static void ApiRenamePlayer(void *data_raw) +static int ApiRenamePlayerThread(void *data_raw) { struct HttpRequest *request = checked_calloc(sizeof(struct HttpRequest)); struct HttpResponse *response = checked_calloc(sizeof(struct HttpResponse)); ApiRenamePlayerExt(request, response, data_raw); + FreeThreadData_ApiRenamePlayer(data_raw); + checked_free(request); checked_free(response); -} - -static int ApiRenamePlayerThread(void *data_raw) -{ - ApiRenamePlayer(data_raw); - - FreeThreadData_ApiRenamePlayer(data_raw); return 0; }