ZBProxy icon indicating copy to clipboard operation
ZBProxy copied to clipboard

功能请求:重载配置文件时将正在使用不存在的路由的玩家踢出

Open Ikaleio opened this issue 1 year ago • 3 comments

例如原有 hypixel-in,但新配置文件无此路由,则将使用 hypixel-in 的用户全部踢出。

Ikaleio avatar Sep 27 '24 12:09 Ikaleio

@d0j1a1701 我看了一下 ZBProxy的热重载是基于服务的重载 不会新增端口/删除端口 如果需要全部踢出 建议直接重启程序

OOPSgary avatar Sep 28 '24 01:09 OOPSgary

我指单独掐掉某个路由的连接(一开始的表述不太清楚,把「路由」打成了「服务」)

例如示例配置文件:

{
  "Log": {
    "Level": "info"
  },
  "Services": [
    {
      "Name": "in",
      "Listen": 25565
    }
  ],
  "Router": {
    "DefaultOutbound": "RESET",
    "Rules": [
      {
        "Type": "always",
        "Sniff": "minecraft"
      },
      {
        "Type": "MinecraftHostname",
        "Parameter": {
            "Domain": "a.example.com"
        },
        "Outbound": "a-out"
      },
      {
        "Type": "MinecraftHostname",
        "Parameter": {
            "Domain": "b.example.com"
        },
        "Outbound": "b-out"
      }
    ]
  },
  "Outbounds": [
    {
      "Name": "a-out",
      "TargetAddress": "mc.hypixel.net",
      "TargetPort": 25565,
      "Minecraft": {
        "EnableHostnameRewrite": true,
        "OnlineCount": {
          "Max": 20,
          "Online": -1,
          "EnableMaxLimit": false
        },
        "MotdDescription": "a's MOTD"
      }
    },
    {
      "Name": "b-out",
      "TargetAddress": "minemen.club",
      "TargetPort": 25565,
      "Minecraft": {
        "EnableHostnameRewrite": true,
        "OnlineCount": {
          "Max": 20,
          "Online": -1,
          "EnableMaxLimit": false
        },
        "MotdDescription": "b's MOTD"
      }
    }
  ],
  "Lists": {}
}

现在玩家 A 在用 a.example.com 玩,玩家 B 在用 b.example.com 玩

然后重载新配置文件:

{
  "Log": {
    "Level": "info"
  },
  "Services": [
    {
      "Name": "in",
      "Listen": 25565
    }
  ],
  "Router": {
    "DefaultOutbound": "RESET",
    "Rules": [
      {
        "Type": "always",
        "Sniff": "minecraft"
      },
      {
        "Type": "MinecraftHostname",
        "Parameter": {
            "Domain": "b.example.com"
        },
        "Outbound": "b-out"
      }
    ]
  },
  "Outbounds": [
    {
      "Name": "b-out",
      "TargetAddress": "minemen.club",
      "TargetPort": 25565,
      "Minecraft": {
        "EnableHostnameRewrite": true,
        "OnlineCount": {
          "Max": 20,
          "Online": -1,
          "EnableMaxLimit": false
        },
        "MotdDescription": "b's MOTD"
      }
    }
  ],
  "Lists": {}
}

可以发现玩家 A 游玩的服务器的路由没了,就把他断开连接。

Ikaleio avatar Sep 28 '24 01:09 Ikaleio

@d0j1a1701 进一下tg群

OOPSgary avatar Sep 28 '24 01:09 OOPSgary