pvpgn-server
pvpgn-server copied to clipboard
Dynamic ip issue
Hello guys, I have dynamic IP and in the config i added my domain name www.xyz.com, but there is a problem. If the IP are changed (router restart ) players can't join in game. They can join only if I restart the pvpgn server. Can be make it a fix? Thanks
I use pvpgn for w3 and into windows server.
Either get a static IP or use dynamic DNS service. This is not a pvpgn problem.
I can't get static IP. My dynamic DNS work great for a icecast server or the ghost++ after router is restarted. The problem is pvpgn server, because cant check and update for the new IP
What is your servaddrs
in bnetd.conf?
could address_translation.conf support domain names too?
servaddrs = ":" # default interface (all) and default port (6112)
and from adress_translation: 192.168.1.1:6137 ingame.go.ro:6137 NONE ANY
Apparently address translation does support domain names but it only loads them on pvpgn startup so when IP changes pvpgn will keep translating on old address.
Digging through https://github.com/pvpgn/pvpgn-server/blob/74b06d022b0b61538590e8c30ec20830ebdd3c5c/src/bnetd/server.cpp it seems that you can send a POSIX signal to pvpgn process to reload various configurations via restart_action -> restart_sig_handle. One of the enums is restart_mode_transfile
which is number 14 in enumeration.
So if I understand correctly, sending a SIGHUP to process shoud reload it. if this actually works you could setup a cronjob to trigger the reload periodically.
This is just quick digging around, I could be wrong.
One way it could be fixed programatically is to trigger the reload periodically from code via some config option but I'm not sure it's worth the effort, that is ofc my personal opinion and anyone is free to patch this in.
edit: Also, it seems /rehash transfile
will do the exact same thing
Thank you Cen for the elaborate solution. I will wait to be integrated in future releases because is over my skill
Try to run /rehash transfile
next time your IP changes and see if it actually works. Then, the easiest workaround would be to setup a chat bot that sends this command every minute.