Skip to content

Commit

Permalink
Fix support for autodetecting server for ladders
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarel committed Apr 11, 2014
1 parent 5f0db1e commit f525c08
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/dispatcher.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function prepreplay($dispatcher, &$reqData, &$out) {

$server = $dispatcher->findServer();
if (!$server) {
$out['errorip'] = $this->getIp();
$out['errorip'] = $dispatcher->getIp();
return;
}
if (
Expand Down Expand Up @@ -338,7 +338,7 @@ public function uploadreplay($dispatcher, &$reqData, &$out) {
public function invalidatecss($dispatcher, &$reqData, &$out) {
$server = $dispatcher->findServer();
if (!$server) {
$out['errorip'] = $this->getIp();
$out['errorip'] = $dispatcher->getIp();
return;
}
// No need to sanitise $server['id'] because it should be safe already.
Expand Down Expand Up @@ -487,7 +487,7 @@ public function ladderupdate($dispatcher, &$reqData, &$out) {

$server = $dispatcher->findServer();
if (!$server) {
$out = 0;
$out['errorip'] = $dispatcher->getIp();
return;
}

Expand Down Expand Up @@ -524,12 +524,12 @@ public function ladderget($dispatcher, &$reqData, &$out) {
}

public function mmr($dispatcher, &$reqData, &$out) {
global $PokemonServers, $users;
global $PokemonServers;
include_once dirname(__FILE__) . '/ntbb-ladder.lib.php';

$server = @$PokemonServers[@$reqData['serverid']];
$server = $dispatcher->findServer();
if (!$server) {
$out['errorip'] = $users->getIp();
$out['errorip'] = $dispatcher->getIp();
return;
}

Expand Down

0 comments on commit f525c08

Please sign in to comment.