1
This commit is contained in:
parent
bc1d54efaa
commit
b71480bacf
@ -838,10 +838,26 @@ void Player::SyncOtherFriend()
|
||||
|
||||
void Player::ProcessEventTimerFunc()
|
||||
{
|
||||
if (curr_max_event_idx_ >= DBEngine::Instance()->GetEventCurrIdx(myself.crc32_code)) {
|
||||
return;
|
||||
}
|
||||
if (last_event_idx_ >= curr_max_event_idx_) {
|
||||
curr_max_event_idx_ = DBEngine::Instance()->GetEventCurrIdx(myself.crc32_code);
|
||||
}
|
||||
if (last_event_idx_ >= curr_max_event_idx_) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto on_ok =
|
||||
[] (a8::XParams& param, const f8::DataSet* data_set)
|
||||
{
|
||||
|
||||
std::string account_id = param.sender.GetString();
|
||||
long long curr_max_event_idx = param.param1;
|
||||
long long last_event_idx = param.param2;
|
||||
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(account_id);
|
||||
if (hum) {
|
||||
hum->ProcessEvent(curr_max_event_idx, data_set);
|
||||
}
|
||||
};
|
||||
auto on_error =
|
||||
[] (a8::XParams& param, int error_code, const std::string& error_msg)
|
||||
@ -861,9 +877,19 @@ void Player::ProcessEventTimerFunc()
|
||||
myself.base_data.account_id
|
||||
},
|
||||
a8::XParams()
|
||||
.SetSender(myself.base_data.account_id),
|
||||
.SetSender(myself.base_data.account_id)
|
||||
.SetParam1(curr_max_event_idx_)
|
||||
.SetParam1(last_event_idx_),
|
||||
on_ok,
|
||||
on_error,
|
||||
myself.crc32_code
|
||||
);
|
||||
}
|
||||
|
||||
void Player::ProcessEvent(long long max_event_idx, const f8::DataSet* data_set)
|
||||
{
|
||||
curr_max_event_idx_ = max_event_idx;
|
||||
if (data_set) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -120,6 +120,7 @@ private:
|
||||
void PushFriendList();
|
||||
void SyncOtherFriend();
|
||||
void ProcessEventTimerFunc();
|
||||
void ProcessEvent(long long max_event_idx, const f8::DataSet* data_set);
|
||||
|
||||
private:
|
||||
bool dirty_ = false;
|
||||
@ -127,6 +128,7 @@ private:
|
||||
timer_list* update_user_info_timer_ = nullptr;
|
||||
long long last_apply_idx_ = 0;
|
||||
long long last_event_idx_ = 0;
|
||||
long long curr_max_event_idx_ = 0;
|
||||
|
||||
std::map<std::string, Friend*> friend_hash_;
|
||||
std::map<long long, FriendApply*> apply_hash_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user