From 32d57be1ce817fce08da975a246af1b7dad7277f Mon Sep 17 00:00:00 2001 From: flswld Date: Fri, 20 Jan 2023 00:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84docker=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + README.md | 35 +- cmd/dispatch/application.toml | 2 +- cmd/fight/application.toml | 2 +- cmd/gate/application.toml | 2 +- cmd/gm/application.toml | 2 +- cmd/gs/application.toml | 2 +- cmd/node/application.toml | 2 +- cmd/pathfinding/application.toml | 2 +- docker-compose.yaml | 147 +++++ gs/api/api.natsrpc.pb.go | 56 -- gs/api/api.pb.go | 228 ------- node/api/api.natsrpc.pb.go | 121 ---- node/api/api.pb.go | 1044 ------------------------------ pathfinding/handle/handle.go | 2 +- 15 files changed, 188 insertions(+), 1461 deletions(-) create mode 100644 docker-compose.yaml delete mode 100644 gs/api/api.natsrpc.pb.go delete mode 100644 gs/api/api.pb.go delete mode 100644 node/api/api.natsrpc.pb.go delete mode 100644 node/api/api.pb.go diff --git a/.gitignore b/.gitignore index ac98766f..ab91161e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ bin protocol/proto gate/client_proto/proto gate/client_proto/client_proto_gen.go +gs/api/*.pb.go +node/api/*.pb.go # Log file *.log diff --git a/README.md b/README.md index 60d6d03c..e6c30de3 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,39 @@ * Go >= 1.18 * Protoc >= 3.21 * Protoc Gen Go >= 1.28 +* Docker >= 20.10 +* Docker Compose >= 1.29 -> 1. 首次需要安装工具 `make dev_tool` -> 2. 生成协议 `make gen_natsrpc && make gen_proto` -> 3. 生成配置表 `make gen_csv` +## 快速启动 -## 快速运行 +* 首次需要安装工具 + +```shell +make dev_tool +``` + +* 生成协议 + +```shell +make gen_natsrpc # 生成natsrpc协议 +make gen_proto # 生成客户端协议 +make gen_client_proto # 生成客户端协议代理(非必要) +``` + +* 构建 + +```shell +make build # 构建服务器二进制文件 +make docker_build # 构建镜像 +``` + +* 启动 + +```shell +make gen_csv # 生成配置表 +# 启动前请先确保各服务器的配置文件正确 +docker-compose up -d # 启动服务器 +``` #### 第三方组件 diff --git a/cmd/dispatch/application.toml b/cmd/dispatch/application.toml index ef83cd23..90073e6c 100644 --- a/cmd/dispatch/application.toml +++ b/cmd/dispatch/application.toml @@ -2,7 +2,7 @@ http_port = 8080 [logger] level = "DEBUG" -mode = "BOTH" +mode = "CONSOLE" track = true max_size = 10485760 diff --git a/cmd/fight/application.toml b/cmd/fight/application.toml index 6b4485e4..2e572bad 100644 --- a/cmd/fight/application.toml +++ b/cmd/fight/application.toml @@ -3,7 +3,7 @@ client_proto_proxy_enable = false [logger] level = "DEBUG" -mode = "BOTH" +mode = "CONSOLE" track = true max_size = 10485760 diff --git a/cmd/gate/application.toml b/cmd/gate/application.toml index 6ea90517..3edf369a 100644 --- a/cmd/gate/application.toml +++ b/cmd/gate/application.toml @@ -8,7 +8,7 @@ gate_tcp_mq_port = 33333 [logger] level = "DEBUG" -mode = "BOTH" +mode = "CONSOLE" track = true max_size = 10485760 diff --git a/cmd/gm/application.toml b/cmd/gm/application.toml index 54f6c243..901bc94a 100644 --- a/cmd/gm/application.toml +++ b/cmd/gm/application.toml @@ -2,7 +2,7 @@ http_port = 9001 [logger] level = "DEBUG" -mode = "BOTH" +mode = "CONSOLE" track = true max_size = 10485760 diff --git a/cmd/gs/application.toml b/cmd/gs/application.toml index b98c3e4f..f4989a88 100644 --- a/cmd/gs/application.toml +++ b/cmd/gs/application.toml @@ -5,7 +5,7 @@ gacha_history_server = "https://hk4e.flswld.com/api/v1" [logger] level = "DEBUG" -mode = "BOTH" +mode = "CONSOLE" track = true max_size = 10485760 diff --git a/cmd/node/application.toml b/cmd/node/application.toml index c4df3002..1ce79624 100644 --- a/cmd/node/application.toml +++ b/cmd/node/application.toml @@ -1,6 +1,6 @@ [logger] level = "DEBUG" -mode = "BOTH" +mode = "CONSOLE" track = true max_size = 10485760 diff --git a/cmd/pathfinding/application.toml b/cmd/pathfinding/application.toml index c4df3002..1ce79624 100644 --- a/cmd/pathfinding/application.toml +++ b/cmd/pathfinding/application.toml @@ -1,6 +1,6 @@ [logger] level = "DEBUG" -mode = "BOTH" +mode = "CONSOLE" track = true max_size = 10485760 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..6b87ff77 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,147 @@ +version: '3' +services: + node_services: + restart: always + image: flswld/node:1.0.0 + container_name: node + environment: + TZ: Asia/Shanghai + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /usr/share/zoneinfo:/usr/share/zoneinfo + - ./docker/node/bin/application.toml:/node/application.toml + deploy: + resources: + limits: + cpus: '1.00' + memory: 128M + dispatch_services: + restart: always + image: flswld/dispatch:1.0.0 + container_name: dispatch + ports: + - "8080:8080/tcp" + environment: + TZ: Asia/Shanghai + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /usr/share/zoneinfo:/usr/share/zoneinfo + - ./docker/dispatch/bin/application.toml:/dispatch/application.toml + - ./docker/dispatch/bin/key:/dispatch/key + - ./docker/dispatch/bin/static:/dispatch/static + depends_on: + - node_services + deploy: + resources: + limits: + cpus: '1.00' + memory: 128M + gate_services: + restart: always + image: flswld/gate:1.0.0 + container_name: gate + ports: + - "22222:22222/udp" + - "33333:33333/tcp" + environment: + TZ: Asia/Shanghai + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /usr/share/zoneinfo:/usr/share/zoneinfo + - ./docker/gate/bin/application.toml:/gate/application.toml + - ./docker/gate/bin/key:/gate/key + - ./gate/client_proto/proto/client_cmd.csv:/gate/client_cmd.csv + depends_on: + - dispatch_services + deploy: + resources: + limits: + cpus: '4.00' + memory: 1024M + fight_services: + restart: always + image: flswld/fight:1.0.0 + container_name: fight + environment: + TZ: Asia/Shanghai + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /usr/share/zoneinfo:/usr/share/zoneinfo + - ./docker/fight/bin/application.toml:/fight/application.toml + - ./gate/client_proto/proto/client_cmd.csv:/fight/client_cmd.csv + depends_on: + - gate_services + deploy: + resources: + limits: + cpus: '1.00' + memory: 128M + pathfinding_services: + restart: always + image: flswld/pathfinding:1.0.0 + container_name: pathfinding + environment: + TZ: Asia/Shanghai + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /usr/share/zoneinfo:/usr/share/zoneinfo + - ./docker/pathfinding/bin/application.toml:/pathfinding/application.toml + depends_on: + - fight_services + deploy: + resources: + limits: + cpus: '4.00' + memory: 1024M + gs_services: + restart: always + image: flswld/gs:1.0.0 + container_name: gs + environment: + TZ: Asia/Shanghai + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /usr/share/zoneinfo:/usr/share/zoneinfo + - ./docker/gs/bin/application.toml:/gs/application.toml + - ./gdconf/game_data_config:/gs/game_data_config + - ./gate/client_proto/proto/client_cmd.csv:/gs/client_cmd.csv + depends_on: + - pathfinding_services + deploy: + resources: + limits: + cpus: '4.00' + memory: 4096M + gm_services: + restart: always + image: flswld/gm:1.0.0 + container_name: gm + ports: + - "9001:9001/tcp" + environment: + TZ: Asia/Shanghai + GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore + volumes: + - /etc/localtime:/etc/localtime + - /etc/timezone:/etc/timezone + - /usr/share/zoneinfo:/usr/share/zoneinfo + - ./docker/gm/bin/application.toml:/gm/application.toml + depends_on: + - gs_services + deploy: + resources: + limits: + cpus: '1.00' + memory: 128M diff --git a/gs/api/api.natsrpc.pb.go b/gs/api/api.natsrpc.pb.go deleted file mode 100644 index ffc14ea5..00000000 --- a/gs/api/api.natsrpc.pb.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by protoc-gen-natsrpc. DO NOT EDIT. -// versions: -// - protoc-gen-natsrpc v0.5.0 -// source: api.proto - -package api - -import ( - context "context" - fmt "fmt" - natsrpc "github.com/byebyebruce/natsrpc" - nats_go "github.com/nats-io/nats.go" - proto "google.golang.org/protobuf/proto" -) - -var _ = new(context.Context) -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = natsrpc.Version -var _ = nats_go.Version - -// GM 服务 -type GMNATSRPCServer interface { - Cmd(ctx context.Context, req *CmdRequest) (*CmdReply, error) -} - -// RegisterGMNATSRPCServer register GM service -func RegisterGMNATSRPCServer(server *natsrpc.Server, s GMNATSRPCServer, opts ...natsrpc.ServiceOption) (natsrpc.IService, error) { - return server.Register("hk4e.gs.api.GM", s, opts...) -} - -// GM 服务 -type GMNATSRPCClient interface { - Cmd(ctx context.Context, req *CmdRequest, opt ...natsrpc.CallOption) (*CmdReply, error) -} - -type _GMNATSRPCClient struct { - c *natsrpc.Client -} - -// NewGMNATSRPCClient -func NewGMNATSRPCClient(enc *nats_go.EncodedConn, opts ...natsrpc.ClientOption) (GMNATSRPCClient, error) { - c, err := natsrpc.NewClient(enc, "hk4e.gs.api.GM", opts...) - if err != nil { - return nil, err - } - ret := &_GMNATSRPCClient{ - c: c, - } - return ret, nil -} -func (c *_GMNATSRPCClient) Cmd(ctx context.Context, req *CmdRequest, opt ...natsrpc.CallOption) (*CmdReply, error) { - rep := &CmdReply{} - err := c.c.Request(ctx, "Cmd", req, rep, opt...) - return rep, err -} diff --git a/gs/api/api.pb.go b/gs/api/api.pb.go deleted file mode 100644 index 701ccee6..00000000 --- a/gs/api/api.pb.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.7.0 -// source: api.proto - -package api - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CmdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FuncName string `protobuf:"bytes,1,opt,name=func_name,json=funcName,proto3" json:"func_name,omitempty"` - Param []string `protobuf:"bytes,2,rep,name=param,proto3" json:"param,omitempty"` -} - -func (x *CmdRequest) Reset() { - *x = CmdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CmdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CmdRequest) ProtoMessage() {} - -func (x *CmdRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CmdRequest.ProtoReflect.Descriptor instead. -func (*CmdRequest) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{0} -} - -func (x *CmdRequest) GetFuncName() string { - if x != nil { - return x.FuncName - } - return "" -} - -func (x *CmdRequest) GetParam() []string { - if x != nil { - return x.Param - } - return nil -} - -type CmdReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 0 表示成功 - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *CmdReply) Reset() { - *x = CmdReply{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CmdReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CmdReply) ProtoMessage() {} - -func (x *CmdReply) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CmdReply.ProtoReflect.Descriptor instead. -func (*CmdReply) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{1} -} - -func (x *CmdReply) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *CmdReply) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -var File_api_proto protoreflect.FileDescriptor - -var file_api_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x67, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x22, 0x3f, 0x0a, 0x0a, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x22, 0x38, 0x0a, 0x08, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x33, - 0x0a, 0x02, 0x47, 0x4d, 0x12, 0x2d, 0x0a, 0x03, 0x43, 0x6d, 0x64, 0x12, 0x12, 0x2e, 0x67, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x10, 0x2e, 0x67, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6d, 0x64, 0x52, 0x65, 0x70, 0x6c, - 0x79, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f, 0x68, 0x6b, 0x34, 0x65, 0x2f, 0x67, 0x73, 0x2f, 0x61, - 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_api_proto_rawDescOnce sync.Once - file_api_proto_rawDescData = file_api_proto_rawDesc -) - -func file_api_proto_rawDescGZIP() []byte { - file_api_proto_rawDescOnce.Do(func() { - file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) - }) - return file_api_proto_rawDescData -} - -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_api_proto_goTypes = []interface{}{ - (*CmdRequest)(nil), // 0: gs.api.CmdRequest - (*CmdReply)(nil), // 1: gs.api.CmdReply -} -var file_api_proto_depIdxs = []int32{ - 0, // 0: gs.api.GM.Cmd:input_type -> gs.api.CmdRequest - 1, // 1: gs.api.GM.Cmd:output_type -> gs.api.CmdReply - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_api_proto_init() } -func file_api_proto_init() { - if File_api_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CmdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CmdReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_api_proto_goTypes, - DependencyIndexes: file_api_proto_depIdxs, - MessageInfos: file_api_proto_msgTypes, - }.Build() - File_api_proto = out.File - file_api_proto_rawDesc = nil - file_api_proto_goTypes = nil - file_api_proto_depIdxs = nil -} diff --git a/node/api/api.natsrpc.pb.go b/node/api/api.natsrpc.pb.go deleted file mode 100644 index 19c368c6..00000000 --- a/node/api/api.natsrpc.pb.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by protoc-gen-natsrpc. DO NOT EDIT. -// versions: -// - protoc-gen-natsrpc v0.5.0 -// source: api.proto - -package api - -import ( - context "context" - fmt "fmt" - natsrpc "github.com/byebyebruce/natsrpc" - nats_go "github.com/nats-io/nats.go" - proto "google.golang.org/protobuf/proto" -) - -var _ = new(context.Context) -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = natsrpc.Version -var _ = nats_go.Version - -// 节点服务器注册发现服务 -type DiscoveryNATSRPCServer interface { - // 服务器启动注册获取appid - RegisterServer(ctx context.Context, req *RegisterServerReq) (*RegisterServerRsp, error) - // 服务器关闭取消注册 - CancelServer(ctx context.Context, req *CancelServerReq) (*NullMsg, error) - // 服务器在线心跳保持 - KeepaliveServer(ctx context.Context, req *KeepaliveServerReq) (*NullMsg, error) - // 获取负载最小的服务器的appid - GetServerAppId(ctx context.Context, req *GetServerAppIdReq) (*GetServerAppIdRsp, error) - // 获取区服密钥信息 - GetRegionEc2B(ctx context.Context, req *NullMsg) (*RegionEc2B, error) - // 获取负载最小的网关服务器的地址和端口 - GetGateServerAddr(ctx context.Context, req *GetGateServerAddrReq) (*GateServerAddr, error) - // 获取全部网关服务器信息列表 - GetAllGateServerInfoList(ctx context.Context, req *NullMsg) (*GateServerInfoList, error) - // 获取主游戏服务器的appid - GetMainGameServerAppId(ctx context.Context, req *NullMsg) (*GetMainGameServerAppIdRsp, error) -} - -// RegisterDiscoveryNATSRPCServer register Discovery service -func RegisterDiscoveryNATSRPCServer(server *natsrpc.Server, s DiscoveryNATSRPCServer, opts ...natsrpc.ServiceOption) (natsrpc.IService, error) { - return server.Register("hk4e.node.api.Discovery", s, opts...) -} - -// 节点服务器注册发现服务 -type DiscoveryNATSRPCClient interface { - // 服务器启动注册获取appid - RegisterServer(ctx context.Context, req *RegisterServerReq, opt ...natsrpc.CallOption) (*RegisterServerRsp, error) - // 服务器关闭取消注册 - CancelServer(ctx context.Context, req *CancelServerReq, opt ...natsrpc.CallOption) (*NullMsg, error) - // 服务器在线心跳保持 - KeepaliveServer(ctx context.Context, req *KeepaliveServerReq, opt ...natsrpc.CallOption) (*NullMsg, error) - // 获取负载最小的服务器的appid - GetServerAppId(ctx context.Context, req *GetServerAppIdReq, opt ...natsrpc.CallOption) (*GetServerAppIdRsp, error) - // 获取区服密钥信息 - GetRegionEc2B(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*RegionEc2B, error) - // 获取负载最小的网关服务器的地址和端口 - GetGateServerAddr(ctx context.Context, req *GetGateServerAddrReq, opt ...natsrpc.CallOption) (*GateServerAddr, error) - // 获取全部网关服务器信息列表 - GetAllGateServerInfoList(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*GateServerInfoList, error) - // 获取主游戏服务器的appid - GetMainGameServerAppId(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*GetMainGameServerAppIdRsp, error) -} - -type _DiscoveryNATSRPCClient struct { - c *natsrpc.Client -} - -// NewDiscoveryNATSRPCClient -func NewDiscoveryNATSRPCClient(enc *nats_go.EncodedConn, opts ...natsrpc.ClientOption) (DiscoveryNATSRPCClient, error) { - c, err := natsrpc.NewClient(enc, "hk4e.node.api.Discovery", opts...) - if err != nil { - return nil, err - } - ret := &_DiscoveryNATSRPCClient{ - c: c, - } - return ret, nil -} -func (c *_DiscoveryNATSRPCClient) RegisterServer(ctx context.Context, req *RegisterServerReq, opt ...natsrpc.CallOption) (*RegisterServerRsp, error) { - rep := &RegisterServerRsp{} - err := c.c.Request(ctx, "RegisterServer", req, rep, opt...) - return rep, err -} -func (c *_DiscoveryNATSRPCClient) CancelServer(ctx context.Context, req *CancelServerReq, opt ...natsrpc.CallOption) (*NullMsg, error) { - rep := &NullMsg{} - err := c.c.Request(ctx, "CancelServer", req, rep, opt...) - return rep, err -} -func (c *_DiscoveryNATSRPCClient) KeepaliveServer(ctx context.Context, req *KeepaliveServerReq, opt ...natsrpc.CallOption) (*NullMsg, error) { - rep := &NullMsg{} - err := c.c.Request(ctx, "KeepaliveServer", req, rep, opt...) - return rep, err -} -func (c *_DiscoveryNATSRPCClient) GetServerAppId(ctx context.Context, req *GetServerAppIdReq, opt ...natsrpc.CallOption) (*GetServerAppIdRsp, error) { - rep := &GetServerAppIdRsp{} - err := c.c.Request(ctx, "GetServerAppId", req, rep, opt...) - return rep, err -} -func (c *_DiscoveryNATSRPCClient) GetRegionEc2B(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*RegionEc2B, error) { - rep := &RegionEc2B{} - err := c.c.Request(ctx, "GetRegionEc2B", req, rep, opt...) - return rep, err -} -func (c *_DiscoveryNATSRPCClient) GetGateServerAddr(ctx context.Context, req *GetGateServerAddrReq, opt ...natsrpc.CallOption) (*GateServerAddr, error) { - rep := &GateServerAddr{} - err := c.c.Request(ctx, "GetGateServerAddr", req, rep, opt...) - return rep, err -} -func (c *_DiscoveryNATSRPCClient) GetAllGateServerInfoList(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*GateServerInfoList, error) { - rep := &GateServerInfoList{} - err := c.c.Request(ctx, "GetAllGateServerInfoList", req, rep, opt...) - return rep, err -} -func (c *_DiscoveryNATSRPCClient) GetMainGameServerAppId(ctx context.Context, req *NullMsg, opt ...natsrpc.CallOption) (*GetMainGameServerAppIdRsp, error) { - rep := &GetMainGameServerAppIdRsp{} - err := c.c.Request(ctx, "GetMainGameServerAppId", req, rep, opt...) - return rep, err -} diff --git a/node/api/api.pb.go b/node/api/api.pb.go deleted file mode 100644 index d846491f..00000000 --- a/node/api/api.pb.go +++ /dev/null @@ -1,1044 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc v3.7.0 -// source: api.proto - -package api - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type NullMsg struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NullMsg) Reset() { - *x = NullMsg{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NullMsg) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NullMsg) ProtoMessage() {} - -func (x *NullMsg) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NullMsg.ProtoReflect.Descriptor instead. -func (*NullMsg) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{0} -} - -type GetServerAppIdReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerType string `protobuf:"bytes,1,opt,name=server_type,json=serverType,proto3" json:"server_type,omitempty"` -} - -func (x *GetServerAppIdReq) Reset() { - *x = GetServerAppIdReq{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetServerAppIdReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetServerAppIdReq) ProtoMessage() {} - -func (x *GetServerAppIdReq) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetServerAppIdReq.ProtoReflect.Descriptor instead. -func (*GetServerAppIdReq) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{1} -} - -func (x *GetServerAppIdReq) GetServerType() string { - if x != nil { - return x.ServerType - } - return "" -} - -type GetServerAppIdRsp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *GetServerAppIdRsp) Reset() { - *x = GetServerAppIdRsp{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetServerAppIdRsp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetServerAppIdRsp) ProtoMessage() {} - -func (x *GetServerAppIdRsp) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetServerAppIdRsp.ProtoReflect.Descriptor instead. -func (*GetServerAppIdRsp) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{2} -} - -func (x *GetServerAppIdRsp) GetAppId() string { - if x != nil { - return x.AppId - } - return "" -} - -type RegisterServerReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerType string `protobuf:"bytes,1,opt,name=server_type,json=serverType,proto3" json:"server_type,omitempty"` - GateServerAddr *GateServerAddr `protobuf:"bytes,2,opt,name=gate_server_addr,json=gateServerAddr,proto3" json:"gate_server_addr,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *RegisterServerReq) Reset() { - *x = RegisterServerReq{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterServerReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterServerReq) ProtoMessage() {} - -func (x *RegisterServerReq) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterServerReq.ProtoReflect.Descriptor instead. -func (*RegisterServerReq) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{3} -} - -func (x *RegisterServerReq) GetServerType() string { - if x != nil { - return x.ServerType - } - return "" -} - -func (x *RegisterServerReq) GetGateServerAddr() *GateServerAddr { - if x != nil { - return x.GateServerAddr - } - return nil -} - -func (x *RegisterServerReq) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type RegisterServerRsp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - GsId uint32 `protobuf:"varint,2,opt,name=gs_id,json=gsId,proto3" json:"gs_id,omitempty"` -} - -func (x *RegisterServerRsp) Reset() { - *x = RegisterServerRsp{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterServerRsp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterServerRsp) ProtoMessage() {} - -func (x *RegisterServerRsp) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterServerRsp.ProtoReflect.Descriptor instead. -func (*RegisterServerRsp) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{4} -} - -func (x *RegisterServerRsp) GetAppId() string { - if x != nil { - return x.AppId - } - return "" -} - -func (x *RegisterServerRsp) GetGsId() uint32 { - if x != nil { - return x.GsId - } - return 0 -} - -type CancelServerReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerType string `protobuf:"bytes,1,opt,name=server_type,json=serverType,proto3" json:"server_type,omitempty"` - AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *CancelServerReq) Reset() { - *x = CancelServerReq{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CancelServerReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CancelServerReq) ProtoMessage() {} - -func (x *CancelServerReq) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CancelServerReq.ProtoReflect.Descriptor instead. -func (*CancelServerReq) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{5} -} - -func (x *CancelServerReq) GetServerType() string { - if x != nil { - return x.ServerType - } - return "" -} - -func (x *CancelServerReq) GetAppId() string { - if x != nil { - return x.AppId - } - return "" -} - -type KeepaliveServerReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ServerType string `protobuf:"bytes,1,opt,name=server_type,json=serverType,proto3" json:"server_type,omitempty"` - AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *KeepaliveServerReq) Reset() { - *x = KeepaliveServerReq{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeepaliveServerReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeepaliveServerReq) ProtoMessage() {} - -func (x *KeepaliveServerReq) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KeepaliveServerReq.ProtoReflect.Descriptor instead. -func (*KeepaliveServerReq) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{6} -} - -func (x *KeepaliveServerReq) GetServerType() string { - if x != nil { - return x.ServerType - } - return "" -} - -func (x *KeepaliveServerReq) GetAppId() string { - if x != nil { - return x.AppId - } - return "" -} - -type GetGateServerAddrReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetGateServerAddrReq) Reset() { - *x = GetGateServerAddrReq{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGateServerAddrReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGateServerAddrReq) ProtoMessage() {} - -func (x *GetGateServerAddrReq) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGateServerAddrReq.ProtoReflect.Descriptor instead. -func (*GetGateServerAddrReq) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{7} -} - -func (x *GetGateServerAddrReq) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type GetMainGameServerAppIdRsp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *GetMainGameServerAppIdRsp) Reset() { - *x = GetMainGameServerAppIdRsp{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetMainGameServerAppIdRsp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMainGameServerAppIdRsp) ProtoMessage() {} - -func (x *GetMainGameServerAppIdRsp) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetMainGameServerAppIdRsp.ProtoReflect.Descriptor instead. -func (*GetMainGameServerAppIdRsp) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{8} -} - -func (x *GetMainGameServerAppIdRsp) GetAppId() string { - if x != nil { - return x.AppId - } - return "" -} - -type RegionEc2B struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *RegionEc2B) Reset() { - *x = RegionEc2B{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegionEc2B) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegionEc2B) ProtoMessage() {} - -func (x *RegionEc2B) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegionEc2B.ProtoReflect.Descriptor instead. -func (*RegionEc2B) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{9} -} - -func (x *RegionEc2B) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type GateServerAddr struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - KcpAddr string `protobuf:"bytes,1,opt,name=kcp_addr,json=kcpAddr,proto3" json:"kcp_addr,omitempty"` - KcpPort uint32 `protobuf:"varint,2,opt,name=kcp_port,json=kcpPort,proto3" json:"kcp_port,omitempty"` - MqAddr string `protobuf:"bytes,3,opt,name=mq_addr,json=mqAddr,proto3" json:"mq_addr,omitempty"` - MqPort uint32 `protobuf:"varint,4,opt,name=mq_port,json=mqPort,proto3" json:"mq_port,omitempty"` -} - -func (x *GateServerAddr) Reset() { - *x = GateServerAddr{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GateServerAddr) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GateServerAddr) ProtoMessage() {} - -func (x *GateServerAddr) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GateServerAddr.ProtoReflect.Descriptor instead. -func (*GateServerAddr) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{10} -} - -func (x *GateServerAddr) GetKcpAddr() string { - if x != nil { - return x.KcpAddr - } - return "" -} - -func (x *GateServerAddr) GetKcpPort() uint32 { - if x != nil { - return x.KcpPort - } - return 0 -} - -func (x *GateServerAddr) GetMqAddr() string { - if x != nil { - return x.MqAddr - } - return "" -} - -func (x *GateServerAddr) GetMqPort() uint32 { - if x != nil { - return x.MqPort - } - return 0 -} - -type GateServerInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` - MqAddr string `protobuf:"bytes,2,opt,name=mq_addr,json=mqAddr,proto3" json:"mq_addr,omitempty"` - MqPort uint32 `protobuf:"varint,3,opt,name=mq_port,json=mqPort,proto3" json:"mq_port,omitempty"` -} - -func (x *GateServerInfo) Reset() { - *x = GateServerInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GateServerInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GateServerInfo) ProtoMessage() {} - -func (x *GateServerInfo) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GateServerInfo.ProtoReflect.Descriptor instead. -func (*GateServerInfo) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{11} -} - -func (x *GateServerInfo) GetAppId() string { - if x != nil { - return x.AppId - } - return "" -} - -func (x *GateServerInfo) GetMqAddr() string { - if x != nil { - return x.MqAddr - } - return "" -} - -func (x *GateServerInfo) GetMqPort() uint32 { - if x != nil { - return x.MqPort - } - return 0 -} - -type GateServerInfoList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GateServerInfoList []*GateServerInfo `protobuf:"bytes,1,rep,name=gate_server_info_list,json=gateServerInfoList,proto3" json:"gate_server_info_list,omitempty"` -} - -func (x *GateServerInfoList) Reset() { - *x = GateServerInfoList{} - if protoimpl.UnsafeEnabled { - mi := &file_api_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GateServerInfoList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GateServerInfoList) ProtoMessage() {} - -func (x *GateServerInfoList) ProtoReflect() protoreflect.Message { - mi := &file_api_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GateServerInfoList.ProtoReflect.Descriptor instead. -func (*GateServerInfoList) Descriptor() ([]byte, []int) { - return file_api_proto_rawDescGZIP(), []int{12} -} - -func (x *GateServerInfoList) GetGateServerInfoList() []*GateServerInfo { - if x != nil { - return x.GateServerInfoList - } - return nil -} - -var File_api_proto protoreflect.FileDescriptor - -var file_api_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x22, 0x09, 0x0a, 0x07, 0x4e, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, - 0x22, 0x34, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, - 0x49, 0x64, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2a, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x49, 0x64, 0x52, 0x73, 0x70, 0x12, 0x15, 0x0a, 0x06, 0x61, - 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, - 0x49, 0x64, 0x22, 0x92, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x10, 0x67, 0x61, 0x74, - 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x52, 0x0e, 0x67, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3f, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x73, 0x70, 0x12, 0x15, 0x0a, 0x06, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x67, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x04, 0x67, 0x73, 0x49, 0x64, 0x22, 0x49, 0x0a, 0x0f, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, - 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, - 0x70, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x12, 0x4b, 0x65, 0x65, 0x70, 0x61, 0x6c, 0x69, 0x76, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, - 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, - 0x64, 0x22, 0x30, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x47, 0x61, - 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x49, 0x64, 0x52, 0x73, 0x70, - 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x20, 0x0a, 0x0a, 0x52, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x45, 0x63, 0x32, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x78, 0x0a, 0x0e, 0x47, 0x61, 0x74, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6b, - 0x63, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, - 0x63, 0x70, 0x41, 0x64, 0x64, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x63, 0x70, 0x5f, 0x70, 0x6f, - 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x6b, 0x63, 0x70, 0x50, 0x6f, 0x72, - 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x71, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x6d, 0x71, 0x41, 0x64, 0x64, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x71, - 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x71, 0x50, - 0x6f, 0x72, 0x74, 0x22, 0x59, 0x0a, 0x0e, 0x47, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, - 0x6d, 0x71, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, - 0x71, 0x41, 0x64, 0x64, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x71, 0x5f, 0x70, 0x6f, 0x72, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6d, 0x71, 0x50, 0x6f, 0x72, 0x74, 0x22, 0x61, - 0x0a, 0x12, 0x47, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x15, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x12, 0x67, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, - 0x74, 0x32, 0xdd, 0x04, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, - 0x4c, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x1b, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1b, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3e, 0x0a, - 0x0c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x19, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x22, 0x00, 0x12, 0x44, 0x0a, - 0x0f, 0x4b, 0x65, 0x65, 0x70, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x12, 0x1c, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4b, 0x65, 0x65, 0x70, - 0x61, 0x6c, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x11, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x4d, 0x73, - 0x67, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x41, 0x70, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x49, 0x64, 0x52, - 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x49, 0x64, 0x52, 0x73, 0x70, 0x22, - 0x00, 0x12, 0x3a, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x45, 0x63, - 0x32, 0x62, 0x12, 0x11, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x75, - 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x1a, 0x14, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x45, 0x63, 0x32, 0x62, 0x22, 0x00, 0x12, 0x4f, 0x0a, - 0x11, 0x47, 0x65, 0x74, 0x47, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x12, 0x1e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x47, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x52, - 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x61, - 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x22, 0x00, 0x12, 0x4d, - 0x0a, 0x18, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x47, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x1a, 0x1c, 0x2e, - 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x52, 0x0a, - 0x16, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x41, 0x70, 0x70, 0x49, 0x64, 0x12, 0x11, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x1a, 0x23, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x69, 0x6e, 0x47, 0x61, 0x6d, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x49, 0x64, 0x52, 0x73, 0x70, 0x22, - 0x00, 0x42, 0x13, 0x5a, 0x11, 0x68, 0x6b, 0x34, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_api_proto_rawDescOnce sync.Once - file_api_proto_rawDescData = file_api_proto_rawDesc -) - -func file_api_proto_rawDescGZIP() []byte { - file_api_proto_rawDescOnce.Do(func() { - file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) - }) - return file_api_proto_rawDescData -} - -var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_api_proto_goTypes = []interface{}{ - (*NullMsg)(nil), // 0: node.api.NullMsg - (*GetServerAppIdReq)(nil), // 1: node.api.GetServerAppIdReq - (*GetServerAppIdRsp)(nil), // 2: node.api.GetServerAppIdRsp - (*RegisterServerReq)(nil), // 3: node.api.RegisterServerReq - (*RegisterServerRsp)(nil), // 4: node.api.RegisterServerRsp - (*CancelServerReq)(nil), // 5: node.api.CancelServerReq - (*KeepaliveServerReq)(nil), // 6: node.api.KeepaliveServerReq - (*GetGateServerAddrReq)(nil), // 7: node.api.GetGateServerAddrReq - (*GetMainGameServerAppIdRsp)(nil), // 8: node.api.GetMainGameServerAppIdRsp - (*RegionEc2B)(nil), // 9: node.api.RegionEc2b - (*GateServerAddr)(nil), // 10: node.api.GateServerAddr - (*GateServerInfo)(nil), // 11: node.api.GateServerInfo - (*GateServerInfoList)(nil), // 12: node.api.GateServerInfoList -} -var file_api_proto_depIdxs = []int32{ - 10, // 0: node.api.RegisterServerReq.gate_server_addr:type_name -> node.api.GateServerAddr - 11, // 1: node.api.GateServerInfoList.gate_server_info_list:type_name -> node.api.GateServerInfo - 3, // 2: node.api.Discovery.RegisterServer:input_type -> node.api.RegisterServerReq - 5, // 3: node.api.Discovery.CancelServer:input_type -> node.api.CancelServerReq - 6, // 4: node.api.Discovery.KeepaliveServer:input_type -> node.api.KeepaliveServerReq - 1, // 5: node.api.Discovery.GetServerAppId:input_type -> node.api.GetServerAppIdReq - 0, // 6: node.api.Discovery.GetRegionEc2b:input_type -> node.api.NullMsg - 7, // 7: node.api.Discovery.GetGateServerAddr:input_type -> node.api.GetGateServerAddrReq - 0, // 8: node.api.Discovery.GetAllGateServerInfoList:input_type -> node.api.NullMsg - 0, // 9: node.api.Discovery.GetMainGameServerAppId:input_type -> node.api.NullMsg - 4, // 10: node.api.Discovery.RegisterServer:output_type -> node.api.RegisterServerRsp - 0, // 11: node.api.Discovery.CancelServer:output_type -> node.api.NullMsg - 0, // 12: node.api.Discovery.KeepaliveServer:output_type -> node.api.NullMsg - 2, // 13: node.api.Discovery.GetServerAppId:output_type -> node.api.GetServerAppIdRsp - 9, // 14: node.api.Discovery.GetRegionEc2b:output_type -> node.api.RegionEc2b - 10, // 15: node.api.Discovery.GetGateServerAddr:output_type -> node.api.GateServerAddr - 12, // 16: node.api.Discovery.GetAllGateServerInfoList:output_type -> node.api.GateServerInfoList - 8, // 17: node.api.Discovery.GetMainGameServerAppId:output_type -> node.api.GetMainGameServerAppIdRsp - 10, // [10:18] is the sub-list for method output_type - 2, // [2:10] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_api_proto_init() } -func file_api_proto_init() { - if File_api_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NullMsg); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetServerAppIdReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetServerAppIdRsp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterServerReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterServerRsp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CancelServerReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeepaliveServerReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGateServerAddrReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMainGameServerAppIdRsp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegionEc2B); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GateServerAddr); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GateServerInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GateServerInfoList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_api_proto_rawDesc, - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_api_proto_goTypes, - DependencyIndexes: file_api_proto_depIdxs, - MessageInfos: file_api_proto_msgTypes, - }.Build() - File_api_proto = out.File - file_api_proto_rawDesc = nil - file_api_proto_goTypes = nil - file_api_proto_depIdxs = nil -} diff --git a/pathfinding/handle/handle.go b/pathfinding/handle/handle.go index 9deb2ea5..0b36a9f4 100644 --- a/pathfinding/handle/handle.go +++ b/pathfinding/handle/handle.go @@ -25,7 +25,7 @@ func NewHandle(messageQueue *mq.MessageQueue) (r *Handle) { } func (h *Handle) run() { - for i := 0; i < 4; i++ { + for i := 0; i < 1; i++ { go func() { for { netMsg := <-h.messageQueue.GetNetMsg()