#44293 任务 【梦工场系统】 <-后端-> 【三消】 - 新增GM指令

This commit is contained in:
meixiongfeng 2024-01-22 17:18:56 +08:00
parent d8eab55292
commit 2c47ef9356
3 changed files with 33 additions and 1 deletions

View File

@ -714,7 +714,7 @@ type (
UserOffline(roomid string, uid string) (err error) UserOffline(roomid string, uid string) (err error)
//主动认输 //主动认输
AdmitDefeat(roomid string, uid string) (err error) AdmitDefeat(roomid string, uid string) (err error)
GMAddConsumeexp(session IUserSession, score int32) (errdata *pb.ErrorData)
IPayDelivery IPayDelivery
} }
IMoonlv interface { IMoonlv interface {

View File

@ -351,3 +351,22 @@ func (this *Entertainment) Delivery(session comm.IUserSession, pId int32) (errda
}) })
return return
} }
func (this *Entertainment) GMAddConsumeexp(session comm.IUserSession, score int32) (errdata *pb.ErrorData) {
var (
result *pb.DBXXLData
err error
)
if result, err = this.model.getEntertainmList(session.GetUserId()); err != nil {
return
}
result.Consumeexp = score
this.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{
"consumeexp": score,
})
return
}

View File

@ -957,6 +957,19 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er
if id, err := strconv.Atoi(datas[1]); err == nil { if id, err := strconv.Atoi(datas[1]); err == nil {
module1.(comm.IBuried).CompleteCondition(session, int32(id)) module1.(comm.IBuried).CompleteCondition(session, int32(id))
this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]},
)
}
} else if len(datas) == 2 && (datas[0] == "consumeexp") { // 完成埋点条件
module1, err := this.service.GetModule(comm.ModuleEntertainment)
if err != nil {
return
}
if id, err := strconv.Atoi(datas[1]); err == nil {
module1.(comm.IEntertainment).GMAddConsumeexp(session, int32(id))
this.Debug("使用bingo命令", this.Debug("使用bingo命令",
log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "0", Value: datas[1]}, log.Field{Key: "0", Value: datas[1]},