上传代码
This commit is contained in:
parent
64c2205875
commit
96088d49b7
@ -524,7 +524,7 @@ const (
|
|||||||
StarCoin = "starcoin" //星座币
|
StarCoin = "starcoin" //星座币
|
||||||
SociatyCoin = "guildcoin" //公会币
|
SociatyCoin = "guildcoin" //公会币
|
||||||
ArenaCoin = "arenacoin" //竞技场币
|
ArenaCoin = "arenacoin" //竞技场币
|
||||||
ResPs = "ps" // 体力
|
ResPs = "ps" //体力
|
||||||
Moongold = "moongold" //纯净月髓
|
Moongold = "moongold" //纯净月髓
|
||||||
Talent1 = "talent1" //阵营1天赋点
|
Talent1 = "talent1" //阵营1天赋点
|
||||||
Talent2 = "talent2" //阵营2天赋点
|
Talent2 = "talent2" //阵营2天赋点
|
||||||
|
@ -491,7 +491,6 @@ type (
|
|||||||
|
|
||||||
//捕羊大赛
|
//捕羊大赛
|
||||||
IParkour interface {
|
IParkour interface {
|
||||||
AddMounts(session IUserSession, mounts map[string]int32, bPush bool) (errdata *pb.ErrorData)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ITools interface {
|
ITools interface {
|
||||||
|
@ -78,26 +78,6 @@ func (this *Parkour) OnInstallComp() {
|
|||||||
this.raceComp = this.RegisterComp(new(ModelRaceComp)).(*ModelRaceComp)
|
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) {
|
func (this *Parkour) match(team *pb.DBParkour) (err error) {
|
||||||
err = this.service.RpcCall(
|
err = this.service.RpcCall(
|
||||||
|
@ -3,10 +3,10 @@ package web
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/sys/gin"
|
|
||||||
"go_dreamfactory/lego/sys/gin/engine"
|
"go_dreamfactory/lego/sys/gin/engine"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
|
"go_dreamfactory/utils"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -18,23 +18,15 @@ type ModifyopentimeReq struct {
|
|||||||
|
|
||||||
//修改开服时间
|
//修改开服时间
|
||||||
func (this *Api_Comp) Modifyopentime(c *engine.Context) {
|
func (this *Api_Comp) Modifyopentime(c *engine.Context) {
|
||||||
req := &ModifyopentimeReq{}
|
|
||||||
err := c.BindJSON(&req)
|
|
||||||
this.module.Debugf("CreateNotify:%+v err:%v", req, err)
|
|
||||||
var (
|
var (
|
||||||
code pb.ErrorCode
|
code pb.ErrorCode
|
||||||
msg string
|
msg string
|
||||||
)
|
)
|
||||||
|
offest := utils.ToInt32(c.PostForm("offset"))
|
||||||
defer func() {
|
defer func() {
|
||||||
c.JSON(http.StatusOK, &Respond{Code: code, Message: msg, Data: nil})
|
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 {
|
configure.SetOffsettime(time.Duration(offest) * time.Second)
|
||||||
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)
|
|
||||||
if err := this.module.service.RpcBroadcast(
|
if err := this.module.service.RpcBroadcast(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
comm.Service_Worker,
|
comm.Service_Worker,
|
||||||
|
Loading…
Reference in New Issue
Block a user