简体中文(GitHub) 简体中文(Gitea) English(GitHub) English(Gitea)
简介
此模组旨在修复于 2021 年 11 月 26 日报告且至今未解决的错误。 错误追踪器链接
功能
如果你在“添加服务器”或“直接连接”屏幕上输入的服务器地址开头、结尾或中间包含空格,此模组会自动将其移除。 这可以防止上述提到的“未知主机”错误。
为什么会有这个模组
几个月前,我想加入一个服务器。我从服务器的官方网站复制了地址,粘贴到“服务器地址”栏中,保存后却意外收到了“未知主机”的错误提示。
别慌,这显然是 DNS 无法解析对应的地址。先试试 ping 一下。
Ping 能够将域名解析为地址,于是我开始怀疑是不是防火墙又在搞鬼,于是我使用站长之家(ZhanZhangJia)的工具进行了测试。结果和我的情况完全一致。
这就有点奇怪了。
然后,经过一番折腾,我找到了问题所在。
我复制的服务器地址末尾有一个空格。
这实在让人难以接受。在继续捣鼓了一阵并确认该问题可以稳定复现后,我向官方反馈渠道提交了一份错误报告。
你猜怎么着?
我的英语非常糟糕,所以我没有继续讨论。问题描述是使用翻译工具编写的。
但说实话,我觉得这有点荒谬。
既然你的地址是一个字符串,事后调用 trim 方法会有多难?
此外,作为一名玩家,当你告诉我“这是你自己的疏忽,甚至不算是一个 bug”时,我无法接受这种说法。
因此,这个模组诞生了。
配置文件
- 如果您启用了版本隔离,该文件应位于
.minecraft\versions\<版本号>\config\ServerAddressSpaceFix.json5 - 如果您未启用版本隔离,该文件应位于
.minecraft\config\ServerAddressSpaceFix.json5
这是一个普通的 JSON 文本文件,不过 JSON5 支持一些额外功能,比如注释。 所有属性都包含注释,涵盖了功能、值范围、类型、默认值等内容。 你可以使用普通文本编辑器来编辑它。 你甚至可以在游戏运行时编辑配置文件;保存后会自动应用更改。
已知问题
所有已知问题均已修复。如果你发现任何新问题,请告诉我。 如果有人愿意帮忙修复漏洞,欢迎提交 PR ╰(°▽°)╯
许可证
我使用的许可证比 MIT 更加激进——WTFPL。
简体中文(GitHub) 简体中文(Gitea) English(GitHub) English(Gitea)
Introduction
This mod is intended to fix a bug that was reported on November 26, 2021 and still has not been fixed. Bug tracker link
Features
If the server address you enter on the "Add Server" or "Direct Connect" screen contains spaces at the beginning, the end, or in the middle, this mod will automatically remove them. This prevents the "Unknown Host" bug mentioned above.
Why this mod exists
A few months ago, I wanted to play on a server. I copied the address from the server's official website, pasted it into the "Server Address" field, saved it, and unexpectedly got an "Unknown Host" error.
No panic, this was obviously DNS failing to resolve the corresponding address. Let's try pinging it first.
Ping could resolve the domain name to an address, and then I suspected the Great Firewall might be doing something again, so I used a tool from ZhanZhangJia to test it. The results were exactly the same as mine.
That was rather strange.
Then, after fiddling with it for a while, I found the problem.
There was a space at the end of the server address I copied.
That was pretty hard to accept. After continuing to tinker for a while and confirming that the problem could be reproduced reliably, I submitted a bug report to the tracker.
And guess what?
My English is completely terrible, so I did not continue talking about it. The issue description was written using a translator.
But honestly, I felt this was kind of absurd.
Since your address is a String, how hard could it be to call trim on it afterwards?
Also, as a player, when you tell me, "This was your own carelessness, so it does not even count as a bug," I cannot accept that.
So, this mod was born.
Configuration file
- If you have version isolation enabled, it should be located at
.minecraft\versions\<version name>\config\ServerAddressSpaceFix.json5 - If you do not have version isolation enabled, it should be located at
.minecraft\config\ServerAddressSpaceFix.json5
This is just a regular JSON text file, except that JSON5 supports additional features such as comments. All properties include comments, covering things such as functionality, value ranges, types, default values, and more. You can edit it with a normal text editor. You can even edit the configuration file while the game is running; it will be applied automatically after saving.
Known issues
All known issues have been fixed. If you find any new ones, please let me know. If anyone is willing to help fix a bug, PRs are welcome ╰(°▽°)╯
License
I use the even more aggressive WTFPL than MIT.
下载 ServerAddressSpaceFix
下载 ServerAddressSpaceFix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerAddressSpaceFix
下载 ServerAddressSpaceFix
下载 ServerAddressSpaceFix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerAddressSpaceFix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerAddressSpaceFix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerAddressSpaceFix
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ServerAddressSpaceFix
下载 ServerAddressSpaceFix
修复 Windows 文件系统对大小写不敏感导致配置文件迁移会实际上导致原始配置文件被删除的问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