Making the current Ban a real Ban
PostPosted: Fri May 23, 2008 2:04 pm
Curently the maximum a servers staff can do to remove a player from the server is to ban the account and ip address.
The Result is that the user can just get himself a new ip address and log on the server again with a new account.
I´d like to create a way to realy prevent a baned user to access the server.
My idea was to do that via the users mac address, ok, still possible to change that one but it requires more knowledge and work for the player.
I read alot about that during the last days, also found some code snippets, but only very few.
Here is my current code that doesnt work yet, its in LoginRequestHandler -> HandlePacket()
00-00-00-00-00-00
Thats why my results are currently like this:
15:52:53,578 - [2320] - INFO - DOL.GS.PacketHandler.Client.v168.LoginRequestHandler - Mac Adresse: 00-00-00-00-00-00 | IP Adresse: -1494206642 | Macinfo: 0
Its not the negative IP Adress there, i also tried with another computer that than had a positive value there but still no mac adress:
21:51:01,609 - [4660] - INFO - DOL.GS.PacketHandler.Client.v168.LoginRequestHandler - Mac Adresse: 00-00-00-00-00-00 | IP Adresse: 16777343 | Macinfo: 0
Maybe someone could give me a hand with this code.
I am also interested if there might be other ways to make bans more effective.
The Result is that the user can just get himself a new ip address and log on the server again with a new account.
I´d like to create a way to realy prevent a baned user to access the server.
My idea was to do that via the users mac address, ok, still possible to change that one but it requires more knowledge and work for the player.
I read alot about that during the last days, also found some code snippets, but only very few.
Here is my current code that doesnt work yet, its in LoginRequestHandler -> HandlePacket()
- Code: Select all
String[] ipsplit = ipAddress.Split(':');
int ldest = CryptLib168.inet_addr(ipsplit[0]);
long macinfo = 0; //Dient zur Speicherung der Mac-Adresse
int len = 6; //Länge
int res = CryptLib168.SendARP(ldest, 0, ref macinfo, ref len); //Mac-Adresse holen
string macAddress = formatMac(macinfo, '-');
log.Info("Mac Adresse: " + macAddress + " | IP Adresse: " +ldest.ToString() + " | Macinfo: " + macinfo.ToString());
- Code: Select all
[DllImport("Ws2_32.dll")]
public static extern int inet_addr(string ip);
[DllImport("iphlpapi.dll")]
public static extern int SendARP(int dest, int host, ref long mac, ref int len);
00-00-00-00-00-00
Thats why my results are currently like this:
15:52:53,578 - [2320] - INFO - DOL.GS.PacketHandler.Client.v168.LoginRequestHandler - Mac Adresse: 00-00-00-00-00-00 | IP Adresse: -1494206642 | Macinfo: 0
Its not the negative IP Adress there, i also tried with another computer that than had a positive value there but still no mac adress:
21:51:01,609 - [4660] - INFO - DOL.GS.PacketHandler.Client.v168.LoginRequestHandler - Mac Adresse: 00-00-00-00-00-00 | IP Adresse: 16777343 | Macinfo: 0
Maybe someone could give me a hand with this code.
I am also interested if there might be other ways to make bans more effective.