Closed DAThosting closed 4 years ago
Hi, have you replaced nest_id
, egg_id
, location_id
to your panel's id?
Also the environment variables of the eggs should be set too.
Yes the id's are the same on my testpanel. Your example is based on a standard fresh installed panel I guess. Cause all IDs are the same.
try to use the following code:
try {
$servers = $pterodactyl->createServer([
//...
]);
}catch(\Exception $e){
print_r($e->errors());
}
then you can find which parameter failed to pass the validation.
my test panel is not fresh installed, the ids for me is Vanilla Minecraft eggs. however it have two environment variables SERVER_JARFILE, VANILLA_VERSION, you should also pass them in your data array, though they have default value:
"environment" => [
"SERVER_JARFILE" => "server.jar",
"VANILLA_VERSION" => "latest"
]
I will improve the example code later.
Got it... externalID have to be a string... Also IO has set between 10 and 1000.
I get node creation running, but need the keys hash from the configuration file. Searching on the official documentation, I can't find a way to get them. Need them to directly add a node and write the key in core.json
what's the mean of key hash?
If you add a node successfully, then you have to run ether the auto-deployment or use the given config for core.json. In this config right at the bottom there is a "keys". How I get this via API? Or how it is created.
you mean the auto deploy of a server? I think it is unnecessary to get the keys of a daemon, it's just for the communication between panel and daemon, also you should not be able get this via api.
if you mean editing this:
you can check https://dashflo.net/docs/api/pterodactyl/v1/#edit-node, as our documentation about node is not finished yet. It's called
public
in api.
Short automatic procedure:
Now I have to link the panel with my node. The only missing thing is this key to get it run without problems.
I think the api can't do this, you need to install it manually.
Hm, I'll create a issue at pterodactyl directly.
Thank you anyway. Works perfect with your sdk!
I checked the panel routes just now, it seems that only this route can get the token: https://github.com/pterodactyl/panel/blob/39f1392eee10d3256c793dba1ec9e2b5f3daefdf/routes/admin.php#L154
Requested when the clicking Generate Token
from the admin control of the panel.
https://github.com/pterodactyl/panel/issues/1632
Same feature request already asked :D
Hello!
I want create TF2 server.
Whats wrong?
Hi,
nice work. I played around with your sdk and can't create servers.
Uncaught HCGCloud\Pterodactyl\Exceptions\ValidationException: The given data failed to pass validation. in /var/www/testsite/vendor/hcgcloud/pterodactyl-sdk/src/MakesHttpRequests.php:110
My testfile is the following:
My node is on 0.6.12. I am able to create servers right in the panel.
Also I'm playing with your newly created node support, there also I got the same errors.