add $edit language

This commit is contained in:
Martin Michelsen
2024-03-31 11:59:21 -07:00
parent acbebaeb70
commit 6f0124f7ec
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -468,7 +468,7 @@ Some commands only work on the game server and not on the proxy server. The chat
* `$savechar <slot>`: Saves your current character data on the server in the specified slot (each serial number has 4 slots, numbered 1-4). These slots are separate from BB character slots; using this command does not affect BB characters.
* `$loadchar <slot>` (v1 and v2 only): Loads your character data from the specified slot. The changes will be undone if you join a game - to save your changes, disconnect from the lobby.
* `$bbchar <username> <password> <slot>`: Use this command when playing on a non-BB version of PSO. If the username and password are correct, this command converts your current character to BB format and saves it on the server in the given slot (1-4). Any character already in that slot is overwritten. (This command is similar to `$savechar`, except it overwrites a BB character slot, and can transfer characters across accounts.) Note that the character's chat data, quick menu config, and bank contents are not copied, since there is no way for the server to request those types of data.
* `$edit <stat> <value>`: Modifies your character data. If you are on V3 (GameCube/Xbox), this command does nothing. If you are on V1 or V2 (DC or PC, not BB), your changes will be undone if you join a game - to save your changes, disconnect from the lobby. If cheats are allowed on the server, `<stat>` can be any of `atp`, `mst`, `evp`, `hp`, `dfp`, `ata`, `lck`, `meseta`, `exp`, `level`, `namecolor`, `secid`, `name`, `npc`, or `tech`. If cheats are not allowed, only `namecolor`, `name`, and `npc` can be used.
* `$edit <stat> <value>`: Modifies your character data. If you are on V3 (GameCube/Xbox), this command does nothing. If you are on V1 or V2 (DC or PC, not BB), your changes will be undone if you join a game - to save your changes, disconnect from the lobby. If cheats are allowed on the server, `<stat>` can be any of `atp`, `mst`, `evp`, `hp`, `dfp`, `ata`, `lck`, `meseta`, `exp`, `level`, `namecolor`, `secid`, `name`, `language`, `npc`, or `tech`. If cheats are not allowed, only `namecolor`, `name`, `language`, and `npc` can be used. Changing your character's language is only useful on BB; to do so, use a single-character language code (e.g. to switch your character to English, use `$edit language E`; for Japanese, use `$edit language J`).
* Blue Burst player commands (game server only)
* `$bank [number]`: Switches your current bank, so you can access your other character's banks (if `number` is 1-4) or your shared account bank (if `number` is 0). If `number` is not given, switches back to your current character's bank.
+12
View File
@@ -1290,6 +1290,18 @@ static void server_command_edit(shared_ptr<Client> c, const std::string& args) {
uint32_t new_color;
sscanf(tokens.at(1).c_str(), "%8X", &new_color);
p->disp.visual.name_color = new_color;
} else if (tokens.at(0) == "language" || tokens.at(0) == "lang") {
if (tokens.at(1).size() != 1) {
throw runtime_error("invalid language");
}
uint8_t new_language = language_code_for_char(tokens.at(1).at(0));
c->channel.language = new_language;
p->inventory.language = new_language;
p->guild_card.language = new_language;
auto sys = c->system_file(false);
if (sys) {
sys->base.language = new_language;
}
} else if (tokens.at(0) == "secid" && cheats_allowed) {
uint8_t secid = section_id_for_name(tokens.at(1));
if (secid == 0xFF) {