This commit is contained in:
flswld committed 2023-10-23 01:10:40 +08:00
1 parent 7df7fb9ac6
commit 85d21426e7
8 files changed
+17 -15

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ import (
const (
ConnEstFreqLimit = 100 // 每秒连接建立频率限制
RecvPacketFreqLimit = 1000 // 客户端上行每秒发包频率限制
RecvPacketFreqLimit = 100 // 客户端上行每秒发包频率限制
SendPacketFreqLimit = 1000 // 服务器下行每秒发包频率限制
PacketMaxLen = 343 * 1024 // 最大应用层包长度
ConnRecvTimeout = 30 // 收包超时时间 秒
-1
View File
@@ -321,7 +321,6 @@ func (g *GMCmd) GMForceFinishAllQuest(userId uint32) {
ntf.QuestList = append(ntf.QuestList, pbQuest)
}
GAME.SendMsg(cmd.QuestListUpdateNotify, player.PlayerId, player.ClientSeq, ntf)
GAME.AcceptQuest(player, true)
}
// GMUnlockPoint 解锁场景某个锚点
+6
View File
@@ -350,6 +350,12 @@ func (c *CommandManager) PlayerInputCommand(player *model.Player, targetUid uint
if targetUid != c.system.PlayerId {
return
}
world := WORLD_MANAGER.GetWorldById(player.WorldId)
if world != nil && WORLD_MANAGER.IsAiWorld(world) {
return
}
// 输入的命令将在主协程中处理
c.commandMessageInput <- &CommandMessage{
GMType: PlayerChatGM,
+1 -1
View File
@@ -17,7 +17,7 @@ import (
const (
ENTITY_NUM_UNLIMIT = false // 是否不限制场景内实体数量
ENTITY_MAX_SEND_NUM = 10000 // 场景内最大实体数量
ENTITY_MAX_SEND_NUM = 1000 // 场景内最大实体数量
MAX_MULTIPLAYER_WORLD_NUM = 10 // 本服务器最大多人世界数量
)
-1
View File
@@ -783,7 +783,6 @@ func (g *Game) EvtBulletHitNotify(player *model.Player, payloadMsg pb.Message) {
if WORLD_MANAGER.IsAiWorld(world) {
bulletPhysicsEngine := world.GetBulletPhysicsEngine()
if bulletPhysicsEngine.IsRigidBody(ntf.EntityId) {
logger.Debug("[FPS] EvtBulletHitNotify: %+v", ntf)
bulletPhysicsEngine.DestroyRigidBody(ntf.EntityId)
_ = ntf.HitPoint
}
+9 -7
View File
@@ -101,7 +101,7 @@ func (g *Game) PlayerGetForceQuitBanInfoReq(player *model.Player, payloadMsg pb.
func (g *Game) BackMyWorldReq(player *model.Player, payloadMsg pb.Message) {
// 其他玩家
ok := g.PlayerLeaveWorld(player)
ok := g.PlayerLeaveWorld(player, false)
if !ok {
g.SendError(cmd.BackMyWorldRsp, player, &proto.BackMyWorldRsp{}, proto.Retcode_RET_MP_TARGET_PLAYER_IN_TRANSFER)
@@ -112,7 +112,7 @@ func (g *Game) BackMyWorldReq(player *model.Player, payloadMsg pb.Message) {
func (g *Game) ChangeWorldToSingleModeReq(player *model.Player, payloadMsg pb.Message) {
// 房主
ok := g.PlayerLeaveWorld(player)
ok := g.PlayerLeaveWorld(player, false)
if !ok {
g.SendError(cmd.ChangeWorldToSingleModeRsp, player, &proto.ChangeWorldToSingleModeRsp{}, proto.Retcode_RET_MP_TARGET_PLAYER_IN_TRANSFER)
@@ -138,7 +138,7 @@ func (g *Game) SceneKickPlayerReq(player *model.Player, payloadMsg pb.Message) {
logger.Error("player is nil, uid: %v", targetUid)
return
}
ok := g.PlayerLeaveWorld(targetPlayer)
ok := g.PlayerLeaveWorld(targetPlayer, false)
if !ok {
g.SendError(cmd.SceneKickPlayerRsp, player, &proto.SceneKickPlayerRsp{}, proto.Retcode_RET_MP_TARGET_PLAYER_IN_TRANSFER)
return
@@ -375,7 +375,11 @@ func (g *Game) HostEnterMpWorld(hostPlayer *model.Player) {
g.RemoveSceneEntityNotifyToPlayer(hostPlayer, proto.VisionType_VISION_MISS, entityIdList)
}
func (g *Game) PlayerLeaveWorld(player *model.Player) bool {
func (g *Game) PlayerLeaveWorld(player *model.Player, force bool) bool {
if force {
g.ReLoginPlayer(player.PlayerId, true)
return true
}
oldWorld := WORLD_MANAGER.GetWorldById(player.WorldId)
if oldWorld == nil {
logger.Error("world is nil, worldId: %v, uid: %v", player.WorldId, player.PlayerId)
@@ -415,9 +419,7 @@ func (g *Game) WorldRemovePlayer(world *World, player *model.Player) {
if worldPlayer.PlayerId == world.GetOwner().PlayerId {
continue
}
if ok := g.PlayerLeaveWorld(worldPlayer); !ok {
return
}
g.PlayerLeaveWorld(worldPlayer, true)
}
}
scene := world.GetSceneById(player.SceneId)
-3
View File
@@ -19,12 +19,9 @@ import (
// AddQuestContentProgressReq 添加任务内容进度请求
func (g *Game) AddQuestContentProgressReq(player *model.Player, payloadMsg pb.Message) {
req := payloadMsg.(*proto.AddQuestContentProgressReq)
logger.Debug("AddQuestContentProgressReq: %v", req)
g.TriggerQuest(player, int32(req.ContentType), "", int32(req.Param))
// g.AddQuestProgress(player, req)
rsp := &proto.AddQuestContentProgressRsp{
ContentType: req.ContentType,
}
-1
View File
@@ -101,7 +101,6 @@ func (q *DbQuest) AddQuestProgress(questId uint32, index int, progress uint32) {
return
}
if quest.State != constant.QUEST_STATE_UNFINISHED {
logger.Error("invalid quest state, questId: %v, state: %v", questId, quest.State)
return
}
questDataConfig := gdconf.GetQuestDataById(int32(questId))