mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-08-20 01:51:42 -05:00
Stop autodetecting serverid for loginserver rqs
The automatic server detection just loops through all registered servers and tries each of them to find the correct one. This process will hang if any registered server isn't responding to DNS queries, which at the number we currently have, makes all servers not sending serverid fail. We now hard-require the Config.serverid setting, to prevent this problem.
This commit is contained in:
@@ -101,10 +101,10 @@ class NTBBSession {
|
||||
}
|
||||
|
||||
function getIp() {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$ip = $_SERVER['REMOTE_ADDR'] ?? '';
|
||||
foreach ($this->trustedproxies as &$proxyip) {
|
||||
if ($this->cidr_match($ip, $proxyip)) {
|
||||
$parts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
|
||||
$parts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'] ?? '');
|
||||
$ip = array_pop($parts);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user