Skip to content

Admin Commands_EN

MIAOKATZE edited this page Jul 12, 2026 · 2 revisions

Admin Commands

⚠️ Important Warning / 重要警告

These commands are for extreme edge cases only and should be used by admins (OP level 4). Do not use them during normal gameplay.

本页命令仅限极端特殊情况下由管理员使用,普通游玩请勿使用

  • global_energy_trans is only for migrating EU after a player's UUID changes (e.g. premium → third-party account) — use normal in-game mechanisms for regular play.
  • global_energy_join is only for explicit multi-player shared grid needs — not required for single-player or regular multiplayer.

1. Command Overview

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)

2. global_energy_trans

Usage

/gtswn global_energy_trans <fromUUID> <toUUID>

Function

One-shot migration of all EU from the fromUUID network to the toUUID network.

Use Case

Migrating EU after a player changes accounts (e.g. premium to third-party) causing the UUID to change.

⚠️ For Extreme Edge Cases Only / 极端特殊情况专用

This command is only for UUID changes (e.g. account switch) where the EU balance becomes inaccessible. Do not use during normal play (including changing devices, reinstalling the game, or server migration) — in these cases the UUID remains unchanged and the EU balance is automatically preserved. Misuse may cause EU data loss or duplication.

Parameters

Parameter Description
fromUUID Source player UUID
toUUID Target player UUID

Execution Logic

  1. Read the source network EU balance
  2. Deduct EU from the source network first (setUserEU(fromUUID, sourceEU.subtract(eu)))
  3. Then add EU to the target network (setUserEU(toUUID, targetEU.add(eu)))
  4. If the source EU was changed by another operation after reading, transfer the entire current balance instead

Success Messages (green + cyan)

§aMigration succeeded: <eu> EU
§aFrom: <fromUUID>
§aTo: <toUUID>
§bTarget network total: <toUUID current EU> EU

Failure Messages

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.

3. global_energy_join

Usage

/gtswn global_energy_join <memberUUID> <leaderUUID>

Function

Permanently joins the member network into the leader network via the GT5U team system (SpaceProjectManager).

Use Case

Multi-player shared grid; the member's wireless EU operations are automatically resolved to the leader's network.

Parameters

Parameter Description
memberUUID Member player UUID
leaderUUID Leader player UUID

Execution Logic

  1. UUID parsing and validation
  2. Same-UUID detection (no join needed)
  3. Call SpaceProjectManager.getLeader(leaderUUID) to ensure the leader is registered
  4. Loop detection: if memberUUID is the leader of leaderUUID, reject (avoid cycles)
  5. Cascade hint: if leaderUUID itself is in someone else's team, hint the actual network being joined
  6. Execute the join: SpaceProjectManager.putInTeam(memberUUID, leaderUUID)

Success Messages

gtswn.command.join.success:§aJoin succeeded: %s has joined %s's wireless network
gtswn.command.join.network_eu:§bTarget network total: %s EU

Failure / Warning Messages

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)

4. Usage Examples

Example 1: Migrating EU after account change

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.

Example 2: Multi-player shared grid

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.

Example 3: Cascade join

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).

Clone this wiki locally