Velocity icon indicating copy to clipboard operation
Velocity copied to clipboard

Issues with the /server command

Open yuankun1 opened this issue 2 months ago • 5 comments

Expected Behavior

None

Actual Behavior

When I use a Chinese name and enter the /server command on the server for cross-server use, it prompts: Expected whitespace to end one argument, but found trailing data at position 7: server <--[HERE]

[servers] "登录大厅" = "127.0.0.1:52020" "原版生存" = "127.0.0.1:52011" "空岛生存" = "127.0.0.1:52022" "荣耀纪元" = "127.0.0.1:52033"

try = [ "登录大厅" ]

[forced-hosts] "lobby.sakura18.cn" = [ "登录大厅" ] "factions.sakura18.cn" = [ "原版生存" ] "skyisland.sakura18.cn" = [ "空岛生存" ] "mmorpg.sakura18.cn" = [ "荣耀纪元" ]

Steps to Reproduce

None

Plugin List

None

Velocity Version

velocity-3.4.0-SNAPSHOT-535

Additional Information

None

yuankun1 avatar Oct 04 '25 12:10 yuankun1

That's a vanilla (brigadier) problem You are only allowed to use a-z A-Z 0-9 and some other symbols

NonSwag avatar Oct 04 '25 13:10 NonSwag

This is a duplicate of https://github.com/PaperMC/Velocity/issues/1362 and https://github.com/PaperMC/Velocity/issues/1220.

Velocity could address this by making their server command use StringArgumentType#string() rather than StringArgumentType#word(), which is implemented in this PR: https://github.com/PaperMC/Velocity/pull/1363.

With the string type, non "standard" characters would have to be enclosed in quote ". As an alternative, Velocity could use StringArgumentType#greedy since the server argument is at the end of the command.

willkroboth avatar Oct 04 '25 13:10 willkroboth

Note that you can for example not use greedy for the /send command and that would introduce inconsistency.

Timongcraft avatar Oct 04 '25 14:10 Timongcraft

Note that you can for example not use greedy for the /send command and that would introduce inconsistency.

Really? It looks like the server argument of the send command is the last one?

https://github.com/PaperMC/Velocity/blob/c8c27af7c3da99987e4f5be18ffe5830eaf98538/proxy/src/main/java/com/velocitypowered/proxy/command/builtin/SendCommand.java#L98-L100

Image

willkroboth avatar Oct 04 '25 14:10 willkroboth

Oh yea you're right. (I think I remembered the bungee version)

Timongcraft avatar Oct 04 '25 15:10 Timongcraft