活动优化
This commit is contained in:
parent
f3ce3249cc
commit
bf5eafc0e0
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"server/db"
|
"server/db"
|
||||||
"server/game/mod/msg"
|
"server/game/mod/msg"
|
||||||
|
Msg "server/game/mod/msg"
|
||||||
protoMsg "server/msg"
|
protoMsg "server/msg"
|
||||||
"server/pkg/github.com/name5566/leaf/log"
|
"server/pkg/github.com/name5566/leaf/log"
|
||||||
"sync"
|
"sync"
|
||||||
@ -114,6 +115,7 @@ func (r *ActivityMgr) Reload() error {
|
|||||||
log.Debug("load activity cfg: %v", cfg)
|
log.Debug("load activity cfg: %v", cfg)
|
||||||
data.List[v.Id] = cfg
|
data.List[v.Id] = cfg
|
||||||
}
|
}
|
||||||
|
G_GameLogicPtr.NotifyAll(&Msg.Msg{Type: Msg.HANDLE_TYPE_ACTIVITY_RELOAD})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -581,6 +581,10 @@ func (p *Player) handle(m *msg.Msg) error {
|
|||||||
Uids: otherUids,
|
Uids: otherUids,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
case msg.HANDLE_TYPE_ACTIVITY_RELOAD:
|
||||||
|
p.InitActivity()
|
||||||
|
p.BackDataActivity()
|
||||||
|
p.PushClientRes(p.GetMailMod().BackData())
|
||||||
default:
|
default:
|
||||||
log.Debug("uid : %d, handle msg type : %d not exist", p.M_DwUin, m.Type)
|
log.Debug("uid : %d, handle msg type : %d not exist", p.M_DwUin, m.Type)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,6 +158,8 @@ const (
|
|||||||
|
|
||||||
HANDLE_TYPE_LOGIN // 玩家登录处理
|
HANDLE_TYPE_LOGIN // 玩家登录处理
|
||||||
SERVER_PLAYER_SYNC_LOGOUT_MSG // 玩家处理完离线消息
|
SERVER_PLAYER_SYNC_LOGOUT_MSG // 玩家处理完离线消息
|
||||||
|
|
||||||
|
HANDLE_TYPE_ACTIVITY_RELOAD // 活动重新加载
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -396,6 +398,8 @@ func formatType(t int) string {
|
|||||||
return "player_login"
|
return "player_login"
|
||||||
case SERVER_PLAYER_SYNC_LOGOUT_MSG:
|
case SERVER_PLAYER_SYNC_LOGOUT_MSG:
|
||||||
return "player_sync_logout"
|
return "player_sync_logout"
|
||||||
|
case HANDLE_TYPE_ACTIVITY_RELOAD:
|
||||||
|
return "activity_reload"
|
||||||
default:
|
default:
|
||||||
return fmt.Sprintf("Unknown(%d)", t)
|
return fmt.Sprintf("Unknown(%d)", t)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user