-
Notifications
You must be signed in to change notification settings - Fork 2
Admin Commands_EN
GTSWN provides a single admin command root /gtswn with 2 subcommands:
| Item | Description |
|---|---|
| Command name | /gtswn |
| Permission | OP level 4 |
| Tab completion | First argument can complete subcommand names |
| Subcommand count | 2 (global_energy_trans, global_energy_join) |
/gtswn global_energy_trans <fromUUID> <toUUID>
One-shot migration of all EU from the fromUUID network to the toUUID network.
Migrating EU after a player changes accounts (e.g. premium to third-party) causing the UUID to change.
| Parameter | Description |
|---|---|
| fromUUID | Source player UUID |
| toUUID | Target player UUID |
- Read the source network EU balance
- Deduct EU from the source network first (
setUserEU(fromUUID, sourceEU.subtract(eu))) - Then add EU to the target network (
setUserEU(toUUID, targetEU.add(eu))) - If the source EU was changed by another operation after reading, transfer the entire current balance instead
§aMigration succeeded: <eu> EU
§aFrom: <fromUUID>
§aTo: <toUUID>
§bTarget network total: <toUUID current EU> EU
| Scenario | Message |
|---|---|
| Invalid UUID format |
§cUUID 格式错误,请检查参数 (UUID format error, please check parameters) |
| Source = target |
§e源 UUID 与目标 UUID 相同,无需迁移 (Source UUID equals target UUID, no migration needed) |
| Source has no EU |
§e源网络无 EU 可迁移 (Source network has no EU to migrate) |
Security note: Deducting from the source before adding to the target avoids EU being created out of thin air due to non-atomicity. If the source EU is changed by another operation between the deduct and add steps, the entire current balance is transferred to ensure no over-issuance.
/gtswn global_energy_join <memberUUID> <leaderUUID>
Permanently joins the member network into the leader network via the GT5U team system (SpaceProjectManager).
Multi-player shared grid; the member's wireless EU operations are automatically resolved to the leader's network.
| Parameter | Description |
|---|---|
| memberUUID | Member player UUID |
| leaderUUID | Leader player UUID |
- UUID parsing and validation
- Same-UUID detection (no join needed)
- Call
SpaceProjectManager.getLeader(leaderUUID)to ensure the leader is registered - Loop detection: if
memberUUIDis the leader ofleaderUUID, reject (avoid cycles) - Cascade hint: if
leaderUUIDitself is in someone else's team, hint the actual network being joined - Execute the join:
SpaceProjectManager.putInTeam(memberUUID, leaderUUID)
gtswn.command.join.success:§aJoin succeeded: %s has joined %s's wireless network
gtswn.command.join.network_eu:§bTarget network total: %s EU
| Scenario | Message |
|---|---|
| Same UUID |
§e成员UUID与队长UUID相同,无需加入 (Member UUID equals leader UUID, no join needed) |
| Loop detection |
§c循环检测: %s 是 %s 的队长,无法加入 (Loop detected: %s is the leader of %s, cannot join) |
| Cascade hint |
§e注意: %s 的队长为 %s,%s 将加入 %s 的网络 (Note: %s's leader is %s, %s will join %s's network) |
Scenario: Player A migrates from a premium account to a third-party account; UUID changes from AAAA to BBBB.
/gtswn global_energy_trans AAAA BBBB
Result: All EU from the AAAA network is migrated to the BBBB network.
Scenario: Player B wants to join Player C's wireless grid.
/gtswn global_energy_join B-UUID C-UUID
Result: B's wireless EU operations are automatically resolved to C's network.
Scenario: Player D joins Player E, but E has already joined F.
/gtswn global_energy_join D-UUID E-UUID
Result: D actually joins F's network (cascade hint shown).