Skip to content

Commit de3a1f1

Browse files
committed
feat: add public-port option
1 parent 4dff329 commit de3a1f1

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

src/main/java/me/daoge/daogelab/DaogeLabCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void prepareCommandTree(CommandTree tree) {
2424
.formatted(
2525
DaogeLab.INSTANCE.getConfig().useHttps() ? "wss" : "ws",
2626
DaogeLab.INSTANCE.getConfig().address(),
27-
DaogeLab.INSTANCE.getConfig().port(),
27+
DaogeLab.INSTANCE.getConfig().publicPort(),
2828
player.getLoginData().getUuid().toString());
2929
if (QRCodeUtils.showQRCode(player, qrText)) {
3030
player.sendTr(TextFormat.YELLOW + "%daogelab:scan_qr_code");

src/main/java/me/daoge/daogelab/DaogeLabConfig.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,26 @@
1010
@Getter
1111
@Accessors(fluent = true)
1212
public class DaogeLabConfig extends OkaeriConfig {
13-
@Comment("The address for the DgLab-App to connect. Default: 127.0.0.1")
14-
@Comment("In most cases, this is same with the address you use to connect to the MC server")
13+
@Comment("The address for the DgLab app to connect In most cases, this")
14+
@Comment("is same with the address you use to connect to the MC server")
1515
private String address = "127.0.0.1";
1616

17-
@Comment("The port for the DgLab ws server port number. Default: 8080")
17+
@Comment("The port for the DgLab app to connect. In most cases, this is same")
18+
@Comment("with the port that websocket server use, unless you are using frp,")
19+
@Comment("causing the app to connect to a different port than the one open to")
20+
@Comment("the websocket server")
21+
@CustomKey("public-port")
22+
private int publicPort = 8080;
23+
24+
@Comment("The port that will open to the DgLab websocket server")
1825
private int port = 8080;
1926

2027
@CustomKey("use-https")
21-
@Comment("If true, connect to WebSocket server using HTTPS protocol. Default: false")
22-
@Comment("If you connect from the Internet, you may need to turn on this option")
23-
@Comment("Note that if you have this enabled, the address must be a domain name instead of an IP address")
28+
@Comment("If true, connect to WebSocket server using HTTPS protocol. If you connect")
29+
@Comment("from the Internet, you may need to turn on this option. Note that if you")
30+
@Comment("have this enabled, the address must be a domain name instead of an IP address")
2431
private boolean useHttps = false;
2532

26-
@Comment("Mode determines how the current will change. Default: default_mode")
33+
@Comment("Mode determines how the current will change")
2734
private String mode = DefaultMode.NAME;
2835
}

src/main/java/me/daoge/daogelab/mode/DefaultMode.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.allaymc.api.eventbus.event.entity.EntityDamageEvent;
1010
import org.allaymc.api.eventbus.event.entity.EntityDieEvent;
1111
import org.allaymc.api.eventbus.event.entity.ProjectileHitEvent;
12-
import org.allaymc.api.math.MathUtils;
1312
import org.allaymc.api.world.Sound;
1413
import org.cloudburstmc.math.vector.Vector3f;
1514
import org.cloudburstmc.protocol.bedrock.packet.PlaySoundPacket;

0 commit comments

Comments
 (0)