pvpgn-server icon indicating copy to clipboard operation
pvpgn-server copied to clipboard

Dynamic ip issue

Open styla01 opened this issue 6 years ago • 8 comments

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.

styla01 avatar May 03 '18 12:05 styla01

Either get a static IP or use dynamic DNS service. This is not a pvpgn problem.

cen1 avatar May 03 '18 13:05 cen1

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

styla01 avatar May 03 '18 14:05 styla01

What is your servaddrs in bnetd.conf?

cen1 avatar May 03 '18 14:05 cen1

could address_translation.conf support domain names too?

TurBoss avatar May 03 '18 16:05 TurBoss

servaddrs = ":" # default interface (all) and default port (6112)

and from adress_translation: 192.168.1.1:6137 ingame.go.ro:6137 NONE ANY

styla01 avatar May 03 '18 18:05 styla01

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

cen1 avatar May 03 '18 20:05 cen1

Thank you Cen for the elaborate solution. I will wait to be integrated in future releases because is over my skill

styla01 avatar May 04 '18 08:05 styla01

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.

cen1 avatar May 04 '18 09:05 cen1