mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
机器人移动
This commit is contained in:
@@ -24,4 +24,4 @@ dos_batch_num = 1 # 压力测试每批登录并发数量
|
|||||||
dos_loop_login = false # 压力测试是否循环登录退出
|
dos_loop_login = false # 压力测试是否循环登录退出
|
||||||
client_move_enable = false # 是否开启客户端模拟移动
|
client_move_enable = false # 是否开启客户端模拟移动
|
||||||
client_move_speed = 10 # 客户端模拟移动速度
|
client_move_speed = 10 # 客户端模拟移动速度
|
||||||
client_move_range_ext = 1024 # 客户端模拟移动区域半径
|
client_move_range_ext = 100 # 客户端模拟移动区域半径
|
||||||
|
|||||||
@@ -155,13 +155,19 @@ func clientLogic(account string, session *net.Session) {
|
|||||||
tickCounter++
|
tickCounter++
|
||||||
if config.GetConfig().Hk4eRobot.ClientMoveEnable {
|
if config.GetConfig().Hk4eRobot.ClientMoveEnable {
|
||||||
if enterSceneDone {
|
if enterSceneDone {
|
||||||
currPos.X -= float32(float64(config.GetConfig().Hk4eRobot.ClientMoveSpeed) * math.Sin(float64(moveRot)))
|
for {
|
||||||
currPos.Z += float32(float64(config.GetConfig().Hk4eRobot.ClientMoveSpeed) * math.Cos(float64(moveRot)))
|
dx := float32(float64(config.GetConfig().Hk4eRobot.ClientMoveSpeed) * math.Cos(float64(moveRot/360.0*2*math.Pi)))
|
||||||
if currPos.X > bornPos.X+float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) ||
|
dz := float32(float64(config.GetConfig().Hk4eRobot.ClientMoveSpeed) * math.Sin(float64(moveRot/360.0*2*math.Pi)))
|
||||||
currPos.Z > bornPos.Z+float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) ||
|
if currPos.X-dx > bornPos.X+float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) ||
|
||||||
currPos.X < bornPos.X-float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) ||
|
currPos.Z-dz > bornPos.Z+float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) ||
|
||||||
currPos.Z < bornPos.Z-float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) {
|
currPos.X-dx < bornPos.X-float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) ||
|
||||||
moveRot = random.GetRandomFloat32(0.0, 359.9)
|
currPos.Z-dz < bornPos.Z-float32(config.GetConfig().Hk4eRobot.ClientMoveRangeExt) {
|
||||||
|
moveRot = random.GetRandomFloat32(0.0, 359.9)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
currPos.X -= dx
|
||||||
|
currPos.Z -= dz
|
||||||
|
break
|
||||||
}
|
}
|
||||||
moveReliableSeq += 100
|
moveReliableSeq += 100
|
||||||
entityMoveInfo := &proto.EntityMoveInfo{
|
entityMoveInfo := &proto.EntityMoveInfo{
|
||||||
|
|||||||
Reference in New Issue
Block a user