1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

improve master server to POST json

This commit is contained in:
IntelOrca
2015-11-08 22:03:35 +00:00
parent c70880c0a5
commit 2e55495470
5 changed files with 115 additions and 22 deletions

View File

@@ -130,7 +130,12 @@ static void twitch_join()
_twitchState = TWITCH_STATE_JOINING;
_twitchIdle = false;
http_request_json_async(url, [](http_json_response *jsonResponse) -> void {
http_json_request request;
request.url = url;
request.method = HTTP_METHOD_GET;
request.body = NULL;
http_request_json_async(&request, [](http_json_response *jsonResponse) -> void {
if (jsonResponse == NULL) {
_twitchState = TWITCH_STATE_LEFT;
console_writeline("Unable to connect to twitch channel.");
@@ -191,7 +196,12 @@ static void twitch_get_followers()
_twitchState = TWITCH_STATE_WAITING;
_twitchIdle = false;
http_request_json_async(url, [](http_json_response *jsonResponse) -> void {
http_json_request request;
request.url = url;
request.method = HTTP_METHOD_GET;
request.body = NULL;
http_request_json_async(&request, [](http_json_response *jsonResponse) -> void {
if (jsonResponse == NULL) {
_twitchState = TWITCH_STATE_JOINED;
} else {
@@ -212,7 +222,12 @@ static void twitch_get_messages()
_twitchState = TWITCH_STATE_WAITING;
_twitchIdle = false;
http_request_json_async(url, [](http_json_response *jsonResponse) -> void {
http_json_request request;
request.url = url;
request.method = HTTP_METHOD_GET;
request.body = NULL;
http_request_json_async(&request, [](http_json_response *jsonResponse) -> void {
if (jsonResponse == NULL) {
_twitchState = TWITCH_STATE_JOINED;
} else {