上传代码
This commit is contained in:
parent
64c2205875
commit
96088d49b7
@ -491,7 +491,6 @@ type (
|
||||
|
||||
//捕羊大赛
|
||||
IParkour interface {
|
||||
AddMounts(session IUserSession, mounts map[string]int32, bPush bool) (errdata *pb.ErrorData)
|
||||
}
|
||||
|
||||
ITools interface {
|
||||
|
@ -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(
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user