端口转发对游戏无效

端口转发对游戏无效

我在玩旧版《使命召唤:战争世界》游戏时遇到了问题。我真的需要专家帮助解决这个很少有人知道如何解决的问题。

我的问题与端口转发有关。它在过去这款游戏中运行得很好,我可以毫无问题地托管合作。目前,端口转发条目(使用默认28960端口)在路由器上是完美的,但似乎从 1-2 年前开始,服务器分配就无法与 Windows 10 或其他东西很好地集成(我真的不知道原因)。我绝对可以完美地转发其他不相关的服务,并且可以从互联网访问它们。

netstat -aon当合作服务器处于活动状态时,输出如下:

C:\WINDOWS\system32>netstat -aon|find "28960"
  UDP    192.168.1.9:28960      *:*                                    5344

state字段缺少LISTENING值,这意味着绑定由于某种原因失败。此外,我使用命令选项启动游戏以+set net_ip 192.168.1.9选择我的 LAN 网络,因为事实证明这对于其他服务是必要的,因为我有多个网络接口,默认情况下它们似乎优先于 LAN 网络。

将输出与可以访问 Internet 的正常运行的无关服务进行比较:

C:\WINDOWS\system32>netstat -aon|find "27017"
  TCP    192.168.1.9:27017      0.0.0.0:0              LISTENING       14740
  UDP    192.168.1.9:27017      *:*                                    14740

顺便说一句,这款游戏不会使用 UPnP 自动打开服务器,必须进行端口转发。此外,禁用 Windows 防火墙也无济于事。

你能帮助我吗?这个问题随机出现已经很久了,我完全不知所措了。

编辑:我刚刚发现这里由于协议是无状态的,因此看不到 UDP 端口上的状态是正常的。虽然我知道这个概念,但我没有意识到这是原因。所以至少这是件好事。然而,游戏可能仍应该在同一端口上分配一个 TCP 套接字。

答案1

更新:没关系,我认为一切都是基于错误的假设。我的一个朋友告诉我,出于某种原因,他无法在游戏服务器浏览器中看到我的服务器,所以我立即将其与网络接口冲突问题联系起来(这在另一个游戏服务器中是真实的,默认情况下会选择一个错误的接口)。但实际上,正如@JW0914(感谢)所建议的那样,CoD:WaW 已经绑定了所需的端口以通过 监听所有接口。我已经通过在服务器预大厅等待足够的时间并继续服务少数玩家加入来0.0.0.0检查服务器是否正常工作而无需覆盖游戏。net_ip

我之前的(错误的答案):

好吧,我以某种方式解决了这个问题。我将通过推测来揭示真正的原因。

基本上,游戏使用端口 28960 UDP 作为服务器本身(默认情况下;非 UPnP),然后使用 3074 UDP 和 UPnP,显然用于通知主服务器(来自 Activision)。

然而,即使游戏提供了net_ip控制台变量来手动设置 IP,并据称可以在存在多个活动网络接口的情况下应对游戏选择的错误接口(就像我的情况一样),我只是发现了这个参数可能只会修改主服务器 IP 本身而不是主服务器(3074)的那个,如以下输出所示:

192.168.1.9:28960          *:*                                    13860

C:\WINDOWS\system32>netstat -aon|find "3074"   UDP    0.0.0.0:3074    
*:* ```

(The `0.0.0.0` IP being a the result of the game always using
`localhost` alias for such port, regardless of game's `net_ip` value).

I can also kind of confirm the theory by checking that on a different
game server, which shows the chosen interface on startup and by demand
(unlike CoD: WaW game when not overriding `net_ip`), other adapter
interfaces are chosen unless explicitly setting the IP at startup.

So, the way the problem fixed was by disabling my other interfaces. It
is also important to note that after this conclusion, the **game
server would have been properly exposed all the time** (that is,
relating to the UDP 28960 port), but **not the informative** port for
the master server (UDP 3074), **preventing my server to appear in the
in-game browser**. I should have mentioned the issue and
troubleshooting context was whilst in the game lobby (as the game
requires > 1 connected players to start the action itself).

By the way, [adjusting provider priorities][1] and/or interface
metrics at `ncpa.cpl` (Control Panel's Network Connections) doesn't
seem to have an effect on these games. If anyone knows a way to make
these priorities have effect on all applications, I'd appreciate.

相关内容