Skip to content

Commit

Permalink
Multiplayer|Web: Master server never replies with a zero port
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 12, 2016
1 parent ef60124 commit f41250f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions webapi/1/master_server.php
Expand Up @@ -30,6 +30,7 @@

define('DB_TABLE', 'servers');
define('EXPIRE_SECONDS', 300);
define('DEFAULT_PORT', 13209);

// Opens the database connection.
// @return MySQLi object.
Expand Down Expand Up @@ -103,6 +104,8 @@ function parse_announcement($json_data)
$player_names = urlencode(json_encode($server_info->plrs));
$flags = (int) $server_info->flags;

if ($port == 0) $port = DEFAULT_PORT;

$db = db_open();
$table = DB_TABLE;
db_query($db, "DELETE FROM $table WHERE address = $address AND port = $port");
Expand Down

0 comments on commit f41250f

Please sign in to comment.