上传gm命令

This commit is contained in:
liwei1dao 2023-09-06 19:02:21 +08:00
parent 146eb77f4e
commit 8e579dde24
3 changed files with 44 additions and 5 deletions

View File

@ -360,12 +360,16 @@ type (
IGetReddot IGetReddot
} }
IHunting interface { IHunting interface {
IGetReddot
CompleteAllLevel(session IUserSession) (errdata *pb.ErrorData) CompleteAllLevel(session IUserSession) (errdata *pb.ErrorData)
CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录 CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录
IGetReddot
} }
// 公会 // 公会
ISociaty interface { ISociaty interface {
// 任务条件达成通知
IBuriedUpdateNotify
// 红点
IGetReddot
GetSociaty(uid string) *pb.DBSociaty GetSociaty(uid string) *pb.DBSociaty
//查询工会信息 //查询工会信息
GetSociatys(sociatyIds []string) (result []*pb.DBSociaty, errdata *pb.ErrorData) GetSociatys(sociatyIds []string) (result []*pb.DBSociaty, errdata *pb.ErrorData)
@ -380,10 +384,8 @@ type (
BingoSetExp(session IUserSession, exp int32) error BingoSetExp(session IUserSession, exp int32) error
// 设置工会活跃度 // 设置工会活跃度
BingoSetActivity(session IUserSession, activity int32) error BingoSetActivity(session IUserSession, activity int32) error
// 任务条件达成通知 //修改公会等级
IBuriedUpdateNotify ModifySociatyLv(uid string, lv int32) (err error)
// 红点
IGetReddot
} }
//星座图 //星座图
IHoroscope interface { IHoroscope interface {

View File

@ -719,6 +719,28 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
module1.(comm.ILibrary).GMCreateFavorability(session.GetUserId()) module1.(comm.ILibrary).GMCreateFavorability(session.GetUserId())
this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]},
)
} else if len(datas) == 2 && (datas[0] == "sociatylv") {
var (
lv int
err error
)
module1, err := this.service.GetModule(comm.ModuleSociaty)
if err != nil {
return
}
lv, err = strconv.Atoi(datas[1])
if err = module1.(comm.ISociaty).ModifySociatyLv(session.GetUserId(), int32(lv)); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ExternalModule,
Title: pb.ChatType_Moonfantasy.String(),
Message: err.Error(),
}
}
this.Debug("使用bingo命令:uid = %s ", this.Debug("使用bingo命令:uid = %s ",
log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[0]}, log.Field{Key: "0", Value: datas[0]},

View File

@ -419,3 +419,18 @@ func (this *Sociaty) CreateSociaty(uid, sociatyName string) error {
func (this *Sociaty) GetSociaty(uid string) *pb.DBSociaty { func (this *Sociaty) GetSociaty(uid string) *pb.DBSociaty {
return this.modelSociaty.getUserSociaty(uid) return this.modelSociaty.getUserSociaty(uid)
} }
func (this *Sociaty) ModifySociatyLv(uid string, lv int32) (err error) {
var (
sociaty *pb.DBSociaty
)
sociaty = this.modelSociaty.getUserSociaty(uid)
if sociaty != nil {
sociaty.Lv = lv
this.modelSociaty.updateSociaty(sociaty.Id, map[string]interface{}{
"lv": lv,
})
}
err = fmt.Errorf("no fund sociaty!")
return
}