public function __construct(HereAuth $main, bool $overwrite, string $readerClass, array $readerArgs, string $writerClass, array $writerArgs) { if (!(class_exists($readerClass, true) and class_exists($writerClass, true))) { throw new \RuntimeException("Unknown reader/writer class"); } class_exists(AccountInfo::class, true); // TODO hack class_exists(FormattedArgumentMap::class, true); // TODO hack class_exists(MySQLDatabase::class, true); // TODO hack class_exists(\InvalidKeyException::class, true); // TODO hack class_exists(StringUtils::class, true); // TODO hack class_exists(MySQLEscapeInvokable::class, true); // TODO hack $this->readerClass = $readerClass; $this->readerArgs = serialize($readerArgs); $this->writerClass = $writerClass; $this->writerArgs = serialize($writerArgs); $this->defaultOpts = serialize(AccountOpts::defaultInstance($main)); $this->overwrite = $overwrite; $rc = $this->readerClass; /** @type AccountReader $reader */ $this->reader = new $rc($main, $this); }
public function __construct(HereAuth $main, $readerClass, $readerArgs, $writerClass, $writerArgs) { $this->readerClass = $readerClass; $this->readerArgs = $readerArgs; $this->writerClass = $writerClass; $this->writerArgs = $writerArgs; $this->defaultOpts = AccountOpts::defaultInstance($main); }
public static function defaultInstance(HereAuth $main, Player $player) { $info = new self(); $info->name = strtolower($player->getName()); $info->passwordHash = null; $info->registerTime = -1; $info->lastLogin = -1; $info->lastIp = null; $info->lastSecret = null; $info->lastUuid = null; $info->lastSkin = null; $info->opts = AccountOpts::defaultInstance($main); return $info; }
public function __construct(HereAuth $main) { $this->defaultOpts = AccountOpts::defaultInstance($main); }
public function __construct(HereAuth $main, ImporterThread $thread) { $this->defaultOpts = AccountOpts::defaultInstance($main); $this->thread = $thread; }
public static function defaultInstance($player, $optsOrMain) { if ($player instanceof Player) { $player = $player->getName(); } $info = new self(); $info->name = strtolower($player); $info->passwordHash = ""; $info->registerTime = -1; $info->lastLogin = -1; $info->lastIp = null; $info->lastSecret = null; $info->lastUuid = null; $info->lastSkinHash = null; if ($optsOrMain instanceof AccountOpts) { $info->opts = $optsOrMain; } elseif ($optsOrMain instanceof HereAuth) { $info->opts = AccountOpts::defaultInstance($optsOrMain); } $info->multiHash = []; return $info; }