Example #1
0
 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);
 }
Example #2
0
 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);
 }
Example #3
0
 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;
 }
Example #4
0
 public function __construct(HereAuth $main)
 {
     $this->defaultOpts = AccountOpts::defaultInstance($main);
 }
Example #5
0
 public function __construct(HereAuth $main, ImporterThread $thread)
 {
     $this->defaultOpts = AccountOpts::defaultInstance($main);
     $this->thread = $thread;
 }
Example #6
0
 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;
 }