战斗报错
This commit is contained in:
parent
5fed8e4e3d
commit
bf61a61845
@ -117,7 +117,7 @@ func (this *modelBattleComp) createpve(session comm.IUserSession, conn *db.DBCon
|
|||||||
} else {
|
} else {
|
||||||
record.Buleflist[i] = &pb.DBBattleFormt{
|
record.Buleflist[i] = &pb.DBBattleFormt{
|
||||||
Leadpos: mf.CaptainId,
|
Leadpos: mf.CaptainId,
|
||||||
Team: make([]*pb.BattleRole, len(req.Mformat)),
|
Team: make([]*pb.BattleRole, len(mf.MonsterList)),
|
||||||
}
|
}
|
||||||
for i1, v1 := range mf.MonsterList {
|
for i1, v1 := range mf.MonsterList {
|
||||||
if v1 == -1 {
|
if v1 == -1 {
|
||||||
|
@ -16,6 +16,8 @@ import (
|
|||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -49,10 +51,25 @@ func (this *SeasonPagoda) Start() (err error) {
|
|||||||
|
|
||||||
// _data := this.GetSeasonLoop(2)
|
// _data := this.GetSeasonLoop(2)
|
||||||
// this.module.Debugf("%v", _data)
|
// this.module.Debugf("%v", _data)
|
||||||
|
// for i := 0; i < 10000; i++ {
|
||||||
|
// this.CreatTestData(i)
|
||||||
|
// }
|
||||||
this.TimerSeasonOver()
|
this.TimerSeasonOver()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
func (this *SeasonPagoda) CreatTestData(index int) {
|
||||||
|
seasonPagoda := &pb.DBSeasonPagoda{}
|
||||||
|
seasonPagoda.Id = primitive.NewObjectID().Hex()
|
||||||
|
|
||||||
|
seasonPagoda.Uid = "dfmxf_634f8f28609d489230fb40fa"
|
||||||
|
seasonPagoda.PagodaId = int32(index) // 初始数据0层
|
||||||
|
seasonPagoda.Type = 201 // TODO 新的塔数据根据配置文件获取
|
||||||
|
if err := this.Add(seasonPagoda.Uid, seasonPagoda); err != nil {
|
||||||
|
this.module.Errorf("err:%v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (this *SeasonPagoda) GetSeasonLoop(id int32) *cfg.GameSeasonLoopData {
|
func (this *SeasonPagoda) GetSeasonLoop(id int32) *cfg.GameSeasonLoopData {
|
||||||
|
|
||||||
if v, err := this.GetConfigure(game_seasonloop); err != nil {
|
if v, err := this.GetConfigure(game_seasonloop); err != nil {
|
||||||
@ -101,6 +118,13 @@ func (this *SeasonPagoda) TimerSeasonOver() {
|
|||||||
|
|
||||||
this.DB.UpdateOne(comm.TableServerData, bson.M{}, serverData)
|
this.DB.UpdateOne(comm.TableServerData, bson.M{}, serverData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//star := time.Now()
|
||||||
|
this.DB.DeleteMany(comm.TableSeasonPagoda, bson.M{}, options.Delete())
|
||||||
|
//this.module.Debugf("=====%d,", time.Since(star).Milliseconds())
|
||||||
|
|
||||||
|
//清除redis
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 赛季塔开始
|
// 赛季塔开始
|
||||||
|
Loading…
Reference in New Issue
Block a user