From 96088d49b747cffec5dae35072a3a7f46083932f Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 9 Oct 2023 11:56:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 +- comm/imodule.go | 1 - modules/parkour/module.go | 20 -------------------- modules/web/api_modifytime.go | 14 +++----------- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/comm/const.go b/comm/const.go index ff0dbcdb5..275fb31d9 100644 --- a/comm/const.go +++ b/comm/const.go @@ -524,7 +524,7 @@ const ( StarCoin = "starcoin" //星座币 SociatyCoin = "guildcoin" //公会币 ArenaCoin = "arenacoin" //竞技场币 - ResPs = "ps" // 体力 + ResPs = "ps" //体力 Moongold = "moongold" //纯净月髓 Talent1 = "talent1" //阵营1天赋点 Talent2 = "talent2" //阵营2天赋点 diff --git a/comm/imodule.go b/comm/imodule.go index 22f5c7170..8b762a8b4 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -491,7 +491,6 @@ type ( //捕羊大赛 IParkour interface { - AddMounts(session IUserSession, mounts map[string]int32, bPush bool) (errdata *pb.ErrorData) } ITools interface { diff --git a/modules/parkour/module.go b/modules/parkour/module.go index 9f9a99e93..b68954783 100644 --- a/modules/parkour/module.go +++ b/modules/parkour/module.go @@ -78,26 +78,6 @@ func (this *Parkour) OnInstallComp() { this.raceComp = this.RegisterComp(new(ModelRaceComp)).(*ModelRaceComp) } -// 添加坐骑资源 -func (this *Parkour) AddMounts(session comm.IUserSession, mounts map[string]int32, bPush bool) (errdata *pb.ErrorData) { - var ( - result *pb.DBParkour - err error - ) - if result, err = this.parkourComp.addUserMounts(session.GetUserId(), mounts); err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), - } - return - } - if bPush { - session.SendMsg(string(this.GetType()), "infochange", &pb.ParkourInfoChangePush{Info: result}) - } - return -} - // 匹配 func (this *Parkour) match(team *pb.DBParkour) (err error) { err = this.service.RpcCall( diff --git a/modules/web/api_modifytime.go b/modules/web/api_modifytime.go index b21403ab4..8ce636361 100644 --- a/modules/web/api_modifytime.go +++ b/modules/web/api_modifytime.go @@ -3,10 +3,10 @@ package web import ( "context" "go_dreamfactory/comm" - "go_dreamfactory/lego/sys/gin" "go_dreamfactory/lego/sys/gin/engine" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" + "go_dreamfactory/utils" "net/http" "time" ) @@ -18,23 +18,15 @@ type ModifyopentimeReq struct { //修改开服时间 func (this *Api_Comp) Modifyopentime(c *engine.Context) { - req := &ModifyopentimeReq{} - err := c.BindJSON(&req) - this.module.Debugf("CreateNotify:%+v err:%v", req, err) var ( code pb.ErrorCode msg string ) + offest := utils.ToInt32(c.PostForm("offset")) defer func() { c.JSON(http.StatusOK, &Respond{Code: code, Message: msg, Data: nil}) }() - if sign := gin.ParamSign(this.options.Key, map[string]interface{}{"offest": req.Offest}); sign != req.Sign { - this.module.Errorf("Modifyopentime SignError sgin:%s", sign) - code = pb.ErrorCode_SignError - msg = pb.GetErrorCodeMsg(code) - return - } - configure.SetOffsettime(time.Duration(req.Offest) * time.Second) + configure.SetOffsettime(time.Duration(offest) * time.Second) if err := this.module.service.RpcBroadcast( context.Background(), comm.Service_Worker,