Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
482a420ea2
@ -994,6 +994,8 @@ const (
|
|||||||
Rtype245 TaskType = 245 //招募到X品质X阵营的守护者X个
|
Rtype245 TaskType = 245 //招募到X品质X阵营的守护者X个
|
||||||
Rtype246 TaskType = 246 //在一次十连内获得X个以上的Y品质的守护者 (紫色以上)
|
Rtype246 TaskType = 246 //在一次十连内获得X个以上的Y品质的守护者 (紫色以上)
|
||||||
Rtype247 TaskType = 247 //完成X品质的武馆派遣Y个
|
Rtype247 TaskType = 247 //完成X品质的武馆派遣Y个
|
||||||
|
Rtype248 TaskType = 248 //在维京表内指定类型的boss副本内,消耗X点体力
|
||||||
|
Rtype249 TaskType = 249 //赢得X把快速接龙
|
||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
MailLineEasy int32 = 1 // 简单
|
MailLineEasy int32 = 1 // 简单
|
||||||
|
@ -51,5 +51,9 @@ func (this *apiComp) Result(session comm.IUserSession, req *pb.JielongResultReq)
|
|||||||
session.SendMsg(string(this.module.GetType()), "result", &pb.JielongResultResp{
|
session.SendMsg(string(this.module.GetType()), "result", &pb.JielongResultResp{
|
||||||
Data: list,
|
Data: list,
|
||||||
})
|
})
|
||||||
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
|
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype249, 1))
|
||||||
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ type Timer struct {
|
|||||||
caravan *CaravanRank
|
caravan *CaravanRank
|
||||||
activity *Activity
|
activity *Activity
|
||||||
stone *StoneComp
|
stone *StoneComp
|
||||||
|
viking *VikingRank
|
||||||
}
|
}
|
||||||
|
|
||||||
// 模块名
|
// 模块名
|
||||||
@ -73,6 +74,7 @@ func (this *Timer) OnInstallComp() {
|
|||||||
this.caravan = this.RegisterComp(new(CaravanRank)).(*CaravanRank)
|
this.caravan = this.RegisterComp(new(CaravanRank)).(*CaravanRank)
|
||||||
this.activity = this.RegisterComp(new(Activity)).(*Activity)
|
this.activity = this.RegisterComp(new(Activity)).(*Activity)
|
||||||
this.stone = this.RegisterComp(new(StoneComp)).(*StoneComp)
|
this.stone = this.RegisterComp(new(StoneComp)).(*StoneComp)
|
||||||
|
this.viking = this.RegisterComp(new(VikingRank)).(*VikingRank)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 跨服对象获取数据操作对象
|
// 跨服对象获取数据操作对象
|
||||||
|
@ -46,7 +46,6 @@ func (this *VikingRank) Start() (err error) {
|
|||||||
// 0 0 0 ? * MON // 每周一零点
|
// 0 0 0 ? * MON // 每周一零点
|
||||||
cron.AddFunc("0 0 0 ? * MON", this.TimerSeason)
|
cron.AddFunc("0 0 0 ? * MON", this.TimerSeason)
|
||||||
|
|
||||||
//this.TimerSeason()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
oldDifficulty int32 // 记录通关之前的难度
|
oldDifficulty int32 // 记录通关之前的难度
|
||||||
consumPs int32
|
consumPs int32
|
||||||
err error
|
err error
|
||||||
|
taskPs int32
|
||||||
)
|
)
|
||||||
changExp = make(map[string]int32, 0)
|
changExp = make(map[string]int32, 0)
|
||||||
mapData = make(map[string]interface{}, 0)
|
mapData = make(map[string]interface{}, 0)
|
||||||
@ -90,6 +91,9 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
pskey := req.BossId<<8 + req.Difficulty
|
pskey := req.BossId<<8 + req.Difficulty
|
||||||
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||||
consumPs = viking.Ps[pskey]
|
consumPs = viking.Ps[pskey]
|
||||||
|
if vikingCfg.Copytype == 1 { // 买点任务体力统计
|
||||||
|
taskPs = viking.Ps[pskey]
|
||||||
|
}
|
||||||
viking.Ps[pskey] = 0 // 清空预扣体力值
|
viking.Ps[pskey] = 0 // 清空预扣体力值
|
||||||
mapData["ps"] = viking.Ps
|
mapData["ps"] = viking.Ps
|
||||||
if !bWin { // 战斗失败了 直接返回
|
if !bWin { // 战斗失败了 直接返回
|
||||||
@ -240,6 +244,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype172, 1))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype172, 1))
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype181, 1, req.BossId, req.Difficulty))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype181, 1, req.BossId, req.Difficulty))
|
||||||
}
|
}
|
||||||
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype248, taskPs))
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype237, consumPs))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype237, consumPs))
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype201, consumPs))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype201, consumPs))
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype76, 1, req.BossId))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype76, 1, req.BossId))
|
||||||
|
@ -121,29 +121,7 @@ func (this *configureComp) GetVikingRewardConf() (conf []*cfg.GameVikingRewardDa
|
|||||||
|
|
||||||
if v, err := this.GetConfigure(viking_reward); err == nil {
|
if v, err := this.GetConfigure(viking_reward); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameVikingReward); ok {
|
if configure, ok := v.(*cfg.GameVikingReward); ok {
|
||||||
szReward := configure.GetDataList()
|
conf = configure.GetDataList()
|
||||||
var (
|
|
||||||
pos int32
|
|
||||||
rankid int32
|
|
||||||
uids []string // 玩家发奖
|
|
||||||
)
|
|
||||||
for i := 0; i < 50; i++ {
|
|
||||||
rankid = int32(i) + 1 // 排名id
|
|
||||||
if szReward[pos].RankLow <= rankid && szReward[pos].RankUp >= rankid {
|
|
||||||
uids = append(uids, "1")
|
|
||||||
} else {
|
|
||||||
// this.moduleViking.mail.SendNewMail(&pb.DBMailData{
|
|
||||||
// Cid: "SeasonViking1Reward",
|
|
||||||
// Param: []string{fmt.Sprintf("%d-%d", szReward[pos].RankLow, szReward[pos].RankUp)},
|
|
||||||
// CreateTime: uint64(configure.Now().Unix()),
|
|
||||||
// Items: Items,
|
|
||||||
// }, uids...)
|
|
||||||
fmt.Printf("%v,%v", uids, szReward[pos])
|
|
||||||
uids = []string{}
|
|
||||||
pos += 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -237,44 +237,41 @@ func (this *ModelSRank) raceSettlement() {
|
|||||||
Items []*pb.UserAssets
|
Items []*pb.UserAssets
|
||||||
err error
|
err error
|
||||||
szReward []*cfg.GameVikingRewardData
|
szReward []*cfg.GameVikingRewardData
|
||||||
uids []string // 玩家发奖
|
mailCid string
|
||||||
)
|
)
|
||||||
tableName := this.TableName + "1" //strconv.Itoa(int(bossid))
|
for iBossType := 1; iBossType <= 3; iBossType++ {
|
||||||
szReward = this.moduleViking.configure.GetVikingRewardConf()
|
mailCid = fmt.Sprintf("SeasonViking%dReward", iBossType)
|
||||||
|
tableName := this.TableName + strconv.Itoa(int(iBossType))
|
||||||
|
szReward = this.moduleViking.configure.GetVikingRewardConf()
|
||||||
|
|
||||||
if result, err = this.DBModel.Redis.ZRevRange(tableName, 0, comm.MaxRankList).Result(); err != nil {
|
if result, err = this.DBModel.Redis.ZRevRange(tableName, 0, comm.MaxRankList).Result(); err != nil {
|
||||||
this.moduleViking.Errorln(err)
|
this.moduleViking.Errorln(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.moduleViking.Debugf("uid:%v", uids)
|
|
||||||
var (
|
|
||||||
pos int32
|
|
||||||
rankid int32
|
|
||||||
)
|
|
||||||
// 1-1 2-2 3-3 4-10
|
|
||||||
for i := 0; i < len(result); i++ {
|
|
||||||
|
|
||||||
rankid = int32(i) + 1 // 排名id
|
if len(result) == 0 {
|
||||||
if szReward[pos].RankLow <= rankid && szReward[pos].RankUp >= rankid {
|
continue
|
||||||
uids = append(uids, result[i])
|
}
|
||||||
} else {
|
szReward = this.moduleViking.configure.GetVikingRewardConf()
|
||||||
this.moduleViking.mail.SendNewMail(&pb.DBMailData{
|
for _, v := range szReward {
|
||||||
Cid: "SeasonViking1Reward",
|
ids := []string{} // 玩家发奖
|
||||||
Param: []string{fmt.Sprintf("%d-%d", szReward[pos].RankLow, szReward[pos].RankUp)},
|
var iEndIndex int32
|
||||||
|
if v.RankUp >= int32(len(result)) {
|
||||||
|
iEndIndex = int32(len(result))
|
||||||
|
} else {
|
||||||
|
iEndIndex = v.RankUp
|
||||||
|
}
|
||||||
|
if v.RankLow > int32(len(result)) { // 没这么多人直接返回
|
||||||
|
break
|
||||||
|
}
|
||||||
|
ids = append(result[v.RankLow-1 : iEndIndex])
|
||||||
|
|
||||||
|
this.moduleViking.mail.SendNewMail(&pb.DBMailData{ // //发邮件
|
||||||
|
Cid: mailCid,
|
||||||
|
Param: []string{fmt.Sprintf("%d-%d", v.RankLow, v.RankUp)},
|
||||||
CreateTime: uint64(configure.Now().Unix()),
|
CreateTime: uint64(configure.Now().Unix()),
|
||||||
Items: Items,
|
Items: Items,
|
||||||
}, uids...)
|
}, ids...)
|
||||||
|
|
||||||
uids = []string{}
|
|
||||||
pos += 1
|
|
||||||
}
|
}
|
||||||
// uids = append(uids, result[i])
|
|
||||||
// //发邮件
|
|
||||||
// this.moduleViking.mail.SendNewMail(&pb.DBMailData{
|
|
||||||
// Cid: "SeasonViking1Reward",
|
|
||||||
// Param: []string{fmt.Sprintf("%d-%d", szReward[i].RankLow, szReward[i].RankUp)},
|
|
||||||
// CreateTime: uint64(configure.Now().Unix()),
|
|
||||||
// Items: Items,
|
|
||||||
// }, result[i])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user