Improvements to DC and settings management

This commit is contained in:
root 2018-03-10 18:09:38 +01:00
parent cd8abc2b89
commit 5d9982efa4
2 changed files with 1 additions and 12 deletions

View File

@ -131,7 +131,7 @@ class API extends APIFactory
Logger::$processed_fork = true;
}
return $this->API->__construct($value);
return $this->API->__construct(array_replace_recursive($this->API->settings, $value));
}
return $this->API->storage[$name] = $value;

View File

@ -45,17 +45,6 @@ class DataCenter
}
}
public function dc_disconnect($dc_number)
{
if ($this->curdc === $dc_number) {
$this->curdc = 0;
}
if (isset($this->sockets[$dc_number])) {
\danog\MadelineProto\Logger::log(sprintf(\danog\MadelineProto\Lang::$current_lang['dc_con_stop'], $dc_number), \danog\MadelineProto\Logger::VERBOSE);
unset($this->sockets[$dc_number]);
}
}
public function dc_connect($dc_number)
{
if (isset($this->sockets[$dc_number]) && !isset($this->sockets[$dc_number]->old)) {