Closed pimenta1807 closed 1 month ago
Hey can you please share with me your product setup. I assume that your product settings are not set in current way.
here is the product>module setting view
A customer ordered one hour ago and it worked fine again.
Now using the setting
"use_alias_ip": true
in the last image, the server was created on the port 16342. The request shows the port 16343 available. https://pastebin.com/wUSAd83p#google_vignette
just a guess, but perhaps the code is searching for [ip] instead of the [alias] here ?
maybe pteroSync_getServerIPAndPort should be called before server creation. I will test it and get back with the result.
The code is searching only for an ip same as pterodactyl.
How is work is:
It creating 1st the server by pterodactyl then it searching for an extra ports and etc if required on same ip as server ip, and if there is no matches it search for different ip and port until it match them.
I inserted this block of code in order to try to understand better what is happening. The first output is with the alias turned off, and then with the alias turned on.
alias = false https://pastebin.com/YnWqz9YT
alias = true https://pastebin.com/guLbm4re
The allies is only used for display use in clinetarea.
The module won't search ip by allies.
Can you please confirm that $_SERVER_IP
is not being replaced by the alias here ?
Because I don't understand why, when printing the $_SERVER_IP variable in the log, it shows the Alias IP.
That replace it yes. But it does it and the end.
What is your goal ? To use allies ips instand of normal one to create a server?
Your module can create offset ports when "use_alias_ip": false
When using "use_alias_ip": true
, port offset does not work.
The module searches for new ports using the alias IP because the $_SERVER_IP
is being redefined to the alias at the end.
To achieve the expected result, I edited the pteroSync_getServerIPAndPort()
function so that it creates a specific variable for the alias when needed.
If the boolean use_alias_ip
is true
, then pteroSync_updateServerDomain()
is called using:
pteroSync_updateServerDomain(alias, $_SERVER_PORT, $params);
Ahh I see where the issue was. I have added new variable that store the alias ip and used only when it need to store the IP in whmc. You can see in the commit 7aa0cd217a570df7abaabe21fc894f0a4c417855. Try to use the main branch.
Using the main branch, the server is created correctly with all ports and the domain is updated correctly with the alias, but in the client area, this error occurs:
Passing the $serverAliasIp
argument to the pteroSyncGenerateServerStatusArray()
function and replacing $address
with it worked 100% for me. Thank you very much for the module and your work.
Should be okay now.
The log returns "Ports not found" with the port being available while using the alias IP.
The port offset function does work fine when not using the alias option.