update language field in 9E and forward it on the proxy server
This commit is contained in:
@@ -1198,7 +1198,7 @@ struct C_Login_PC_9D {
|
||||
le_uint64_t unused;
|
||||
le_uint32_t sub_version;
|
||||
uint8_t is_extended; // If 1, structure has extended format
|
||||
uint8_t unknown_a1; // Always 1?
|
||||
uint8_t language; // 0 = JP, 1 = EN, 2 = DE (?), 3 = FR (?), 4 = ES
|
||||
parray<uint8_t, 0x2> unused3; // Always zeroes?
|
||||
ptext<char, 0x10> unused1; // Same as unused1/unused2 in 9A
|
||||
ptext<char, 0x10> unused2;
|
||||
|
||||
@@ -130,7 +130,7 @@ static HandlerResult process_server_gc_9A(shared_ptr<ServerState>,
|
||||
cmd.unused = 0;
|
||||
cmd.sub_version = session.sub_version;
|
||||
cmd.is_extended = session.remote_guild_card_number ? 0 : 1;
|
||||
cmd.unknown_a1 = 1;
|
||||
cmd.language = session.language;
|
||||
cmd.serial_number = string_printf("%08" PRIX32 "", session.license->serial_number);
|
||||
cmd.access_key = session.license->access_key;
|
||||
cmd.serial_number2 = cmd.serial_number;
|
||||
@@ -213,7 +213,7 @@ static HandlerResult process_server_pc_gc_patch_02_17(shared_ptr<ServerState> s,
|
||||
cmd.unused = 0xFFFFFFFFFFFF0000;
|
||||
cmd.sub_version = session.sub_version;
|
||||
cmd.is_extended = 0;
|
||||
cmd.unknown_a1 = 1;
|
||||
cmd.language = session.language;
|
||||
cmd.serial_number = string_printf("%08" PRIX32 "",
|
||||
session.license->serial_number);
|
||||
cmd.access_key = session.license->access_key;
|
||||
|
||||
@@ -253,6 +253,7 @@ void ProxyServer::UnlinkedSession::on_input(Channel& ch, uint16_t command, uint3
|
||||
bool should_close_unlinked_session = false;
|
||||
shared_ptr<const License> license;
|
||||
uint32_t sub_version = 0;
|
||||
uint8_t language = 1; // Default = English
|
||||
string character_name;
|
||||
ClientConfigBB client_config;
|
||||
string login_command_bb;
|
||||
@@ -269,6 +270,7 @@ void ProxyServer::UnlinkedSession::on_input(Channel& ch, uint16_t command, uint3
|
||||
license = session->server->state->license_manager->verify_pc(
|
||||
stoul(cmd.serial_number, nullptr, 16), cmd.access_key);
|
||||
sub_version = cmd.sub_version;
|
||||
language = cmd.language;
|
||||
character_name = cmd.name;
|
||||
|
||||
} else if (session->version == GameVersion::GC) {
|
||||
@@ -282,6 +284,7 @@ void ProxyServer::UnlinkedSession::on_input(Channel& ch, uint16_t command, uint3
|
||||
license = session->server->state->license_manager->verify_gc(
|
||||
stoul(cmd.serial_number, nullptr, 16), cmd.access_key);
|
||||
sub_version = cmd.sub_version;
|
||||
language = cmd.language;
|
||||
character_name = cmd.name;
|
||||
client_config.cfg = cmd.client_config.cfg;
|
||||
|
||||
@@ -362,6 +365,7 @@ void ProxyServer::UnlinkedSession::on_input(Channel& ch, uint16_t command, uint3
|
||||
move(session->channel),
|
||||
session->detector_crypt,
|
||||
sub_version,
|
||||
language,
|
||||
character_name);
|
||||
}
|
||||
} catch (const exception& e) {
|
||||
@@ -426,6 +430,7 @@ ProxyServer::LinkedSession::LinkedSession(
|
||||
enable_remote_ip_crc_patch(false),
|
||||
version(version),
|
||||
sub_version(0), // This is set during resume()
|
||||
language(1), // Default = English. This is also set during resume()
|
||||
remote_guild_card_number(0),
|
||||
enable_chat_filter(true),
|
||||
switch_assist(false),
|
||||
@@ -483,8 +488,10 @@ void ProxyServer::LinkedSession::resume(
|
||||
Channel&& client_channel,
|
||||
shared_ptr<PSOBBMultiKeyDetectorEncryption> detector_crypt,
|
||||
uint32_t sub_version,
|
||||
uint8_t language,
|
||||
const string& character_name) {
|
||||
this->sub_version = sub_version;
|
||||
this->language = language;
|
||||
this->character_name = character_name;
|
||||
this->resume_inner(move(client_channel), detector_crypt);
|
||||
}
|
||||
@@ -499,6 +506,7 @@ void ProxyServer::LinkedSession::resume(
|
||||
|
||||
void ProxyServer::LinkedSession::resume(Channel&& client_channel) {
|
||||
this->sub_version = 0;
|
||||
this->language = 1;
|
||||
this->character_name.clear();
|
||||
this->resume_inner(move(client_channel), nullptr);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
|
||||
GameVersion version;
|
||||
uint32_t sub_version;
|
||||
uint8_t language;
|
||||
std::string character_name;
|
||||
std::string login_command_bb;
|
||||
|
||||
@@ -121,6 +122,7 @@ public:
|
||||
Channel&& client_channel,
|
||||
std::shared_ptr<PSOBBMultiKeyDetectorEncryption> detector_crypt,
|
||||
uint32_t sub_version,
|
||||
uint8_t language,
|
||||
const std::string& character_name);
|
||||
void resume(
|
||||
Channel&& client_channel,
|
||||
|
||||
Reference in New Issue
Block a user