Host Ban
Hi, its possible to ban someone in his host not only ip ? coz its sux if u ban someone for hack he come back with new ip and just laughting coz has dynamic ip. Maybe is other way to ban dynamic ips, anyone know?
<a href=http://profile.xfire.com/sok0l><img src=http://miniprofile.xfire.com/bg/co/type/0/sok0l.png width=440 height=111></a>
ban his range, like 123.123.*.*, where * stands for 'all'.
<img src='http://i9.tinypic.com/2vs292h.jpg' border='0' alt='user posted image' />
well looking at the banned list struct
how its copyed from the file thats a list
and how its compared to the client ip to see if their banned
that last part only checks if the ip's are of equivilant length
you might be interested in something sortof like this
just incase the lengths arnt equal, and the last char of the ip address string is a * it will compare everything before it then go from there
(not tested but it does compile, assuming im not a noob and wrote it right it should work)
Code: Select all
struct {
char m_cBannedIPaddress[21]; // Ŭ¶óÀ̾ðÆ®ÀÇ IP address
} m_stBannedList[DEF_MAXBANNED];
Code: Select all
ZeroMemory(m_stBannedList[iIndex].m_cBannedIPaddress, sizeof(m_stBannedList[iIndex].m_cBannedIPaddress));
memcpy(m_stBannedList[iIndex].m_cBannedIPaddress, token, strlen(token));
Code: Select all
for (i = 0; i < DEF_MAXBANNED; i++) {
if(strlen(m_stBannedList[i].m_cBannedIPaddress) == 0) break; //No more GM's on list
if ((strlen(m_stBannedList[i].m_cBannedIPaddress)) == (strlen(m_pClientList[iClientH]->m_cIPaddress))) {
if(memcmp(m_stBannedList[i].m_cBannedIPaddress, m_pClientList[iClientH]->m_cIPaddress, strlen(m_pClientList[iClientH]->m_cIPaddress)) == 0){
wsprintf(G_cTxt,"Client Rejected: Banned: (%s)", m_pClientList[iClientH]->m_cIPaddress);
PutLogList(G_cTxt);
return FALSE;
}
else {
}
}
}
you might be interested in something sortof like this
Code: Select all
else if(m_stBannedList[i].m_cBannedIPaddress[(strlen(m_stBannedList[i].m_cBannedIPaddress))-1] == '*'){
if(memcmp(m_stBannedList[i].m_cBannedIPaddress, m_pClientList[iClientH]->m_cIPaddress, strlen(m_stBannedList[i].m_cBannedIPaddress)-1) == 0){
wsprintf(G_cTxt,"Client Rejected: Banned: (%s)", m_pClientList[iClientH]->m_cIPaddress);
PutLogList(G_cTxt);
return FALSE;
}
}
}
(not tested but it does compile, assuming im not a noob and wrote it right it should work)
-><-