Sure you could rewrite it with network primitives, whatever language you want, doesnt matter but why would you? You can write it in assembly if you want. But why stop there when you can write machine code for each specific cpu architecture? Python with sockets library is just fine.
umm.. you were the one who said there was a problem with your python client.
I was suggesting making it simpler not more complex.
"machine code for each specific cpu architecture" are you tripping on peyote right now?
Anyway, if you are willing to do this and you can get iL to help you server side, then cool - when you get it working there are more games hosted. This is a good thing, I would like to see it happen regardless of whether or not I choose to use it.
Any HLL actually adds complexity as a direct consequence of making it appear simpler to the user. AFAIK war2, ce, and the autoloader are all C++ programs (compiled into ML of course). I have no idea why you would want to complicate things by throwing python in the middle, but if that is the way you know how to do it, and you are willing to put in the time to do it then go for it.
I do know there is absolutely no reason for you to introduce an SQL login, however you seem to have contrived a reason anyway. When you remove all reference to this from your code I will be a lot less sceptical about your intentions.
you dont need to know the port the other players have for their war2 client, all that matters is that you source the traffic from your own war2 port.
Have you considered that this is the source of your NAT problems? You are only considering the local routing table for the host, not the address translation for the joining client.
I'm not a NAT expert, but we do know that ANYONE who can join a game can successfully hole-punch regardless of the intervening protocols. That is proven every time they join a game. Just use the right port number, it's only 2 bytes, pretty sure that wont blow your budget
And quite honestly: if you do just want to do this, but you have just got it a bit muddled up, then PM or discord me and I'll give you what advice I can.