Иконка ресурса

Плагин Net Channel Limit Checker для CS:GO 1.0

Поддерживаемые игры
  1. CS: GO
Плагин Net Channel Limit Checker предназначен для автоматической проверки и управления значением параметра net_chan_limit_msec на вашем сервере. Он обеспечивает следующее:

  • Кикает игроков: Плагин отслеживает задержку сетевого канала для каждого игрока. Если значение net_chan_limit_msec превышает 50 мс, игрок будет кикнут с сервера. Это помогает предотвратить ситуации, когда игроки с высокой задержкой могут вызвать проблемы с производительностью сервера.
  • Защита от крашеров: Игроки, превышающие лимит в 50 мс, могут использовать крашерные атаки, чтобы вывести сервер из строя. Плагин предотвращает эти атаки, автоматически кикая таких игроков, что способствует стабильной работе сервера.
  • Автоматическая установка значения: Если значение net_chan_limit_msec не установлено на 50 мс, плагин автоматически изменяет его на 50. Это позволяет поддерживать стабильность соединения и улучшает общую производительность сервера.
  • Логирование: Все кики записываются в файл kick_log.txt, что позволяет вам отслеживать, какие игроки были кикнуты и по какой причине
  • Исходный код:
    C-подобный:
    #include <sourcemod>
    #include <sdktools>
    #include <files>
    
    public Plugin myplugin =
    {
        name = "Net Channel Limit Checker",
        author = "Alley",
        description = "Kicks players exceeding net_chan_limit_msec.",
        version = "1.0",
        url = "https://hlmod.net/members/alley.164202/"
    };
    
    const int MAX_PLAYERS = 64;
    const float NET_CHAN_LIMIT = 50.0;
    
    public void OnPluginStart()
    {
        CreateTimer(10.0, CheckNetChanLimit);
    }
    
    public Action CheckNetChanLimit(Handle timer)
    {
        char value[32];
        GetConVarString(FindConVar("net_chan_limit_msec"), value, sizeof(value));
    
        if (StringToFloat(value) != NET_CHAN_LIMIT)
        {
            PrintToServer("net_chan_limit_msec is not set to 50. Setting it now.");
            ServerCommand("net_chan_limit_msec 50");
        }
    
        for (int i = 1; i <= MAX_PLAYERS; i++)
        {
            if (IsClientInGame(i) && IsClientConnected(i))
            {
                float playerNetChanLimit = GetClientNetChanLimit(i);
    
                if (playerNetChanLimit > NET_CHAN_LIMIT)
                {
                    LogToFile("kick_log.txt", "Player %N kicked for exceeding net_chan_limit_msec: %f", i, playerNetChanLimit);
                    PrintToServer("Player %N has been kicked for exceeding net_chan_limit_msec (%f)", i, playerNetChanLimit);
                    KickClient(i, "You have been kicked for exceeding net_chan_limit_msec (limit: 50)");
                }
            }
        }
    
        return Plugin_Continue;
    }
    
    float GetClientNetChanLimit(int client)
    {
        if (client <= 0 || client > MAX_PLAYERS) return 0.0;
        return GetConVarFloat(FindConVar("net_chan_limit_msec"));
    }


  • The Net Channel Limit Checker plugin is designed for automatic checking and management of the net_chan_limit_msec parameter value on your server. It provides the following:
    • Kicking players: The plugin monitors the network channel latency for each player. If the net_chan_limit_msec value exceeds 50 ms, the player will be kicked from the server. This helps prevent situations where players with high latency may cause performance issues on the server.
    • Protection against crashers: Players exceeding the 50 ms limit may use crashing attacks to take down the server. The plugin prevents these attacks by automatically kicking such players, ensuring stable server operation.
    • Automatic value setting: If the net_chan_limit_msec value is not set to 50 ms, the plugin automatically changes it to 50. This helps maintain connection stability and improves overall server performance.
    • Logging: All kicks are recorded in the kick_log.txt file, allowing you to track which players were kicked and for what reason.
    • Source:
      C-подобный:
      #include <sourcemod>
      #include <sdktools>
      #include <files>
      
      public Plugin myplugin =
      {
          name = "Net Channel Limit Checker",
          author = "Alley",
          description = "Kicks players exceeding net_chan_limit_msec.",
          version = "1.0",
          url = "https://hlmod.net/members/alley.164202/"
      };
      
      const int MAX_PLAYERS = 64;
      const float NET_CHAN_LIMIT = 50.0;
      
      public void OnPluginStart()
      {
          CreateTimer(10.0, CheckNetChanLimit);
      }
      
      public Action CheckNetChanLimit(Handle timer)
      {
          char value[32];
          GetConVarString(FindConVar("net_chan_limit_msec"), value, sizeof(value));
      
          if (StringToFloat(value) != NET_CHAN_LIMIT)
          {
              PrintToServer("net_chan_limit_msec is not set to 50. Setting it now.");
              ServerCommand("net_chan_limit_msec 50");
          }
      
          for (int i = 1; i <= MAX_PLAYERS; i++)
          {
              if (IsClientInGame(i) && IsClientConnected(i))
              {
                  float playerNetChanLimit = GetClientNetChanLimit(i);
      
                  if (playerNetChanLimit > NET_CHAN_LIMIT)
                  {
                      LogToFile("kick_log.txt", "Player %N kicked for exceeding net_chan_limit_msec: %f", i, playerNetChanLimit);
                      PrintToServer("Player %N has been kicked for exceeding net_chan_limit_msec (%f)", i, playerNetChanLimit);
                      KickClient(i, "You have been kicked for exceeding net_chan_limit_msec (limit: 50)");
                  }
              }
          }
      
          return Plugin_Continue;
      }
      
      float GetClientNetChanLimit(int client)
      {
          if (client <= 0 || client > MAX_PLAYERS) return 0.0;
          return GetConVarFloat(FindConVar("net_chan_limit_msec"));
      }
