活动优化

This commit is contained in:
hahwu 2026-03-23 15:06:52 +08:00
parent f3ce3249cc
commit bf5eafc0e0
3 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"fmt"
"server/db"
"server/game/mod/msg"
Msg "server/game/mod/msg"
protoMsg "server/msg"
"server/pkg/github.com/name5566/leaf/log"
"sync"
@ -114,6 +115,7 @@ func (r *ActivityMgr) Reload() error {
log.Debug("load activity cfg: %v", cfg)
data.List[v.Id] = cfg
}
G_GameLogicPtr.NotifyAll(&Msg.Msg{Type: Msg.HANDLE_TYPE_ACTIVITY_RELOAD})
return nil
}

View File

@ -581,6 +581,10 @@ func (p *Player) handle(m *msg.Msg) error {
Uids: otherUids,
})
}
case msg.HANDLE_TYPE_ACTIVITY_RELOAD:
p.InitActivity()
p.BackDataActivity()
p.PushClientRes(p.GetMailMod().BackData())
default:
log.Debug("uid : %d, handle msg type : %d not exist", p.M_DwUin, m.Type)
}

View File

@ -158,6 +158,8 @@ const (
HANDLE_TYPE_LOGIN // 玩家登录处理
SERVER_PLAYER_SYNC_LOGOUT_MSG // 玩家处理完离线消息
HANDLE_TYPE_ACTIVITY_RELOAD // 活动重新加载
)
const (
@ -396,6 +398,8 @@ func formatType(t int) string {
return "player_login"
case SERVER_PLAYER_SYNC_LOGOUT_MSG:
return "player_sync_logout"
case HANDLE_TYPE_ACTIVITY_RELOAD:
return "activity_reload"
default:
return fmt.Sprintf("Unknown(%d)", t)
}