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个
|
||||
Rtype246 TaskType = 246 //在一次十连内获得X个以上的Y品质的守护者 (紫色以上)
|
||||
Rtype247 TaskType = 247 //完成X品质的武馆派遣Y个
|
||||
Rtype248 TaskType = 248 //在维京表内指定类型的boss副本内,消耗X点体力
|
||||
Rtype249 TaskType = 249 //赢得X把快速接龙
|
||||
)
|
||||
const (
|
||||
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{
|
||||
Data: list,
|
||||
})
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.ModuleBuried.TriggerBuried(session, comm.GetBuriedParam(comm.Rtype249, 1))
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ type Timer struct {
|
||||
caravan *CaravanRank
|
||||
activity *Activity
|
||||
stone *StoneComp
|
||||
viking *VikingRank
|
||||
}
|
||||
|
||||
// 模块名
|
||||
@ -73,6 +74,7 @@ func (this *Timer) OnInstallComp() {
|
||||
this.caravan = this.RegisterComp(new(CaravanRank)).(*CaravanRank)
|
||||
this.activity = this.RegisterComp(new(Activity)).(*Activity)
|
||||
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 // 每周一零点
|
||||
cron.AddFunc("0 0 0 ? * MON", this.TimerSeason)
|
||||
|
||||
//this.TimerSeason()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
||||
oldDifficulty int32 // 记录通关之前的难度
|
||||
consumPs int32
|
||||
err error
|
||||
taskPs int32
|
||||
)
|
||||
changExp = make(map[string]int32, 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
|
||||
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||
consumPs = viking.Ps[pskey]
|
||||
if vikingCfg.Copytype == 1 { // 买点任务体力统计
|
||||
taskPs = viking.Ps[pskey]
|
||||
}
|
||||
viking.Ps[pskey] = 0 // 清空预扣体力值
|
||||
mapData["ps"] = viking.Ps
|
||||
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.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.Rtype201, consumPs))
|
||||
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 configure, ok := v.(*cfg.GameVikingReward); ok {
|
||||
szReward := 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
|
||||
}
|
||||
}
|
||||
|
||||
conf = configure.GetDataList()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -237,44 +237,41 @@ func (this *ModelSRank) raceSettlement() {
|
||||
Items []*pb.UserAssets
|
||||
err error
|
||||
szReward []*cfg.GameVikingRewardData
|
||||
uids []string // 玩家发奖
|
||||
mailCid string
|
||||
)
|
||||
tableName := this.TableName + "1" //strconv.Itoa(int(bossid))
|
||||
for iBossType := 1; iBossType <= 3; iBossType++ {
|
||||
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 {
|
||||
this.moduleViking.Errorln(err)
|
||||
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 szReward[pos].RankLow <= rankid && szReward[pos].RankUp >= rankid {
|
||||
uids = append(uids, result[i])
|
||||
if len(result) == 0 {
|
||||
continue
|
||||
}
|
||||
szReward = this.moduleViking.configure.GetVikingRewardConf()
|
||||
for _, v := range szReward {
|
||||
ids := []string{} // 玩家发奖
|
||||
var iEndIndex int32
|
||||
if v.RankUp >= int32(len(result)) {
|
||||
iEndIndex = int32(len(result))
|
||||
} else {
|
||||
this.moduleViking.mail.SendNewMail(&pb.DBMailData{
|
||||
Cid: "SeasonViking1Reward",
|
||||
Param: []string{fmt.Sprintf("%d-%d", szReward[pos].RankLow, szReward[pos].RankUp)},
|
||||
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()),
|
||||
Items: Items,
|
||||
}, uids...)
|
||||
|
||||
uids = []string{}
|
||||
pos += 1
|
||||
}, ids...)
|
||||
}
|
||||
// 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