Skip to content

Commit

Permalink
Minor rearranging
Browse files Browse the repository at this point in the history
  • Loading branch information
darkshade9 committed Jan 18, 2024
1 parent bebf5c8 commit 53bc001
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/g_libcurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,16 @@ void announce_server_populating()
return;
}

json_t *srv_announce = json_object();
int playercount = CountRealPlayers();

// Do not announce if player count is less than 25% of maxclients
float threshold = fmax((game.maxclients * 0.2), 3);
if (playercount < threshold)
return;

// All the checks are out of the way, now to form the data and send it

json_t *srv_announce = json_object();

json_object_set_new(srv_announce, "hostname", json_string(hostname->string));
json_object_set_new(srv_announce, "server_ip", json_string(server_ip->string));
json_object_set_new(srv_announce, "server_port", json_string(server_port->string));
Expand Down

0 comments on commit 53bc001

Please sign in to comment.