Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
2eff495aa3
@ -137,19 +137,22 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
room.Knapsack[req.Teacher].Usenum++
|
room.Knapsack[req.Teacher].Usenum++
|
||||||
if tconfigure.Race != heroconf.Race {
|
room.Knapsack[req.Teacher].Lastusetime = configure.Now().Unix()
|
||||||
|
if tconfigure.Race != 0 && tconfigure.Race != heroconf.Race {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
Message: fmt.Sprintf("the teacher race:%d and the herorace:%d is race no can use", tconfigure.Race, heroconf.Race),
|
Message: fmt.Sprintf("the teacher race:%d and the herorace:%d is race no can use", tconfigure.Race, heroconf.Race),
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if tconfigure.Job != heroconf.Job {
|
if tconfigure.Job != 0 && tconfigure.Job != heroconf.Job {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
Message: fmt.Sprintf("the teacher job:%d and the hero job:%d is race no can use", tconfigure.Job, heroconf.Job),
|
Message: fmt.Sprintf("the teacher job:%d and the hero job:%d is race no can use", tconfigure.Job, heroconf.Job),
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if tconfigure.BanHero == hero.HeroID { //禁止使用
|
if tconfigure.BanHero == hero.HeroID { //禁止使用
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -181,7 +184,7 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !utils.IsToday(room.Knapsack[req.Prop].Lastusetime) {
|
if !utils.IsToday(room.Knapsack[req.Prop].Lastusetime) {
|
||||||
room.Knapsack[req.Teacher].Usenum = 0
|
room.Knapsack[req.Prop].Usenum = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if room.Knapsack[req.Prop].Usenum >= tconfigure.Limitation {
|
if room.Knapsack[req.Prop].Usenum >= tconfigure.Limitation {
|
||||||
@ -193,20 +196,22 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
room.Knapsack[req.Prop].Usenum++
|
room.Knapsack[req.Prop].Usenum++
|
||||||
|
room.Knapsack[req.Prop].Lastusetime = configure.Now().Unix()
|
||||||
if pconfigure.Race != heroconf.Race {
|
if pconfigure.Race != 0 && pconfigure.Race != heroconf.Race {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
Message: fmt.Sprintf("the teacher race:%d and the herorace:%d is race no can use", tconfigure.Race, heroconf.Race),
|
Message: fmt.Sprintf("the teacher race:%d and the herorace:%d is race no can use", tconfigure.Race, heroconf.Race),
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if pconfigure.Job != heroconf.Job {
|
if pconfigure.Job != 0 && pconfigure.Job != heroconf.Job {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
Message: fmt.Sprintf("the teacher job:%d and the hero job:%d is race no can use", tconfigure.Job, heroconf.Job),
|
Message: fmt.Sprintf("the teacher job:%d and the hero job:%d is race no can use", tconfigure.Job, heroconf.Job),
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
extra += int32(float64(pillarconfigure.PlacementDuration) * float64(pconfigure.Duration) / float64(1000))
|
extra += int32(float64(pillarconfigure.PlacementDuration) * float64(pconfigure.Duration) / float64(1000))
|
||||||
pillar.Prop = req.Prop
|
pillar.Prop = req.Prop
|
||||||
|
@ -58,7 +58,12 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err
|
|||||||
rsp := &pb.SmithySellResp{
|
rsp := &pb.SmithySellResp{
|
||||||
CustomerId: req.CustomerId,
|
CustomerId: req.CustomerId,
|
||||||
EquipIds: req.EquipIds,
|
EquipIds: req.EquipIds,
|
||||||
Customers: cus.Customers,
|
}
|
||||||
|
|
||||||
|
if cus != nil {
|
||||||
|
rsp.Customers = cus.Customers
|
||||||
|
} else {
|
||||||
|
rsp.Customers = []*pb.CustomerInfo{}
|
||||||
}
|
}
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), "sell", rsp)
|
session.SendMsg(string(this.module.GetType()), "sell", rsp)
|
||||||
|
@ -14,6 +14,7 @@ const (
|
|||||||
gameSociatyActivity = "game_guildactivity.json"
|
gameSociatyActivity = "game_guildactivity.json"
|
||||||
gameRdtaskCondi = "game_rdtaskcondi.json"
|
gameRdtaskCondi = "game_rdtaskcondi.json"
|
||||||
gameSociatyBossTask = "game_guildbosstask.json"
|
gameSociatyBossTask = "game_guildbosstask.json"
|
||||||
|
gameburiedCond = "game_buriedcondi.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
type configureComp struct {
|
type configureComp struct {
|
||||||
@ -29,6 +30,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
gameSociatyActivity: cfg.NewGameGuildActivity,
|
gameSociatyActivity: cfg.NewGameGuildActivity,
|
||||||
gameRdtaskCondi: cfg.NewGameRdtaskCondi,
|
gameRdtaskCondi: cfg.NewGameRdtaskCondi,
|
||||||
gameSociatyBossTask: cfg.NewGameGuildBossTask,
|
gameSociatyBossTask: cfg.NewGameGuildBossTask,
|
||||||
|
gameburiedCond: cfg.NewGameBuriedCondi,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -148,3 +150,19 @@ func (this *configureComp) getBossTaskList() []*cfg.GameGuildBossTaskData {
|
|||||||
return data.GetDataList()
|
return data.GetDataList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *configureComp) getBuriedCondCfg() (data *cfg.GameBuriedCondi, err error) {
|
||||||
|
var (
|
||||||
|
v interface{}
|
||||||
|
ok bool
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(gameburiedCond); err != nil {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
if data, ok = v.(*cfg.GameBuriedCondi); !ok {
|
||||||
|
err = fmt.Errorf("%T is *cfg.GameWorldAll", v)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -88,11 +88,32 @@ func (this *Sociaty) Start() (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err = this.checkSociatyConf(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Debug("check guild conf completed")
|
||||||
// 初始化公会BOSS赛季开始时间
|
// 初始化公会BOSS赛季开始时间
|
||||||
this.modelSociatyBoss.initSports()
|
this.modelSociatyBoss.initSports()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var errs []string
|
||||||
|
|
||||||
|
func (this *Sociaty) checkSociatyConf() (err error) {
|
||||||
|
buriedCondConf, err := this.configure.getBuriedCondCfg()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, data := range this.sociatyTaskConf.GetDataList() {
|
||||||
|
if _, ok := buriedCondConf.GetDataMap()[data.TypeId]; !ok {
|
||||||
|
errs = append(errs, fmt.Sprintf("condId:%v 可能无效,检查guild_task表字段type_id值是否存在于buried_condi", data.TypeId))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 会长弹劾处理
|
// 会长弹劾处理
|
||||||
// Deprecated
|
// Deprecated
|
||||||
func (this *Sociaty) ProcessAccuse(uid, sociatyId string) {
|
func (this *Sociaty) ProcessAccuse(uid, sociatyId string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user