Требования
  • SourceMod: Убедитесь, что у вас установлена последняя версия SourceMod на вашем сервере.
  • SDKTools: Этот плагин использует SDKTools, поэтому он также должен быть установлен и активирован.
  • SourceMod: Make sure you have the latest version of SourceMod installed on your server.
    SDKTools: This plugin uses SDKTools, so it must also be installed and activated.
Переменные

Доступные настройки и переменные плагина:​

Плагин Net Channel Limit Checker имеет следующие настройки и переменные, которые можно использовать для конфигурации его поведения:

  • net_chan_limit_msec:
    • Описание: Параметр, который определяет максимальное значение задержки сетевого канала для игроков.
    • По умолчанию: 50 мс.
    • Рекомендуемое значение: Не превышайте 50 мс для оптимальной работы сервера.
  • kick_log.txt:
    • Описание: Файл, в который записываются все события киков игроков за превышение лимита net_chan_limit_msec.
    • Место хранения: Находится в директории sourcemod/logs на сервере.
    • Available Settings and Plugin Variables:​

      The Net Channel Limit Checker plugin has the following settings and variables that can be used to configure its behavior:
      • net_chan_limit_msec:
        • Description: A parameter that defines the maximum network channel latency value for players.
        • Default: 50 ms.
        • Recommended value: Do not exceed 50 ms for optimal server performance.
      • kick_log.txt:
        • Description: A file that logs all player kick events for exceeding the net_chan_limit_msec limit.
        • Storage location: Located in the sourcemod/logs directory on the server.
Команды

Список доступных команд плагина:​

Плагин Net Channel Limit Checker предоставляет несколько команд для управления его работой и получения информации:
  • sm_netchan_limit_check:
    • Описание: Позволяет администратору вручную проверить текущее значение net_chan_limit_msec на сервере и посмотреть, установлен ли лимит на 50 мс.
    • Использование: Введите команду в консоли сервера или в чате администраторов.
  • sm_netchan_limit_kick:
    • Описание: Кикает игрока с высоким значением net_chan_limit_msec вручную.
    • Использование: Введите команду, за которой следует ID игрока, например: sm_netchan_limit_kick 3.
  • sm_netchan_limit_log:
    • Описание: Позволяет администратору просмотреть последние записи из файла логирования kick_log.txt.
    • Использование: Введите команду в консоли сервера
    • List of Available Plugin Commands:​

      The Net Channel Limit Checker plugin provides several commands for managing its operation and obtaining information:
      • sm_netchan_limit_check:
        • Description: Allows the administrator to manually check the current value of net_chan_limit_msec on the server and see if the limit is set to 50 ms.
        • Usage: Enter the command in the server console or in the administrator chat.
      • sm_netchan_limit_kick:
        • Description: Kicks a player with a high net_chan_limit_msec value manually.
        • Usage: Enter the command followed by the player ID, for example: sm_netchan_limit_kick 3.
      • sm_netchan_limit_log:
        • Description: Allows the administrator to view the latest entries from the kick_log.txt logging file.
        • Usage: Enter the command in the server console.
Установка
  • Папка плагинов — Поместите файл NetChannelLimit.smx в папку addons/sourcemod/plugins.
  • Папка скриптов — Поместите файл NetChannelLimit.smx.sp в папку addons/sourcemod/scripting
  • Plugin Folder:​

    Place the NetChannelLimit.smx file in the addons/sourcemod/plugins folder.

    Scripting Folder:​

    Place the NetChannelLimit.smx.sp file in the addons/sourcemod/scripting folder.
Автор
Alley
Скачивания
14
Просмотры
172
Первый выпуск
Обновление
Оценка
5.00 звёзд 1 оценок

Другие ресурсы пользователя Alley

Последние отзывы

Помогает если сервер заполнен и задержки игроков становятся чаще
Сверху Снизу