Closed ParadoxiKat closed 7 years ago
The "i can haz ip" URL didn't change since 2011 at least, which is better than "what is my ip" if I remember correctly, so I'll include this change. I have been thinking about this IP parameter, and this pull request is the proof that it could be useful. I will recode it in options.py where parameters are usually parsed. I wonder if actually the "what is my ip" sites are doing a better job than the default IP detection of the metaserver. I will keep this "what is my ip" feature though, just in case. About the default aim range, I don't have a clear idea of what should be the default yet, but I'll think about it.
Note: the new syntax for "ip=IP" is: "-i IP" or "--ip=IP". "--ip IP" is probably working too.
Updated ip retrieval url, and added ip=xxx.xxx.xxx.xxx parameter for stand alone server. The old url http://automation.whatismyip.com/n09230945.asp hasn't been working for a while now. Changed it to http://ipv4.icanhazip.com, which seems to work perfectly. The ip= parameter will just use the ip supplied if it is valid, and not attempt to use any ip retrieval url. Only really useful in rare cases (LIKE MINE!) where the system running the server has multiple external ip addresses, and the one returned from the whatismyip service is not the one you want to have soundrts reporting to the metaserver.
Bug fixed: Aim range wasn't taking into account the possibility that a.range could be None if range value was left out of a soldier definition. None is now replaced with 0 in this case.