9958 = Authentication Server. Some of you might know it as/believe it is the Login Server. Afaik, you can change this in the Server.dat
5816 = Game Server. You probably knew this already, however it is not as easy to change as the Auth Server's port. To change this (this works for 5095, not sure about 5165) you have to find a byte[] called something like AnswerAuth or AuthAnswer. Located in CoEmu's LoginServer, the file is called PacketStructs or Packets I believe. Than find a void where your IP is located, perhaps something like LocalIP(?).
Now here is what to do:
Go to google and type: "-Your Port- to hexadecimal". Than, try cutting this in 2 equal pieces, skipping the 0x part. So, 13EC would become 13 and EC.
Now back to the void, the two lines, below the
Code:
for (int x = 0; x < LocalIP.Length; x++)
{
PacketData[12 + x] = (byte)LocalIP[x];
}
part, add those parts upsidedown.
So if you would have "1314", add "0x14" would go on top, and "0x13" would go below this. This may sound weird, but its just CO's way of sending data.