mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-28 22:51:29 +00:00
This will be the Master Server in 2020
This commit is contained in:
parent
3f9f07af84
commit
f0cc851b29
1 changed files with 13 additions and 32 deletions
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
consvar_t cv_http_masterserver = {
|
consvar_t cv_http_masterserver = {
|
||||||
"http_masterserver",
|
"http_masterserver",
|
||||||
"https://www.jameds.org/SRB2/MS/0",
|
"https://mb.srb2.org/MS/0",
|
||||||
CV_SAVE,
|
CV_SAVE,
|
||||||
|
|
||||||
NULL, NULL, 0, NULL, NULL, 0, 0, NULL/* C90 moment */
|
NULL, NULL, 0, NULL, NULL, 0, 0, NULL/* C90 moment */
|
||||||
|
@ -166,7 +166,7 @@ HMS_fetch_rooms (int joining)
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
hms = HMS_connect("rooms?token=%s&verbose", cv_masterserver_token.string);
|
hms = HMS_connect("rooms");
|
||||||
if (HMS_do(hms))
|
if (HMS_do(hms))
|
||||||
{
|
{
|
||||||
p = hms->buffer;
|
p = hms->buffer;
|
||||||
|
@ -190,16 +190,6 @@ HMS_fetch_rooms (int joining)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (joining)
|
|
||||||
{
|
|
||||||
room_list[i].header.buffer[0] = 1;
|
|
||||||
room_list[i].id = 0;
|
|
||||||
strcpy(room_list[i].name, "All");
|
|
||||||
strcpy(room_list[i].motd, "Wildcard.");
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
room_list[i].header.buffer[0] = 0;
|
room_list[i].header.buffer[0] = 0;
|
||||||
}
|
}
|
||||||
HMS_end(hms);
|
HMS_end(hms);
|
||||||
|
@ -213,15 +203,15 @@ HMS_register (void)
|
||||||
char *title;
|
char *title;
|
||||||
int ok;
|
int ok;
|
||||||
|
|
||||||
hms = HMS_connect("rooms/%d/register?token=%s",
|
hms = HMS_connect("rooms/%d/register", ms_RoomId);
|
||||||
ms_RoomId,
|
|
||||||
cv_masterserver_token.string
|
|
||||||
);
|
|
||||||
title = curl_easy_escape(hms->curl, cv_servername.string, 0);
|
title = curl_easy_escape(hms->curl, cv_servername.string, 0);
|
||||||
sprintf(post,
|
sprintf(post,
|
||||||
"port=%d&title=%s",
|
"port=%d&title=%s&version=%d.%d.%d",
|
||||||
current_port,
|
current_port,
|
||||||
title
|
title,
|
||||||
|
VERSION/100,
|
||||||
|
VERSION%100,
|
||||||
|
SUBVERSION
|
||||||
);
|
);
|
||||||
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS, post);
|
curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS, post);
|
||||||
|
|
||||||
|
@ -243,10 +233,7 @@ void
|
||||||
HMS_unlist (void)
|
HMS_unlist (void)
|
||||||
{
|
{
|
||||||
struct HMS_buffer *hms;
|
struct HMS_buffer *hms;
|
||||||
hms = HMS_connect("servers/%s/unlist?token=%s",
|
hms = HMS_connect("servers/%s/unlist", hms_server_token);
|
||||||
hms_server_token,
|
|
||||||
cv_masterserver_token.string
|
|
||||||
);
|
|
||||||
curl_easy_setopt(hms->curl, CURLOPT_CUSTOMREQUEST, "POST");
|
curl_easy_setopt(hms->curl, CURLOPT_CUSTOMREQUEST, "POST");
|
||||||
/*curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS,
|
/*curl_easy_setopt(hms->curl, CURLOPT_POSTFIELDS,
|
||||||
cv_masterserver_token.string);*/
|
cv_masterserver_token.string);*/
|
||||||
|
@ -261,10 +248,7 @@ HMS_update (void)
|
||||||
struct HMS_buffer *hms;
|
struct HMS_buffer *hms;
|
||||||
char *title;
|
char *title;
|
||||||
|
|
||||||
hms = HMS_connect("servers/%s/update?token=%s",
|
hms = HMS_connect("servers/%s/update", hms_server_token);
|
||||||
hms_server_token,
|
|
||||||
cv_masterserver_token.string
|
|
||||||
);
|
|
||||||
|
|
||||||
title = curl_easy_escape(hms->curl, cv_servername.string, 0);
|
title = curl_easy_escape(hms->curl, cv_servername.string, 0);
|
||||||
sprintf(post, "title=%s", title);
|
sprintf(post, "title=%s", title);
|
||||||
|
@ -280,7 +264,7 @@ void
|
||||||
HMS_list_servers (void)
|
HMS_list_servers (void)
|
||||||
{
|
{
|
||||||
struct HMS_buffer *hms;
|
struct HMS_buffer *hms;
|
||||||
hms = HMS_connect("servers?token=%s", cv_masterserver_token.string);
|
hms = HMS_connect("servers");
|
||||||
if (HMS_do(hms))
|
if (HMS_do(hms))
|
||||||
CONS_Printf("%s", hms->buffer);
|
CONS_Printf("%s", hms->buffer);
|
||||||
HMS_end(hms);
|
HMS_end(hms);
|
||||||
|
@ -303,13 +287,10 @@ HMS_fetch_servers (msg_server_t *list, int room_number)
|
||||||
|
|
||||||
if (room_number > 0)
|
if (room_number > 0)
|
||||||
{
|
{
|
||||||
hms = HMS_connect("rooms/%d/servers?token=%s",
|
hms = HMS_connect("rooms/%d/servers", room_number);
|
||||||
room_number,
|
|
||||||
cv_masterserver_token.string
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
hms = HMS_connect("servers?token=%s", cv_masterserver_token.string);
|
hms = HMS_connect("servers");
|
||||||
|
|
||||||
if (HMS_do(hms))
|
if (HMS_do(hms))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue