KcpTransport ServerUri returns empty host when machine name contains non-ASCII/invalid characters
### Summary
`KcpTransport.ServerUri()` builds a `UriBuilder` host from `Dns.GetHostName()`. If the computer name contains non-ASCII/invalid URI characters (e.g., Chinese), `UriBuilder.Host` ends up empty and the method returns `kcp://:7777` (or throws), so the transport cannot provide a usable server URI.
### Steps to Reproduce
1. Set the OS computer name to include a Chinese character (e.g., `测试PC`).
2. Start a project using Mirror KCP.
3. Call `Transport.activeTransport.ServerUri()`.
### Expected
`ServerUri()` returns a valid URI with a usable host (e.g., punycode or a fallback like `localhost`).
### Actual
Host is empty/invalid; URI becomes `kcp://:port` (or `UriFormatException`).
### Notes
File: `Mirror/Transports/KCP/KcpTransport.cs` line ~191. Likely need to validate/IDN-encode the hostname and/or provide a fallback when invalid.
关闭于 2026-01-11 0 条评论