PHP game server for TerranQuest (version 1) https://terranquest.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

20 lines
516 B

<?php
/*
* Send the client a list of servers that share the database. The client should
* pick one at random and use it for the entire session.
*/
require 'required.php';
$servers = [];
if (is_empty(SERVER_URLS) || SERVER_URLS == []) {
$servers[] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
} else {
foreach (SERVER_URLS as $server) {
$servers[] = $server;
}
}
die(json_encode($servers));