Commit 74cfec26 authored by chenweijian's avatar chenweijian

创建游戏房

parent 4a822699
......@@ -18,4 +18,5 @@ func Init() {
group_cron.GroupPowerMonthRankAct()
group_cron.GroupInEventInit() // 进房事件
group_cron.GroupPowerGradeExp() // 家族升级
group_cron.CreateGroup() //
}
package group_cron
import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/config"
"github.com/robfig/cron"
"hilo-group/domain/service/group_s"
)
func CreateGroup() {
if !config.IsMaster() {
return
}
c := cron.New()
spec := "0 6 15 3 8 ?"
_ = c.AddFunc(spec, func() {
var model = domain.CreateModelNil()
userId := uint64(7687)
if config.AppIsRelease() {
userId = 41
}
err := group_s.NewGroupService(model.MyContext).CreateGroupMulByUid(userId, 10)
if err != nil {
model.Log.Errorf("CreateGroupMulByUid fail:%v", err)
}
})
c.Start()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment