Quote:
Originally Posted by Zeroxelli
@velorian
If you solved the problem, make a guide. Do some good, and shut up the forthcoming six thousand topics.
|
Ja, I was going to, but hadda have a timeout after being uber pissed at my server after 3 days of trying to get it working right xD.
If Andrew doesn't mind correcting the AuthSocket bit in his first post, changing just those on one of my computers fixed the problem but not on the other.
If you STILL can't get your server running on a WAN after following Andrew's Guide:
Note: The IPs in AuthSocket should both be your LOCAL IP (127.0.0.1)
In my case, I was unable to get the server working right after following Andrew's guide. It would only allow either a local connection or an incoming connection, but not both at the same time. I can't explain why it was doing it, but I finally solved it after toying with PacketProcessor and the server.dats. In order to get both connections working on my server the local and WAN IPs had to be swapped around in PacketProcessor.
So it would look like this:
Code:
if (ServerName == "CoEmu")
{
if (AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("WAN IP", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
else if (ServerName == "CoEmu.Nano")
{
if (AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("127.0.0.1", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
}
else if (DBPass == "")
{
Console.WriteLine("[LoginServer](Diagnostic) Set password for " + AccountName);
Database.Database.SetPass(AccountName, Password);
//OKAY to login!
uint Key = (uint)(Random.Next(10000000) << 32);
Key = Key << 32;
Key = (uint)(Key | (uint)Random.Next(10000000));
byte[] Key1 = new byte[4];
byte[] Key2 = new byte[4];
Key1[0] = (byte)(((ulong)Key & 0xff00000000000000L) >> 56);
Key1[1] = (byte)((Key & 0xff000000000000) >> 48);
Key1[2] = (byte)((Key & 0xff0000000000) >> 40);
Key1[3] = (byte)((Key & 0xff00000000) >> 32);
Key2[0] = (byte)((Key & 0xff000000) >> 24);
Key2[1] = (byte)((Key & 0xff0000) >> 16);
Key2[2] = (byte)((Key & 0xff00) >> 8);
Key2[3] = (byte)(Key & 0xff);
if (ServerName == "CoEmu")
{
if (AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("WAN IP", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
else if (ServerName == "CoEmu.Nano")
{
if (AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("127.0.0.1", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
}
else
{
CSocket.Send(Packets.WrongPass());
CSocket.Disconnect();
}
}
else
{
Console.WriteLine("DBPass equals ERROR: " + DBPass);
CSocket.Disconnect();
}
}
}
}
As for the Server.dat
Yours should now have the server name CoEmu.Nano and 127.0.0.1 for an Ip
While any outside connections have the server name CoEmu and your WAN IP
They look like this (you):
Code:
<field name="id">101</field>
<field name="ServerName">CoEmu.Nano</field>
<field name="ServerIP">127.0.0.1</field>
<field name="ServerPort">9958</field>
<field name="FlashName">CoEmu</field>
<field name="FlashIcon">Group3/server2.swf</field>
<field name="FlashHint"></field>
<field name="Child">0</field>
And this (anyone else):
Code:
<field name="id">101</field>
<field name="ServerName">CoEmu</field>
<field name="ServerIP">WAN IP</field>
<field name="ServerPort">9958</field>
<field name="FlashName">CoEmu</field>
<field name="FlashIcon">Group3/server2.swf</field>
<field name="FlashHint"></field>
<field name="Child">0</field>
Again, don't ask WHY it works, or WHY it didn't work to begin with, or WHY swapping the IPs in PacketProcessor and my server.dat changed anything when they shouldn't have mattered as long as each one was pointed to the correct place. I don't know the answer to that but it works, so whatever floats the boat; I'm not going to complain.
You may only have to change the AuthSocket IP, as that was all I had to do on my 32x computer, but if your computer is as retarded as my 64x you might have to go through the entire process