This commit is contained in:
aozhiwei 2022-09-15 19:41:23 +08:00
parent 2cfe2876a9
commit b61e760398
2 changed files with 12 additions and 12 deletions

View File

@ -1779,19 +1779,19 @@ void Human::SendUpdateMsg()
void Human::SendGameOver() void Human::SendGameOver()
{ {
if (IsEntitySubType(EST_Player)) { if (IsEntitySubType(EST_Player)) {
//!!!必须要在SendNotifyMsg之前注意哦 if (already_report_battle_) {
if (!sent_battlereport_) {
SendBattleReport();
sent_battlereport_ = true;
GameLog::Instance()->GameEnd((Player*)this);
}
{
cs::SMGameOver msg; cs::SMGameOver msg;
FillSMGameOver(msg); FillSMGameOver(msg);
SendNotifyMsg(msg); SendNotifyMsg(msg);
#ifdef DEBUG } else {
a8::XPrintf("SendGameOver socket_handle:%d\n", {socket_handle}); if (!sending_battlereport_) {
#endif sending_battlereport_ = true;
SendBattleReport();
}
if (!is_game_end_) {
GameLog::Instance()->GameEnd((Player*)this);
is_game_end_ = true;
}
} }
} }
} }

View File

@ -423,8 +423,8 @@ private:
std::array<ObjectSyncFlags, FIXED_OBJECT_MAXID> fixed_object_sync_flags_ = {}; std::array<ObjectSyncFlags, FIXED_OBJECT_MAXID> fixed_object_sync_flags_ = {};
bool already_report_battle_ = false; bool already_report_battle_ = false;
bool sent_battlereport_ = false; bool sending_battlereport_ = false;
bool sent_game_end_ = false; bool is_game_end_ = false;
long long jump_frameno_ = 0; long long jump_frameno_ = 0;
float old_sync_speed = 0; float old_sync_speed = 0;