Minecraft

Simple Voice Chat

将 Simple Voice Chat 模组和插件与 Lolia FRP 搭配使用

简要介绍Simple Voice Chat(下文简称 SVC )的工作原理。

SVC 使用独立的插件和模组进行语音转发,同时,SVC 的语音通道连接地址指示使用模组的信息传递通道,而 SVC 提供了配置外部链接地址的配置,本文即为修改此配置的教程。

此处的教程以 SVC 的 Fabric 和 Paper 和 Velocity 版本介绍,分别对应

  • 局域网联机
  • 客户端与服务器联机
  • 群组服务器

本文分别介绍客户端和服务端,以及客户端在局域网联机时作为主机端的情况。

创建隧道

在 Lolia 网页控制台上创建一个 UDP 隧道。

字段填写
隧道类型UDP
本地 IP127.0.0.1
本地端口24454
远程端口留空自动生成

创建完成后获得形如 cn-frp-1.qwq.fan:14514 的连接地址。

局域网联机

NeoForge/Forge/Fabric/Quilt Client-side

客户端 Mod (适用于局域网联机)的配置文件的位置形如 \.minecraft\versions\{game version}\config\voicechat\voicechat-server.properties。

直接在配置文件找到 voice_host= 这一行,然后设置连接地址,设置完成后此行应当形如 voice_host=cn-frp-1.qwq.fan:14514。

保存并重启 Minecraft 游戏,即可在局域网联机时使用语音联机。

服务端

NeoForge/Forge/Fabric/Quilt Server-side

服务端 Mod 的配置文件的位置形如 \config\voicechat\voicechat-server.properties。

直接在配置文件找到 voice_host= 这一行,然后设置连接地址,设置完成后此行应当形如 voice_host=cn-frp-1.qwq.fan:14514。

保存并重启 Minecraft 游戏,即可在局域网联机时使用语音联机。

Bukkit/Spigot/Paper

配置文件的位置形如 \plugins\voicechat\voicechat-server.properties

直接在配置文件找到 voice_host= 这一行,然后设置连接地址,设置完成后此行应当形如 voice_host=cn-frp-1.qwq.fan:14514。

反向代理端

如果您不部署 BungeeCord/Waterfall/Velocity 等反向代理端,忽略这一部分。

BungeeCord/Waterfall/Velocity

此处只讲述由 Simple Voice Chat Proxy 端代理所有语音流量的方式,如果您并不喜欢在反代端安装插件,参阅 Other Minecraft Proxies。

含反代的配置会略微复杂些,如果代理和所有Minecraft服务器都运行在同一台机器上,你必须为每个Minecraft服务器上的语音聊天实例分配不同的端口,即修改 voicechat-server.properties的port使他们各不相同,由于 SVC 代理插件只需要反向代理端可以连接到后端服务器即可以转发流量,故您仍然只需要一个隧道即可。

配置文件的位置形如 \plugins\voicechat\voicechat-proxy.properties。

修改如下的部分,将voice_host改为连接地址。

# The hostname that clients should use to connect to the voice chat
# This may also include a port, e.g. 'example.com:24454' or just a port, e.g. '24454'
# Do NOT change this value if you don't know what you're doing
voice_host=cn-frp-1.qwq.fan:14514

然后必须在后端服务器上的配置文件将port改为不为24454的端口,如24455等,否则会端口冲突。

同时,后端服务器的voice_host必须为空。

配置文件

voicechat-server.properties 配置文件示例如下:(经过部分删减,被删减的部分在本次教程不需要修改)


# The port number to use for the voice chat communication.
# Audio packets are always transmitted via the UDP protocol on the port number
# specified here, independently of other networking used for the game server.
# Set this to '-1' to use the same port number that is used by the Minecraft server.
# However, it is strongly recommended NOT to use the same port number because UDP on
# it is also used by default for the server query. Doing so may crash the server!
# This option only works on dedicated servers.
port=24454

# The hostname that clients should use to connect to the voice chat
# This may also include a port, e.g. 'example.com:24454' or just a port, e.g. '24454'
# Do NOT change this value if you don't know what you're doing
# This option only works on dedicated servers
voice_host=cn-frp-1.qwq.fan:14514