Skip to content

Commit

Permalink
Update PterodactylServerType.php
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkIncognito85 authored May 9, 2022
1 parent f8eabe9 commit feabb78
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/Pterodactyl/PterodactylServerType.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,18 @@ public function createAccount(OrderItem $item): string
$backups = $config->backups;

$oom_disabled = (bool)$config->oomKill;
try {
$serviceId = (string)$item->getService()->getId();
$id = $this->getServerId($serviceId, $item->getServer(), false);
$serverData['external_id'] = $serviceId;
$this->container->get(PterodactylMailer::class)->sendTo($item->getOrder()->getUser(), $item->getServer(), $item->getService(), $password);
$this->servers->saveServer($serviceId, $item->getServer()->getId(), $item->getItem()->getOrderable()->getId());
return 'success';
} catch (\Exception $e) {

}
try {
$serviceId = (string)$item->getService()->getId();
$id = $this->getServerId($serviceId, $item->getServer(), false);

if ($id != null){
$this->container->get(PterodactylMailer::class)->sendTo($item->getOrder()->getUser(), $item->getServer(), $item->getService(), $password);
$this->servers->saveServer($serviceId, $item->getServer()->getId(), $item->getItem()->getOrderable()->getId());
return 'success';
}
} catch (\Exception $e) {

}
$serverData = [
'name' => $name,
'user' => (int)$userId,
Expand Down

0 comments on commit feabb78

Please sign in to comment.