Add log-only BB account sync login hook
This commit is contained in:
@@ -35,4 +35,17 @@ inline void notify_player_state_saved(
|
|||||||
filename.c_str());
|
filename.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void notify_bb_login_start(
|
||||||
|
uint32_t account_id,
|
||||||
|
const std::string& bb_username,
|
||||||
|
int64_t character_slot,
|
||||||
|
uint8_t connection_phase) {
|
||||||
|
std::fprintf(stderr,
|
||||||
|
"[AccountSync] event=bb_login_start account_id=%010u bb_username=%s character_slot=%lld connection_phase=%u\n",
|
||||||
|
static_cast<unsigned int>(account_id),
|
||||||
|
bb_username.c_str(),
|
||||||
|
static_cast<long long>(character_slot),
|
||||||
|
static_cast<unsigned int>(connection_phase));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace AccountSync
|
} // namespace AccountSync
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "StaticGameData.hh"
|
#include "StaticGameData.hh"
|
||||||
#include "Text.hh"
|
#include "Text.hh"
|
||||||
#include "BrutalPeeps.hh"
|
#include "BrutalPeeps.hh"
|
||||||
|
#include "AccountSync.hh"
|
||||||
|
|
||||||
const char* BATTLE_TABLE_DISCONNECT_HOOK_NAME = "battle_table_state";
|
const char* BATTLE_TABLE_DISCONNECT_HOOK_NAME = "battle_table_state";
|
||||||
const char* QUEST_BARRIER_DISCONNECT_HOOK_NAME = "quest_barrier";
|
const char* QUEST_BARRIER_DISCONNECT_HOOK_NAME = "quest_barrier";
|
||||||
@@ -1672,6 +1673,14 @@ static asio::awaitable<void> on_93_BB(std::shared_ptr<Client> c, Channel::Messag
|
|||||||
co_return;
|
co_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c->login->account && c->login->bb_license) {
|
||||||
|
AccountSync::notify_bb_login_start(
|
||||||
|
c->login->account->account_id,
|
||||||
|
c->login->bb_license->username,
|
||||||
|
c->bb_character_index,
|
||||||
|
c->bb_connection_phase);
|
||||||
|
}
|
||||||
|
|
||||||
std::string version_string = c->bb_client_config.as_string();
|
std::string version_string = c->bb_client_config.as_string();
|
||||||
phosg::strip_trailing_zeroes(version_string);
|
phosg::strip_trailing_zeroes(version_string);
|
||||||
// If the version std::string starts with "Ver.", assume it's Sega and apply the normal version encoding logic. Otherwise,
|
// If the version std::string starts with "Ver.", assume it's Sega and apply the normal version encoding logic. Otherwise,
|
||||||
|
|||||||
Reference in New Issue
Block a user