Quote:
Originally Posted by yuko
mmm oki here we go again.
gameserver
mastersocket.cs
server_ip = 192.168.0.187
site Ip = whatever
databaseconnection.cs
server = 127.0.0.1
loginserver
server_ip = 192.168.0.187
site Ip = whatever
databaseconnection.cs
server = 127.0.0.1
this is in order to host the server on the computer with the IP = 192.168.0.187
now lets say pc2 and pc3 wanna connect to pc1(192.168.0.187)
they need to connect on CoEmu (server.dat with the ip = 192.168.0.187)
now to connect pc1 to the server he needs to connect trough 127.0.0.1 wich is named LocCoEmu
and you don't have to enable any firewall on the router caus local connections are open. you only might need to disable windows firewall
else it should work perfectly
i use this system all the time
|
Hi Yuko... thanks again for the spare time helping out this sort of thing
Anyways, i have done all what you said and still i can't connect from PC2 and Pc3 to the server...
below will be my code for what i have..
GameServer
Master Sockett
protected Socket ServerSocket;
protected const int LOGIN_PORT = 9958;
protected const string SERVER_IP = "192.168.0.187";
protected const string SITE_IP = "74.54.200.178";
protected const int AUTH_PORT = 5817;
protected const int GAME_PORT = 5816;
protected string ServerName;
protected static bool Continue = true;
Database Connection
public const string USER_NAME = "root";
public const string PASSWORD = "creative";
public const string SERVER = "127.0.0.1";
public const string DATA_BASE = "conqueremu";
public static MySqlConnection DBConnection = null;
public static MySqlConnection NewConnection()
Login Server
Auth Socket
/// <summary>
/// Description of AuthSocket.
/// </summary>
public static class AuthSocket
{
private static Socket Auth;
private const string SERVER_IP = "127.0.0.1";
public const string NANO_IP = "127.0.0.1";
private const int AUTH_PORT = 5817;
public static bool Authorize(string user, uint key, bool nano)
{
Master Socket
protected Socket LoginSocket;
protected const int LOGIN_PORT = 9958;
protected const string SERVER_IP = "127.0.0.1";
protected const string SITE_IP = "74.54.200.178";
protected const int AUTH_PORT = 5817;
protected const int GAME_PORT = 5816;
protected string ServerName;
protected static bool Continue = true;
Database Connection
public const string USER_NAME = "root";
public const string PASSWORD = "creative";
public const string SERVER = "127.0.0.1";
public const string DATA_BASE = "conqueremu";
public static MySqlConnection NewConnection()
{
Packet Processor
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("66.187.101.86", Key1, Key2));
}
else
{
CSocket.Disconnect();
}*/
if (AuthSocket.Authorize(AccountName, Key, false))//enable everyone else to connect
{
CSocket.Send(Packets.AuthResponse("192.168.0.187", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
else if (ServerName == "LocCoEmu")//enable PC1 to Connect
{
if(AuthSocket.Authorize(AccountName, Key, true))
{
CSocket.Send(Packets.AuthResponse("127.0.0.1", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
}
else if(DBPass == "")
{
Sorry again to ask.. am i missing somethin here?
A million THANKS