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
Under that i wrote
Then search for
Under that i wrote
Then search for
And after that i wrote
now i am done in the AuthWorker
Now open GameWorker & search for
Under that i wrote
And now we are also done in the GameWorker, Now go to Program.cs & Search for
Under that i wrote
And i wrote
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
First open AuthWorker & search for
Code:
static string GameIP;
Code:
static.string HamachiIP;
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); }
}
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); }
}
Code:
AC.Send(Packets.SendAuthentication(GameIP, IV));
Code:
AC.Send(Packets.SendAuthentication(LocalHost, IV));
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); }
}
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); }
}
Code:
NewestCOServer.Main.AuthWorker.StartServer(I.ReadString("Database", "GameServerIP"));
Code:
NewestCOServer.Main.AuthWorker.StartServer2(I.ReadString("Database", "GameServerIP2"));
Code:
NewestCOServer.Main.GameWorker.StartServer2();
"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