Hello guys i make a server non-hamachi & people login with my internet ip adress so when i try to login i cant because i cant login to my self so i tried to make a second ip adress which is the hamachi one as i am going to login alone, the problem now that i made the coding for the second ip but it doesnt work the client says "Failed To Login To Game Server" here is the coding so please any one that can fix it release the fix and thank you for reading my post.
First open AuthWorker & search for
Code:
static string GameIP;
Under that i wrote
Code:
static.string HamachiIP;
Then search for
Code:
public static void StartServer(string GameIP)
{
AuthWorker.GameIP = GameIP;
try
{
Listener = new Connection();
Listener.SetConnHandler(new ConnectionArrived(ConnectionHandler));
Listener.SetDataHandler(new DataArrived(DataHandler));
Listener.SetDCHandler(new Disconnection(DCHandler));
Listener.Listen(9958);
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}
Under that i wrote
Code:
public static void StartServer2(string LocalHost)
{
AuthWorker.LocalHost = GameIP;
try
{
Listener = new Connection();
Listener.SetConnHandler(new ConnectionArrived(ConnectionHandler));
Listener.SetDataHandler(new DataArrived(DataHandler));
Listener.SetDCHandler(new Disconnection(DCHandler));
Listener.Listen(9959);
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}
Then search for
Code:
AC.Send(Packets.SendAuthentication(GameIP, IV));
And after that i wrote
Code:
AC.Send(Packets.SendAuthentication(LocalHost, IV));
now i am done in the AuthWorker
Now open GameWorker & search for
Code:
public static void StartServer()
{
try
{
Listener = new Connection();
Listener.SetConnHandler(new ConnectionArrived(ConnectionHandler));
Listener.SetDataHandler(new DataArrived(DataHandler));
Listener.SetDCHandler(new Disconnection(DCHandler));
Listener.Listen(5816);
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}
Under that i wrote
Code:
public static void StartServer2()
{
try
{
Listener = new Connection();
Listener.SetConnHandler(new ConnectionArrived(ConnectionHandler));
Listener.SetDataHandler(new DataArrived(DataHandler));
Listener.SetDCHandler(new Disconnection(DCHandler));
Listener.Listen(5817);
}
catch (Exception Exc) { Program.WriteLine(Exc); }
}
And now we are also done in the GameWorker, Now go to Program.cs & Search for
Code:
NewestCOServer.Main.AuthWorker.StartServer(I.ReadString("Database", "GameServerIP"));
Under that i wrote
Code:
NewestCOServer.Main.AuthWorker.StartServer2(I.ReadString("Database", "GameServerIP2"));
And i wrote
Code:
NewestCOServer.Main.GameWorker.StartServer2();
Now i was done then i openned OldCoDB then Config.ini and wrote under the "GameServerIP = My Internet IP" i wrote
"GameServerIP2 = My Hamachi IP"
now i was done in everything then i openned the server.dat and put my hamachi ip then i tried to login then the error appeared so if any one that can fix this problem plz post it and thank you xD