1
This commit is contained in:
parent
9bd4b6acbd
commit
3f77a2cfb9
@ -1033,7 +1033,7 @@ void Player::_CMMove(f8::MsgHdr* hdr, const cs::CMMove& msg)
|
|||||||
tmp_pos.z
|
tmp_pos.z
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
Pullback();
|
SyncServerPos(0);
|
||||||
} else {
|
} else {
|
||||||
move_target_pos_ = tmp_pos;
|
move_target_pos_ = tmp_pos;
|
||||||
}
|
}
|
||||||
@ -1046,7 +1046,7 @@ void Player::_CMMove(f8::MsgHdr* hdr, const cs::CMMove& msg)
|
|||||||
tmp_pos.z
|
tmp_pos.z
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
Pullback();
|
SyncServerPos(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -2024,17 +2024,18 @@ void Player::SetShotHold(bool hold)
|
|||||||
shot_hold = hold;
|
shot_hold = hold;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Pullback()
|
void Player::SyncServerPos(int reason)
|
||||||
{
|
{
|
||||||
#ifdef MYDEBUG
|
#ifdef MYDEBUG
|
||||||
a8::XPrintf("pullback %f,%f,%f\n",
|
a8::XPrintf("SyncServerPos %f,%f,%f\n",
|
||||||
{
|
{
|
||||||
GetPos().GetX(),
|
GetPos().GetX(),
|
||||||
GetPos().GetY(),
|
GetPos().GetY(),
|
||||||
GetPos().GetZ(),
|
GetPos().GetZ(),
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
cs::SMPullback msg;
|
cs::SMServerSyncPos msg;
|
||||||
|
msg.set_reason(reason);
|
||||||
TypeConvert::ToPb(GetPos().ToGlmVec3(), msg.mutable_pos());
|
TypeConvert::ToPb(GetPos().ToGlmVec3(), msg.mutable_pos());
|
||||||
SendNotifyMsg(msg);
|
SendNotifyMsg(msg);
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class Player : public Human
|
|||||||
void _CMMobaBattleData(f8::MsgHdr* hdr, const cs::CMMobaBattleData& msg);
|
void _CMMobaBattleData(f8::MsgHdr* hdr, const cs::CMMobaBattleData& msg);
|
||||||
virtual void SetAttackDir(const glm::vec3& attack_dir) override;
|
virtual void SetAttackDir(const glm::vec3& attack_dir) override;
|
||||||
void AsyncRequestWatchWar(bool send_rsp_msg);
|
void AsyncRequestWatchWar(bool send_rsp_msg);
|
||||||
void Pullback();
|
void SyncServerPos(int reason);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Player();
|
Player();
|
||||||
|
@ -77,5 +77,5 @@ enum SMMessageId_e
|
|||||||
_SMBattlePreInfoUpdate = 1034;
|
_SMBattlePreInfoUpdate = 1034;
|
||||||
_SMAddBattleHint = 1035;
|
_SMAddBattleHint = 1035;
|
||||||
_SMDelBattleHint = 1036;
|
_SMDelBattleHint = 1036;
|
||||||
_SMPullback = 1037;
|
_SMServerSyncPos = 1037;
|
||||||
}
|
}
|
||||||
|
@ -2149,8 +2149,9 @@ message SMDelBattleHint
|
|||||||
optional int32 uniid = 1; //唯一id
|
optional int32 uniid = 1; //唯一id
|
||||||
}
|
}
|
||||||
|
|
||||||
//移动失败-拉回
|
//同步服务器坐标
|
||||||
message SMPullback
|
message SMServerSyncPos
|
||||||
{
|
{
|
||||||
|
optional int32 reason = 1; //0:移动拉回 其他:直接设置坐标
|
||||||
optional MFVec3 pos = 2; //坐标
|
optional MFVec3 pos = 2; //坐标
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user