上传代码

This commit is contained in:
liwei 2023-07-07 18:04:47 +08:00
parent c48086f76d
commit 8515c26750
3 changed files with 25 additions and 20 deletions

View File

@ -26,7 +26,8 @@ type Options struct {
ConsulServers []string //Consul集群服务地址 ConsulServers []string //Consul集群服务地址
RpcxStartType RpcxStartType //Rpcx启动类型 RpcxStartType RpcxStartType //Rpcx启动类型
AutoConnect bool //自动连接 客户端启动模式下 主动连接发现的节点服务器 AutoConnect bool //自动连接 客户端启动模式下 主动连接发现的节点服务器
SerializeType protocol.SerializeType SerializeType protocol.SerializeType //序列化方式
OutTime int32 //超时配置 单位秒 0 无超时限制
Debug bool //日志是否开启 Debug bool //日志是否开启
Log log.ILogger Log log.ILogger
} }
@ -89,6 +90,7 @@ func newOptions(config map[string]interface{}, opts ...Option) (options *Options
options = &Options{ options = &Options{
AutoConnect: true, AutoConnect: true,
SerializeType: protocol.MsgPack, SerializeType: protocol.MsgPack,
OutTime: 5,
} }
if config != nil { if config != nil {
mapstructure.Decode(config, options) mapstructure.Decode(config, options)
@ -111,6 +113,7 @@ func newOptionsByOption(opts ...Option) (options *Options, err error) {
options = &Options{ options = &Options{
AutoConnect: true, AutoConnect: true,
SerializeType: protocol.MsgPack, SerializeType: protocol.MsgPack,
OutTime: 5,
} }
for _, o := range opts { for _, o := range opts {
o(options) o(options)

View File

@ -24,6 +24,7 @@ func newSys(options *Options) (sys ISys, err error) {
service, err = newService(options) service, err = newService(options)
client, err = newClient(options) client, err = newClient(options)
sys = &RPCX{ sys = &RPCX{
options: options,
service: service, service: service,
client: client, client: client,
} }
@ -31,6 +32,7 @@ func newSys(options *Options) (sys ISys, err error) {
} }
type RPCX struct { type RPCX struct {
options *Options
service ISys service ISys
client ISys client ISys
} }

View File

@ -209,7 +209,7 @@ func (this *ModelWorldtask) taskFinishPush(session comm.IUserSession, userTask *
this.moduleWorldtask.Debug("nextTaskIds", log.Field{Key: "nextTaskIds", Value: nextTaskIds}) this.moduleWorldtask.Debug("nextTaskIds", log.Field{Key: "nextTaskIds", Value: nextTaskIds})
nextTask := make(map[int32]*pb.Worldtasks) nextTask := make(map[int32]*pb.Worldtasks)
if len(nextTask) > 0 { if len(nextTaskIds) > 0 {
for _, next := range nextTaskIds { for _, next := range nextTaskIds {
ut := this.updateCurrentTaskCond(session.GetUserId(), u.Lv, userTask, curTaskConf.Key, next) ut := this.updateCurrentTaskCond(session.GetUserId(), u.Lv, userTask, curTaskConf.Key, next)
if ut != nil { if ut != nil {