调试日志

This commit is contained in:
flswld
2023-03-27 22:26:53 +08:00
parent 0ac9033482
commit 568a329488
2 changed files with 44 additions and 0 deletions

View File

@@ -191,8 +191,14 @@ func GetGroupMonsterCount(luaState *lua.LState) int {
luaState.Push(lua.LNumber(-1))
return 1
}
if groupId == 133003095 {
logger.Debug("==========a==========")
}
group := scene.GetGroupById(uint32(groupId))
if group == nil {
if groupId == 133003095 {
logger.Debug("==========b==========")
}
luaState.Push(lua.LNumber(-1))
return 1
}
@@ -233,13 +239,22 @@ func ChangeGroupGadget(luaState *lua.LState) int {
luaState.Push(lua.LNumber(-1))
return 1
}
if groupId == 133003095 {
logger.Debug("==========c==========")
}
group := scene.GetGroupById(uint32(groupId))
if group == nil {
if groupId == 133003095 {
logger.Debug("==========d==========")
}
luaState.Push(lua.LNumber(-1))
return 1
}
gadgetInfo, ok := luaState.Get(2).(*lua.LTable)
if !ok {
if groupId == 133003095 {
logger.Debug("==========e==========")
}
luaState.Push(lua.LNumber(-1))
return 1
}
@@ -248,5 +263,8 @@ func ChangeGroupGadget(luaState *lua.LState) int {
entity := group.GetEntityByConfigId(uint32(gadgetStateInfo.ConfigId))
GAME_MANAGER.ChangeGadgetState(player, scene, entity.GetId(), uint32(gadgetStateInfo.State))
luaState.Push(lua.LNumber(0))
if groupId == 133003095 {
logger.Debug("==========f==========")
}
return 1
}

View File

@@ -559,16 +559,33 @@ func (g *GameManager) KillEntity(player *model.Player, scene *Scene, entityId ui
scene.DestroyEntity(entity.id)
if entity.GetEntityType() == constant.ENTITY_TYPE_MONSTER {
if entity.groupId == 133003095 {
logger.Debug("==========1==========")
}
groupConfig := gdconf.GetSceneGroup(int32(entity.groupId))
if groupConfig == nil {
logger.Error("get group config is nil, groupId: %v, uid: %v", entity.groupId, player.PlayerID)
return
}
group := scene.GetGroupById(entity.groupId)
if group == nil {
logger.Error("get scene group is nil, groupId: %v, uid: %v", entity.groupId, player.PlayerID)
return
}
for suiteId := range group.GetAllSuite() {
if entity.groupId == 133003095 {
logger.Debug("==========2==========")
}
suiteConfig := groupConfig.SuiteList[suiteId-1]
for _, triggerName := range suiteConfig.TriggerNameList {
if entity.groupId == 133003095 {
logger.Debug("==========3==========")
}
triggerConfig := groupConfig.TriggerMap[triggerName]
if triggerConfig.Event != constant.LUA_EVENT_ANY_MONSTER_DIE {
if entity.groupId == 133003095 {
logger.Debug("==========4==========")
}
continue
}
if triggerConfig.Condition != "" {
@@ -576,10 +593,16 @@ func (g *GameManager) KillEntity(player *model.Player, scene *Scene, entityId ui
&LuaCtx{uid: player.PlayerID, groupId: entity.groupId},
&LuaEvt{})
if !cond {
if entity.groupId == 133003095 {
logger.Debug("==========5==========")
}
continue
}
}
logger.Debug("scene group trigger fire, trigger: %v, uid: %v", triggerConfig, player.PlayerID)
if entity.groupId == 133003095 {
logger.Debug("==========6==========")
}
if triggerConfig.Action != "" {
logger.Debug("scene group trigger do action, trigger: %v, uid: %v", triggerConfig, player.PlayerID)
ok := CallLuaFunc(groupConfig.GetLuaState(), triggerConfig.Action,
@@ -588,6 +611,9 @@ func (g *GameManager) KillEntity(player *model.Player, scene *Scene, entityId ui
if !ok {
logger.Error("trigger action fail, trigger: %v, uid: %v", triggerConfig, player.PlayerID)
}
if entity.groupId == 133003095 {
logger.Debug("==========7==========")
}
}
}
}