Add log-only BB account sync logout hook
This commit is contained in:
@@ -48,4 +48,15 @@ inline void notify_bb_login_start(
|
|||||||
static_cast<unsigned int>(connection_phase));
|
static_cast<unsigned int>(connection_phase));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void notify_bb_login_end(
|
||||||
|
uint32_t account_id,
|
||||||
|
const std::string& bb_username,
|
||||||
|
int64_t character_slot) {
|
||||||
|
std::fprintf(stderr,
|
||||||
|
"[AccountSync] event=bb_login_end account_id=%010u bb_username=%s character_slot=%lld\n",
|
||||||
|
static_cast<unsigned int>(account_id),
|
||||||
|
bb_username.c_str(),
|
||||||
|
static_cast<long long>(character_slot));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace AccountSync
|
} // namespace AccountSync
|
||||||
|
|||||||
@@ -233,6 +233,13 @@ Client::~Client() {
|
|||||||
|
|
||||||
if ((this->version() == Version::BB_V4) && (this->character_data.get())) {
|
if ((this->version() == Version::BB_V4) && (this->character_data.get())) {
|
||||||
this->save_all();
|
this->save_all();
|
||||||
|
|
||||||
|
if (this->login && this->login->account && this->login->bb_license) {
|
||||||
|
AccountSync::notify_bb_login_end(
|
||||||
|
this->login->account->account_id,
|
||||||
|
this->login->bb_license->username,
|
||||||
|
this->bb_character_index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this->log.info_f("Deleted");
|
this->log.info_f("Deleted");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user