fix Ep3 NTE proxy sessions

This commit is contained in:
Martin Michelsen
2024-01-06 11:41:47 -08:00
parent 3b9684d8ac
commit ba4681e35d
2 changed files with 19 additions and 23 deletions
+1 -1
View File
@@ -1104,7 +1104,7 @@ static HandlerResult C_GXB_61(shared_ptr<ProxyServer::LinkedSession> ses, uint16
}
pd = reinterpret_cast<C_CharacterData_V3_61_98*>(&ep3_pd);
} else {
if (is_ep3(ses->version())) {
if (is_ep3(ses->version()) && (ses->version() != Version::GC_EP3_NTE)) {
ses->log.info("Version changed to GC_EP3_NTE");
ses->set_version(Version::GC_EP3_NTE);
}
+18 -22
View File
@@ -439,29 +439,25 @@ void ProxyServer::UnlinkedSession::on_input(Channel& ch, uint16_t command, uint3
if (linked_ses.get()) {
server->id_to_session.emplace(ses->license->serial_number, linked_ses);
if (linked_ses->version() != ses->version()) {
linked_ses->log.error("Linked session has different game version");
} else {
// Resume the linked session using the unlinked session
try {
if (ses->version() == Version::BB_V4) {
linked_ses->resume(
std::move(ses->channel),
ses->detector_crypt,
std::move(ses->login_command_bb));
} else {
linked_ses->resume(
std::move(ses->channel),
ses->detector_crypt,
ses->sub_version,
ses->character_name,
ses->hardware_id,
ses->xb_netloc,
ses->xb_9E_unknown_a1a);
}
} catch (const exception& e) {
linked_ses->log.error("Failed to resume linked session: %s", e.what());
// Resume the linked session using the unlinked session
try {
if (ses->version() == Version::BB_V4) {
linked_ses->resume(
std::move(ses->channel),
ses->detector_crypt,
std::move(ses->login_command_bb));
} else {
linked_ses->resume(
std::move(ses->channel),
ses->detector_crypt,
ses->sub_version,
ses->character_name,
ses->hardware_id,
ses->xb_netloc,
ses->xb_9E_unknown_a1a);
}
} catch (const exception& e) {
linked_ses->log.error("Failed to resume linked session: %s", e.what());
}
}
}