mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 14:56:05 -04:00
feat(multiplayer): show cato version.
This commit is contained in:
parent
e776532947
commit
56327eba54
@ -57,7 +57,7 @@ public class LocalServerBroadcaster implements Runnable {
|
|||||||
byte[] data = String.format("[MOTD]%s[/MOTD][AD]%d[/AD]", i18n("multiplayer.session.name.motd", session.getName()), port).getBytes(StandardCharsets.UTF_8);
|
byte[] data = String.format("[MOTD]%s[/MOTD][AD]%d[/AD]", i18n("multiplayer.session.name.motd", session.getName()), port).getBytes(StandardCharsets.UTF_8);
|
||||||
DatagramPacket packet = new DatagramPacket(data, 0, data.length, broadcastAddress, 4445);
|
DatagramPacket packet = new DatagramPacket(data, 0, data.length, broadcastAddress, 4445);
|
||||||
socket.send(packet);
|
socket.send(packet);
|
||||||
LOG.fine("Broadcast server 0.0.0.0:" + port);
|
LOG.finest("Broadcast server 0.0.0.0:" + port);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.log(Level.WARNING, "Failed to send motd packet", e);
|
LOG.log(Level.WARNING, "Failed to send motd packet", e);
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ public final class MultiplayerManager {
|
|||||||
CatoSession(String name, State type, Process process, List<String> commands) {
|
CatoSession(String name, State type, Process process, List<String> commands) {
|
||||||
super(process, commands);
|
super(process, commands);
|
||||||
|
|
||||||
Runtime.getRuntime().addShutdownHook(Lang.thread(this::stop));
|
Runtime.getRuntime().addShutdownHook(new Thread(this::stop));
|
||||||
|
|
||||||
LOG.info("Started cato with command: " + new CommandBuilder().addAll(commands).toString());
|
LOG.info("Started cato with command: " + new CommandBuilder().addAll(commands).toString());
|
||||||
|
|
||||||
|
@ -169,11 +169,14 @@ public class MultiplayerPageSkin extends SkinBase<MultiplayerPage> {
|
|||||||
|
|
||||||
VBox masterPane = new VBox(8);
|
VBox masterPane = new VBox(8);
|
||||||
{
|
{
|
||||||
|
HintPane masterHintPane = new HintPane();
|
||||||
|
masterHintPane.setText(i18n("multiplayer.state.master.hint"));
|
||||||
|
|
||||||
Label label = new Label(i18n("multiplayer.state.master"));
|
Label label = new Label(i18n("multiplayer.state.master"));
|
||||||
label.textProperty().bind(Bindings.createStringBinding(() ->
|
label.textProperty().bind(Bindings.createStringBinding(() ->
|
||||||
i18n("multiplayer.state.master", control.getSession() == null ? "" : control.getSession().getName(), control.getPort()),
|
i18n("multiplayer.state.master", control.getSession() == null ? "" : control.getSession().getName(), control.getPort()),
|
||||||
control.portProperty(), control.sessionProperty()));
|
control.portProperty(), control.sessionProperty()));
|
||||||
masterPane.getChildren().setAll(label);
|
masterPane.getChildren().setAll(masterHintPane, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
BorderPane slavePane = new BorderPane();
|
BorderPane slavePane = new BorderPane();
|
||||||
@ -243,9 +246,14 @@ public class MultiplayerPageSkin extends SkinBase<MultiplayerPage> {
|
|||||||
tokenField.setPromptText(i18n("multiplayer.session.create.token.prompt"));
|
tokenField.setPromptText(i18n("multiplayer.session.create.token.prompt"));
|
||||||
gridPane.addRow(0, new Label(i18n("multiplayer.session.create.token")), tokenField);
|
gridPane.addRow(0, new Label(i18n("multiplayer.session.create.token")), tokenField);
|
||||||
|
|
||||||
Label label = new Label(i18n("multiplayer.powered_by"));
|
BorderPane pane = new BorderPane();
|
||||||
|
Label versionLabel = new Label("cato " + MultiplayerManager.CATO_VERSION);
|
||||||
|
pane.setLeft(versionLabel);
|
||||||
|
|
||||||
thanksPane.getContent().addAll(gridPane, label);
|
Label label = new Label(i18n("multiplayer.powered_by"));
|
||||||
|
pane.setRight(label);
|
||||||
|
|
||||||
|
thanksPane.getContent().addAll(gridPane, pane);
|
||||||
}
|
}
|
||||||
|
|
||||||
content.getChildren().setAll(
|
content.getChildren().setAll(
|
||||||
|
@ -642,6 +642,7 @@ multiplayer.state.connecting=Connecting
|
|||||||
multiplayer.state.disconnected=Not created/entered a multiplayer session
|
multiplayer.state.disconnected=Not created/entered a multiplayer session
|
||||||
multiplayer.state.disconnected.hint=Someone should create a multiplayer session, and others join the session to play the game together.
|
multiplayer.state.disconnected.hint=Someone should create a multiplayer session, and others join the session to play the game together.
|
||||||
multiplayer.state.master=Created room: %1$s, port: %2$d
|
multiplayer.state.master=Created room: %1$s, port: %2$d
|
||||||
|
multiplayer.state.master.hint=After creating multiplayer room, click the "copy invitation code" button and send the invitation code to players you want to invite. These player can paste the invitation code when joining room.
|
||||||
multiplayer.state.slave=Joined room: %1$s, address: %2$s
|
multiplayer.state.slave=Joined room: %1$s, address: %2$s
|
||||||
multiplayer.state.slave.copy=Copy address
|
multiplayer.state.slave.copy=Copy address
|
||||||
multiplayer.state.slave.hint=After joining multiplayer room, you should get to multiplayer page in Minecraft and connect to the "HMCL Multiplayer Session" server, or manually add a server with address shown below.
|
multiplayer.state.slave.hint=After joining multiplayer room, you should get to multiplayer page in Minecraft and connect to the "HMCL Multiplayer Session" server, or manually add a server with address shown below.
|
||||||
|
@ -641,6 +641,7 @@ multiplayer.state.connecting=連接中
|
|||||||
multiplayer.state.disconnected=未創建/加入房間
|
multiplayer.state.disconnected=未創建/加入房間
|
||||||
multiplayer.state.disconnected.hint=多人聯機功能需要先有一位玩家創建房間後,其他玩家加入房間後繼續遊戲。
|
multiplayer.state.disconnected.hint=多人聯機功能需要先有一位玩家創建房間後,其他玩家加入房間後繼續遊戲。
|
||||||
multiplayer.state.master=你已創建房間:%1$s,埠號 %2$d
|
multiplayer.state.master=你已創建房間:%1$s,埠號 %2$d
|
||||||
|
multiplayer.state.master.hint=創建房間後,你可以點擊複製邀請碼,並發送給你希望加入聯機的玩家。這些玩家在進入 HMCL 多人聯機頁面後,點擊加入房間並黏貼邀請碼即可加入聯機房間。
|
||||||
multiplayer.state.slave=你已加入房間: %1$s,位址為 %2$s
|
multiplayer.state.slave=你已加入房間: %1$s,位址為 %2$s
|
||||||
multiplayer.state.slave.copy=拷貝位址
|
multiplayer.state.slave.copy=拷貝位址
|
||||||
multiplayer.state.slave.hint=加入房間後,你需要在 Minecraft 的多人遊戲頁面選擇 HMCL 多人聯機房間伺服器,或者手動添加下方的地址的伺服器。
|
multiplayer.state.slave.hint=加入房間後,你需要在 Minecraft 的多人遊戲頁面選擇 HMCL 多人聯機房間伺服器,或者手動添加下方的地址的伺服器。
|
||||||
|
@ -641,6 +641,7 @@ multiplayer.state.connecting=连接中
|
|||||||
multiplayer.state.disconnected=未创建/加入房间
|
multiplayer.state.disconnected=未创建/加入房间
|
||||||
multiplayer.state.disconnected.hint=多人联机功能需要先有一位玩家创建房间后,其他玩家加入房间后继续游戏。
|
multiplayer.state.disconnected.hint=多人联机功能需要先有一位玩家创建房间后,其他玩家加入房间后继续游戏。
|
||||||
multiplayer.state.master=你已创建房间:%1$s,端口号 %2$d
|
multiplayer.state.master=你已创建房间:%1$s,端口号 %2$d
|
||||||
|
multiplayer.state.master.hint=创建房间后,你可以点击复制邀请码,并发送给你希望加入联机的玩家。这些玩家在进入 HMCL 多人联机页面后,点击加入房间并粘贴邀请码即可加入联机房间。
|
||||||
multiplayer.state.slave=你已加入房间: %1$s,地址为 %2$s
|
multiplayer.state.slave=你已加入房间: %1$s,地址为 %2$s
|
||||||
multiplayer.state.slave.copy=拷贝地址
|
multiplayer.state.slave.copy=拷贝地址
|
||||||
multiplayer.state.slave.hint=加入房间后,你需要在 Minecraft 的多人游戏页面选择 HMCL 多人联机房间服务器,或者手动添加下方的地址的服务器。
|
multiplayer.state.slave.hint=加入房间后,你需要在 Minecraft 的多人游戏页面选择 HMCL 多人联机房间服务器,或者手动添加下方的地址的服务器。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user