Snake
Участник
- Сообщения
- 124
- Реакции
- 30
Выложи как отдельный ресурс плиз. И в SB он не записывает но вроде банит....Нет.
Я не запрашиваю клиентский SteamID. Я делаю %L, который и ник подставляет, и SteamID.
Выложи как отдельный ресурс плиз. И в SB он не записывает но вроде банит....Нет.
Я не запрашиваю клиентский SteamID. Я делаю %L, который и ник подставляет, и SteamID.
Запись пойдет, если сразу послеИ в SB он не записывает но вроде банит....
ServerCommand("sm_ban #%d 0 \"DDoS cheat\"", GetClientUserId(client));
ServerCommand("sm_kick #%d \"Попытка DDOS\"", GetClientUserId(client));
public Action OnPlayerRunCmd(int client) {
// If player is a fake client, there will be an error in GetClientAvgPackets.
if (IsFakeClient(client)) return;
// Get client average packet frequency in packets/sec. Check it.
Ban(client, GetClientAvgPackets(client, NetFlow_Both));
}
void Ban(int client, float freq) {
if (freq < 1800.0) return;
PrintToChatAll("[Anti-DDoS] Игрок %N забанен за DDoS читами", client);
LogToFileEx("addons/ddos_protect.log", "%L exceeded Packet frequency (%.2f)", client, freq);
ServerCommand("sm_ban #%d 0 \"DDoS cheat\"", GetClientUserId(client));
ServerCommand("sm_kick #%d \"Попытка DDOS\"", GetClientUserId(client));
}
Его должно кикнуть, если забанитЗапись пойдет, если сразу после
ДобавитьC-подобный:ServerCommand("sm_ban #%d 0 \"DDoS cheat\"", GetClientUserId(client));
C-подобный:ServerCommand("sm_kick #%d \"Попытка DDOS\"", GetClientUserId(client));
Не этично, но как то так:
PHP:public Action OnPlayerRunCmd(int client) { // If player is a fake client, there will be an error in GetClientAvgPackets. if (IsFakeClient(client)) return; // Get client average packet frequency in packets/sec. Check it. Ban(client, GetClientAvgPackets(client, NetFlow_Both)); } void Ban(int client, float freq) { if (freq < 1800.0) return; PrintToChatAll("[Anti-DDoS] Игрок %N забанен за DDoS читами", client); LogToFileEx("addons/ddos_protect.log", "%L exceeded Packet frequency (%.2f)", client, freq); ServerCommand("sm_ban #%d 0 \"DDoS cheat\"", GetClientUserId(client)); ServerCommand("sm_kick #%d \"Попытка DDOS\"", GetClientUserId(client)); }
Ключевое слово "должно".Его должно кикнуть, если его забанит
Почему бы и нет, главное что работает :ab:Нахрен таким динозавром пользоваться?
Тогда уж и PrintToChatAll можно было убратьНет.
Я не запрашиваю клиентский SteamID. Я делаю %L, который и ник подставляет, и SteamID.
@BreakSharp, и дырок тьма, начиная с возможностью саморазбаниться посредством веба и без участия админа, ага.
Пытался установить новый SB, хостинг не позволил.Нахрен таким динозавром пользоваться?
int maxpackets;
bool ban[MAXPLAYERS + 1];
public void OnClientPutInServer(int client)
{
ban[client] = false;
}
public void OnConfigsExecuted()
{
// sv_maxcmdrate - Max number of packets sent to server per second.
// sv_maxupdaterate - Number of packets per second of updates you are requesting from the server.
// (Outgoing + incoming traffic) + inaccuracy 100 packets.
maxpackets = FindConVar("sv_maxcmdrate").IntValue + FindConVar("sv_maxupdaterate").IntValue + 100;
}
public Action OnPlayerRunCmd(int client)
{
// If player is a fake client, there wills be an error in GetClientAvgPackets
if (!IsFakeClient(client) && !ban[client])
{
// Get client average packet frequency in packets/sec. Check it
Ban(client, GetClientAvgPackets(client, NetFlow_Both));
}
}
void Ban(int client, float frequency)
{
if (frequency > maxpackets)
{
ban[client] = true;
LogToFileEx("addons/ddos_protect.log", "%L Packet frequency exceeding (%.2f)", client, frequency);
ServerCommand("sm_ban #%d 0 DDoS cheat", GetClientUserId(client));
KickClient(client, "You were banned for ddos by cheat");
}
}
PHP:int maxpackets; public void OnConfigsExecuted() { // sv_maxcmdrate - Max number of packets sent to server per second. // sv_maxupdaterate - Number of packets per second of updates you are requesting from the server. // (Outgoing + incoming traffic) + inaccuracy 100 packets. maxpackets = FindConVar("sv_maxcmdrate").IntValue + FindConVar("sv_maxupdaterate").IntValue + 100; } public Action OnPlayerRunCmd(int client) { // If player is a fake client, there wills be an error in GetClientAvgPackets if (!IsFakeClient(client)) { // Get client average packet frequency in packets/sec. Check it Ban(client, GetClientAvgPackets(client, NetFlow_Both)); } } void Ban(int client, float frequency) { if (frequency > maxpackets) { LogToFileEx("addons/ddos_protect.log", "%L Packet frequency exceeding (%.2f)", client, frequency); ServerCommand("sm_ban #%d 0 DDoS cheat", GetClientUserId(client)); KickClient(client, "You were banned for ddos by cheat"); } }
ServerCommand("sm_kick #%d \"Попытка DDOS\"", GetClientUserId(client));
L 02/11/2018 - 10:26:53: YOUR.DEATH<290><STEAM_1:1:202457717><> Packet frequency exceeding (251.61)
L 02/11/2018 - 10:48:46: Иоанн Спаситель<297><STEAM_1:0:144747813><> Packet frequency exceeding (229.68)
L 02/11/2018 - 11:12:39: Chip<348><STEAM_1:1:186950496><> Packet frequency exceeding (361.12)
L 02/11/2018 - 11:24:38: bratishkinoff#АНТИХАЙП#<400><STEAM_1:0:196176543><> Packet frequency exceeding (229.82)
@Exle,
это норма?)C-подобный:L 02/11/2018 - 10:26:53: YOUR.DEATH<290><STEAM_1:1:202457717><> Packet frequency exceeding (251.61) L 02/11/2018 - 10:48:46: Иоанн Спаситель<297><STEAM_1:0:144747813><> Packet frequency exceeding (229.68) L 02/11/2018 - 11:12:39: Chip<348><STEAM_1:1:186950496><> Packet frequency exceeding (361.12) L 02/11/2018 - 11:24:38: bratishkinoff#АНТИХАЙП#<400><STEAM_1:0:196176543><> Packet frequency exceeding (229.82)
L 02/08/2018 - 13:14:05: IzI_WaLHaK<53><STEAM_1:0:526760218><> exceeded Packet frequency (2066.36)
L 02/08/2018 - 13:14:05: IzI_WaLHaK<53><STEAM_1:0:526760218><> exceeded Packet frequency (2066.36)
L 02/08/2018 - 13:14:05: IzI_WaLHaK<53><STEAM_1:0:526760218><> exceeded Packet frequency (2066.36)
@Exle,PHP:public Action OnPlayerRunCmd(int client) { // If player is a fake client, there will be an error in GetClientAvgPackets. if (IsFakeClient(client)) return; // Get client average packet frequency in packets/sec. Check it. Ban(client, GetClientAvgPackets(client, NetFlow_Both)); } void Ban(int client, float freq) { if (freq < 1800.0) return; PrintToChatAll("[Anti-DDoS] Игрок %N забанен за DDoS читами", client); LogToFileEx("addons/ddos_protect.log", "%L exceeded Packet frequency (%.2f)", client, freq); ServerCommand("sm_ban #%d 0 DDoS cheat", GetClientUserId(client)); }