上传开服时间修改后台接口以及关卡协议调整
This commit is contained in:
parent
aa8f1f54b5
commit
32af41680d
@ -2,6 +2,7 @@ package base
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"go_dreamfactory/lego/core"
|
||||
|
||||
@ -74,6 +75,7 @@ type IRPCXServiceSession interface {
|
||||
|
||||
type IRPCXService interface {
|
||||
IClusterServiceBase
|
||||
GetOpentime() time.Time
|
||||
RegisterFunction(fn interface{}) (err error)
|
||||
RegisterFunctionName(name string, fn interface{}) (err error)
|
||||
RpcCall(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error)
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"go_dreamfactory/lego/base"
|
||||
"go_dreamfactory/lego/core"
|
||||
@ -36,6 +37,15 @@ func (this *RPCXService) GetIp() string {
|
||||
func (this *RPCXService) GetPort() int {
|
||||
return this.opts.Setting.Port
|
||||
}
|
||||
|
||||
func (this *RPCXService) GetOpentime() time.Time {
|
||||
t, err := time.ParseInLocation("2006-01-02 15:04:05", this.GetSettings().Opentime, time.Local)
|
||||
if nil == err && !t.IsZero() {
|
||||
return t
|
||||
}
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
func (this *RPCXService) GetCategory() core.S_Category {
|
||||
return this.opts.Setting.Category
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ type ServiceSttings struct {
|
||||
Category S_Category //服务列表 (用于区分集群服务下相似业务功能的服务器 例如:游戏服务器)
|
||||
Ip string //服务所在Ip ()
|
||||
Port int //服务rpcx监听端口
|
||||
Opentime string //开服时间
|
||||
Comps map[string]map[string]interface{} //服务组件配置
|
||||
Sys map[string]map[string]interface{} //服务系统配置
|
||||
Modules map[string]map[string]interface{} //服务模块配置
|
||||
|
@ -26,10 +26,10 @@ func (this *apiComp) In(session comm.IUserSession, req *pb.CombatInReq) (code pb
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if info.Currlevel != 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
// if info.Currlevel != 0 {
|
||||
// code = pb.ErrorCode_ReqParameterError
|
||||
// return
|
||||
// }
|
||||
info.Currlevel = req.Id
|
||||
if err = this.module.modelCombat.updateInfo(info); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
|
17
modules/web/api_opentime.go
Normal file
17
modules/web/api_opentime.go
Normal file
@ -0,0 +1,17 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/sys/gin/engine"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//获取开服时间
|
||||
func (this *Api_Comp) Getopentime(c *engine.Context) {
|
||||
|
||||
c.JSON(http.StatusOK, &Respond{
|
||||
Code: 0,
|
||||
Message: "成功",
|
||||
Data: this.module.service.GetOpentime(),
|
||||
})
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user