升级protoc
This commit is contained in:
parent
3804afa03b
commit
25b48cb708
Binary file not shown.
|
@ -33,7 +33,7 @@ syntax = "proto3";
|
|||
package google.protobuf;
|
||||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option go_package = "github.com/golang/protobuf/ptypes/any";
|
||||
option go_package = "google.golang.org/protobuf/types/known/anypb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "AnyProto";
|
||||
option java_multiple_files = true;
|
||||
|
@ -77,10 +77,13 @@ option objc_class_prefix = "GPB";
|
|||
// Example 4: Pack and unpack a message in Go
|
||||
//
|
||||
// foo := &pb.Foo{...}
|
||||
// any, err := ptypes.MarshalAny(foo)
|
||||
// any, err := anypb.New(foo)
|
||||
// if err != nil {
|
||||
// ...
|
||||
// }
|
||||
// ...
|
||||
// foo := &pb.Foo{}
|
||||
// if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
||||
// if err := any.UnmarshalTo(foo); err != nil {
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
|
@ -120,17 +123,19 @@ option objc_class_prefix = "GPB";
|
|||
// }
|
||||
//
|
||||
message Any {
|
||||
// A URL/resource name whose content describes the type of the
|
||||
// serialized protocol buffer message.
|
||||
// A URL/resource name that uniquely identifies the type of the serialized
|
||||
// protocol buffer message. This string must contain at least
|
||||
// one "/" character. The last segment of the URL's path must represent
|
||||
// the fully qualified name of the type (as in
|
||||
// `path/google.protobuf.Duration`). The name should be in a canonical form
|
||||
// (e.g., leading "." is not accepted).
|
||||
//
|
||||
// For URLs which use the scheme `http`, `https`, or no scheme, the
|
||||
// following restrictions and interpretations apply:
|
||||
// In practice, teams usually precompile into the binary all types that they
|
||||
// expect it to use in the context of Any. However, for URLs which use the
|
||||
// scheme `http`, `https`, or no scheme, one can optionally set up a type
|
||||
// server that maps type URLs to message definitions as follows:
|
||||
//
|
||||
// * If no scheme is provided, `https` is assumed.
|
||||
// * The last segment of the URL's path must represent the fully
|
||||
// qualified name of the type (as in `path/google.protobuf.Duration`).
|
||||
// The name should be in a canonical form (e.g., leading "." is
|
||||
// not accepted).
|
||||
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
|
||||
// value in binary format, or produce an error.
|
||||
// * Applications are allowed to cache lookup results based on the
|
||||
|
@ -139,6 +144,10 @@ message Any {
|
|||
// on changes to types. (Use versioned type names to manage
|
||||
// breaking changes.)
|
||||
//
|
||||
// Note: this functionality is not currently available in the official
|
||||
// protobuf release, and it is not used for type URLs beginning with
|
||||
// type.googleapis.com.
|
||||
//
|
||||
// Schemes other than `http`, `https` (or the empty scheme) might be
|
||||
// used with implementation specific semantics.
|
||||
//
|
|
@ -40,7 +40,7 @@ option java_package = "com.google.protobuf";
|
|||
option java_outer_classname = "ApiProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option go_package = "google.golang.org/genproto/protobuf/api;api";
|
||||
option go_package = "google.golang.org/protobuf/types/known/apipb";
|
||||
|
||||
// Api is a light-weight descriptor for an API Interface.
|
||||
//
|
||||
|
@ -52,7 +52,6 @@ option go_package = "google.golang.org/genproto/protobuf/api;api";
|
|||
// this message itself. See https://cloud.google.com/apis/design/glossary for
|
||||
// detailed terminology.
|
||||
message Api {
|
||||
|
||||
// The fully qualified name of this interface, including package name
|
||||
// followed by the interface's simple name.
|
||||
string name = 1;
|
||||
|
@ -99,7 +98,6 @@ message Api {
|
|||
|
||||
// Method represents a method of an API interface.
|
||||
message Method {
|
||||
|
||||
// The simple name of this method.
|
||||
string name = 1;
|
||||
|
||||
|
@ -169,7 +167,7 @@ message Method {
|
|||
// The mixin construct implies that all methods in `AccessControl` are
|
||||
// also declared with same name and request/response types in
|
||||
// `Storage`. A documentation generator or annotation processor will
|
||||
// see the effective `Storage.GetAcl` method after inherting
|
||||
// see the effective `Storage.GetAcl` method after inheriting
|
||||
// documentation and annotations as follows:
|
||||
//
|
||||
// service Storage {
|
|
@ -45,11 +45,12 @@
|
|||
// flag "--${NAME}_out" is passed to protoc.
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
package google.protobuf.compiler;
|
||||
option java_package = "com.google.protobuf.compiler";
|
||||
option java_outer_classname = "PluginProtos";
|
||||
|
||||
option go_package = "github.com/golang/protobuf/protoc-gen-go/plugin;plugin_go";
|
||||
option go_package = "google.golang.org/protobuf/types/pluginpb";
|
||||
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
|
@ -106,6 +107,16 @@ message CodeGeneratorResponse {
|
|||
// exiting with a non-zero status code.
|
||||
optional string error = 1;
|
||||
|
||||
// A bitmask of supported features that the code generator supports.
|
||||
// This is a bitwise "or" of values from the Feature enum.
|
||||
optional uint64 supported_features = 2;
|
||||
|
||||
// Sync with code_generator.h.
|
||||
enum Feature {
|
||||
FEATURE_NONE = 0;
|
||||
FEATURE_PROTO3_OPTIONAL = 1;
|
||||
}
|
||||
|
||||
// Represents a single generated file.
|
||||
message File {
|
||||
// The file name, relative to the output directory. The name must not
|
||||
|
@ -162,6 +173,11 @@ message CodeGeneratorResponse {
|
|||
|
||||
// The file contents.
|
||||
optional string content = 15;
|
||||
|
||||
// Information describing the file content being inserted. If an insertion
|
||||
// point is used, this information will be appropriately offset and inserted
|
||||
// into the code generation metadata for the generated files.
|
||||
optional GeneratedCodeInfo generated_code_info = 16;
|
||||
}
|
||||
repeated File file = 15;
|
||||
}
|
|
@ -40,7 +40,8 @@
|
|||
syntax = "proto2";
|
||||
|
||||
package google.protobuf;
|
||||
option go_package = "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor";
|
||||
|
||||
option go_package = "google.golang.org/protobuf/types/descriptorpb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "DescriptorProtos";
|
||||
option csharp_namespace = "Google.Protobuf.Reflection";
|
||||
|
@ -59,8 +60,8 @@ message FileDescriptorSet {
|
|||
|
||||
// Describes a complete .proto file.
|
||||
message FileDescriptorProto {
|
||||
optional string name = 1; // file name, relative to root of source tree
|
||||
optional string package = 2; // e.g. "foo", "foo.bar", etc.
|
||||
optional string name = 1; // file name, relative to root of source tree
|
||||
optional string package = 2; // e.g. "foo", "foo.bar", etc.
|
||||
|
||||
// Names of files imported by this file.
|
||||
repeated string dependency = 3;
|
||||
|
@ -100,8 +101,8 @@ message DescriptorProto {
|
|||
repeated EnumDescriptorProto enum_type = 4;
|
||||
|
||||
message ExtensionRange {
|
||||
optional int32 start = 1;
|
||||
optional int32 end = 2;
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Exclusive.
|
||||
|
||||
optional ExtensionRangeOptions options = 3;
|
||||
}
|
||||
|
@ -115,8 +116,8 @@ message DescriptorProto {
|
|||
// fields or extension ranges in the same message. Reserved ranges may
|
||||
// not overlap.
|
||||
message ReservedRange {
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Exclusive.
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Exclusive.
|
||||
}
|
||||
repeated ReservedRange reserved_range = 9;
|
||||
// Reserved field names, which may not be used by fields in the same message.
|
||||
|
@ -128,6 +129,7 @@ message ExtensionRangeOptions {
|
|||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
|
||||
// Clients can define custom options in extensions of this message. See above.
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
@ -137,42 +139,42 @@ message FieldDescriptorProto {
|
|||
enum Type {
|
||||
// 0 is reserved for errors.
|
||||
// Order is weird for historical reasons.
|
||||
TYPE_DOUBLE = 1;
|
||||
TYPE_FLOAT = 2;
|
||||
TYPE_DOUBLE = 1;
|
||||
TYPE_FLOAT = 2;
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
|
||||
// negative values are likely.
|
||||
TYPE_INT64 = 3;
|
||||
TYPE_UINT64 = 4;
|
||||
TYPE_INT64 = 3;
|
||||
TYPE_UINT64 = 4;
|
||||
// Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
|
||||
// negative values are likely.
|
||||
TYPE_INT32 = 5;
|
||||
TYPE_FIXED64 = 6;
|
||||
TYPE_FIXED32 = 7;
|
||||
TYPE_BOOL = 8;
|
||||
TYPE_STRING = 9;
|
||||
TYPE_INT32 = 5;
|
||||
TYPE_FIXED64 = 6;
|
||||
TYPE_FIXED32 = 7;
|
||||
TYPE_BOOL = 8;
|
||||
TYPE_STRING = 9;
|
||||
// Tag-delimited aggregate.
|
||||
// Group type is deprecated and not supported in proto3. However, Proto3
|
||||
// implementations should still be able to parse the group wire format and
|
||||
// treat group fields as unknown fields.
|
||||
TYPE_GROUP = 10;
|
||||
TYPE_MESSAGE = 11; // Length-delimited aggregate.
|
||||
TYPE_GROUP = 10;
|
||||
TYPE_MESSAGE = 11; // Length-delimited aggregate.
|
||||
|
||||
// New in version 2.
|
||||
TYPE_BYTES = 12;
|
||||
TYPE_UINT32 = 13;
|
||||
TYPE_ENUM = 14;
|
||||
TYPE_SFIXED32 = 15;
|
||||
TYPE_SFIXED64 = 16;
|
||||
TYPE_SINT32 = 17; // Uses ZigZag encoding.
|
||||
TYPE_SINT64 = 18; // Uses ZigZag encoding.
|
||||
};
|
||||
TYPE_BYTES = 12;
|
||||
TYPE_UINT32 = 13;
|
||||
TYPE_ENUM = 14;
|
||||
TYPE_SFIXED32 = 15;
|
||||
TYPE_SFIXED64 = 16;
|
||||
TYPE_SINT32 = 17; // Uses ZigZag encoding.
|
||||
TYPE_SINT64 = 18; // Uses ZigZag encoding.
|
||||
}
|
||||
|
||||
enum Label {
|
||||
// 0 is reserved for errors
|
||||
LABEL_OPTIONAL = 1;
|
||||
LABEL_REQUIRED = 2;
|
||||
LABEL_REPEATED = 3;
|
||||
};
|
||||
LABEL_OPTIONAL = 1;
|
||||
LABEL_REQUIRED = 2;
|
||||
LABEL_REPEATED = 3;
|
||||
}
|
||||
|
||||
optional string name = 1;
|
||||
optional int32 number = 3;
|
||||
|
@ -211,6 +213,29 @@ message FieldDescriptorProto {
|
|||
optional string json_name = 10;
|
||||
|
||||
optional FieldOptions options = 8;
|
||||
|
||||
// If true, this is a proto3 "optional". When a proto3 field is optional, it
|
||||
// tracks presence regardless of field type.
|
||||
//
|
||||
// When proto3_optional is true, this field must be belong to a oneof to
|
||||
// signal to old proto3 clients that presence is tracked for this field. This
|
||||
// oneof is known as a "synthetic" oneof, and this field must be its sole
|
||||
// member (each proto3 optional field gets its own synthetic oneof). Synthetic
|
||||
// oneofs exist in the descriptor only, and do not generate any API. Synthetic
|
||||
// oneofs must be ordered after all "real" oneofs.
|
||||
//
|
||||
// For message fields, proto3_optional doesn't create any semantic change,
|
||||
// since non-repeated message fields always track presence. However it still
|
||||
// indicates the semantic detail of whether the user wrote "optional" or not.
|
||||
// This can be useful for round-tripping the .proto file. For consistency we
|
||||
// give message fields a synthetic oneof also, even though it is not required
|
||||
// to track presence. This is especially important because the parser can't
|
||||
// tell if a field is a message or an enum, so it must always create a
|
||||
// synthetic oneof.
|
||||
//
|
||||
// Proto2 optional fields do not set this flag, because they already indicate
|
||||
// optional with `LABEL_OPTIONAL`.
|
||||
optional bool proto3_optional = 17;
|
||||
}
|
||||
|
||||
// Describes a oneof.
|
||||
|
@ -234,8 +259,8 @@ message EnumDescriptorProto {
|
|||
// is inclusive such that it can appropriately represent the entire int32
|
||||
// domain.
|
||||
message EnumReservedRange {
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Inclusive.
|
||||
optional int32 start = 1; // Inclusive.
|
||||
optional int32 end = 2; // Inclusive.
|
||||
}
|
||||
|
||||
// Range of reserved numeric values. Reserved numeric values may not be used
|
||||
|
@ -276,9 +301,9 @@ message MethodDescriptorProto {
|
|||
optional MethodOptions options = 4;
|
||||
|
||||
// Identifies if client streams multiple client messages
|
||||
optional bool client_streaming = 5 [default=false];
|
||||
optional bool client_streaming = 5 [default = false];
|
||||
// Identifies if server streams multiple server messages
|
||||
optional bool server_streaming = 6 [default=false];
|
||||
optional bool server_streaming = 6 [default = false];
|
||||
}
|
||||
|
||||
|
||||
|
@ -314,7 +339,6 @@ message MethodDescriptorProto {
|
|||
// If this turns out to be popular, a web service will be set up
|
||||
// to automatically assign option numbers.
|
||||
|
||||
|
||||
message FileOptions {
|
||||
|
||||
// Sets the Java package where classes generated from this .proto will be
|
||||
|
@ -324,20 +348,20 @@ message FileOptions {
|
|||
optional string java_package = 1;
|
||||
|
||||
|
||||
// If set, all the classes from the .proto file are wrapped in a single
|
||||
// outer class with the given name. This applies to both Proto1
|
||||
// (equivalent to the old "--one_java_file" option) and Proto2 (where
|
||||
// a .proto always translates to a single class, but you may want to
|
||||
// explicitly choose the class name).
|
||||
// Controls the name of the wrapper Java class generated for the .proto file.
|
||||
// That class will always contain the .proto file's getDescriptor() method as
|
||||
// well as any top-level extensions defined in the .proto file.
|
||||
// If java_multiple_files is disabled, then all the other classes from the
|
||||
// .proto file will be nested inside the single wrapper outer class.
|
||||
optional string java_outer_classname = 8;
|
||||
|
||||
// If set true, then the Java code generator will generate a separate .java
|
||||
// If enabled, then the Java code generator will generate a separate .java
|
||||
// file for each top-level message, enum, and service defined in the .proto
|
||||
// file. Thus, these types will *not* be nested inside the outer class
|
||||
// named by java_outer_classname. However, the outer class will still be
|
||||
// file. Thus, these types will *not* be nested inside the wrapper class
|
||||
// named by java_outer_classname. However, the wrapper class will still be
|
||||
// generated to contain the file's getDescriptor() method as well as any
|
||||
// top-level extensions defined in the file.
|
||||
optional bool java_multiple_files = 10 [default=false];
|
||||
optional bool java_multiple_files = 10 [default = false];
|
||||
|
||||
// This option does nothing.
|
||||
optional bool java_generate_equals_and_hash = 20 [deprecated=true];
|
||||
|
@ -348,17 +372,17 @@ message FileOptions {
|
|||
// Message reflection will do the same.
|
||||
// However, an extension field still accepts non-UTF-8 byte sequences.
|
||||
// This option has no effect on when used with the lite runtime.
|
||||
optional bool java_string_check_utf8 = 27 [default=false];
|
||||
optional bool java_string_check_utf8 = 27 [default = false];
|
||||
|
||||
|
||||
// Generated classes can be optimized for speed or code size.
|
||||
enum OptimizeMode {
|
||||
SPEED = 1; // Generate complete code for parsing, serialization,
|
||||
// etc.
|
||||
CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
|
||||
LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
|
||||
SPEED = 1; // Generate complete code for parsing, serialization,
|
||||
// etc.
|
||||
CODE_SIZE = 2; // Use ReflectionOps to implement these methods.
|
||||
LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.
|
||||
}
|
||||
optional OptimizeMode optimize_for = 9 [default=SPEED];
|
||||
optional OptimizeMode optimize_for = 9 [default = SPEED];
|
||||
|
||||
// Sets the Go package where structs generated from this .proto will be
|
||||
// placed. If omitted, the Go package will be derived from the following:
|
||||
|
@ -369,6 +393,7 @@ message FileOptions {
|
|||
|
||||
|
||||
|
||||
|
||||
// Should generic services be generated in each language? "Generic" services
|
||||
// are not specific to any particular RPC system. They are generated by the
|
||||
// main code generators in each language (without additional plugins).
|
||||
|
@ -379,20 +404,20 @@ message FileOptions {
|
|||
// that generate code specific to your particular RPC system. Therefore,
|
||||
// these default to false. Old code which depends on generic services should
|
||||
// explicitly set them to true.
|
||||
optional bool cc_generic_services = 16 [default=false];
|
||||
optional bool java_generic_services = 17 [default=false];
|
||||
optional bool py_generic_services = 18 [default=false];
|
||||
optional bool php_generic_services = 42 [default=false];
|
||||
optional bool cc_generic_services = 16 [default = false];
|
||||
optional bool java_generic_services = 17 [default = false];
|
||||
optional bool py_generic_services = 18 [default = false];
|
||||
optional bool php_generic_services = 42 [default = false];
|
||||
|
||||
// Is this file deprecated?
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for everything in the file, or it will be completely ignored; in the very
|
||||
// least, this is a formalization for deprecating files.
|
||||
optional bool deprecated = 23 [default=false];
|
||||
optional bool deprecated = 23 [default = false];
|
||||
|
||||
// Enables the use of arenas for the proto messages in this file. This applies
|
||||
// only to generated classes for C++.
|
||||
optional bool cc_enable_arenas = 31 [default=false];
|
||||
optional bool cc_enable_arenas = 31 [default = true];
|
||||
|
||||
|
||||
// Sets the objective c class prefix which is prepended to all objective c
|
||||
|
@ -417,6 +442,17 @@ message FileOptions {
|
|||
// determining the namespace.
|
||||
optional string php_namespace = 41;
|
||||
|
||||
// Use this option to change the namespace of php generated metadata classes.
|
||||
// Default is empty. When this option is empty, the proto file name will be
|
||||
// used for determining the namespace.
|
||||
optional string php_metadata_namespace = 44;
|
||||
|
||||
// Use this option to change the package of ruby generated classes. Default
|
||||
// is empty. When this option is not set, the package name will be used for
|
||||
// determining the ruby package.
|
||||
optional string ruby_package = 45;
|
||||
|
||||
|
||||
// The parser stores options it doesn't recognize here.
|
||||
// See the documentation for the "Options" section above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
@ -447,18 +483,20 @@ message MessageOptions {
|
|||
//
|
||||
// Because this is an option, the above two restrictions are not enforced by
|
||||
// the protocol compiler.
|
||||
optional bool message_set_wire_format = 1 [default=false];
|
||||
optional bool message_set_wire_format = 1 [default = false];
|
||||
|
||||
// Disables the generation of the standard "descriptor()" accessor, which can
|
||||
// conflict with a field of the same name. This is meant to make migration
|
||||
// from proto1 easier; new code should avoid fields named "descriptor".
|
||||
optional bool no_standard_descriptor_accessor = 2 [default=false];
|
||||
optional bool no_standard_descriptor_accessor = 2 [default = false];
|
||||
|
||||
// Is this message deprecated?
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the message, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating messages.
|
||||
optional bool deprecated = 3 [default=false];
|
||||
optional bool deprecated = 3 [default = false];
|
||||
|
||||
reserved 4, 5, 6;
|
||||
|
||||
// Whether the message is an automatically generated map entry type for the
|
||||
// maps field.
|
||||
|
@ -475,7 +513,7 @@ message MessageOptions {
|
|||
//
|
||||
// Implementations may choose not to generate the map_entry=true message, but
|
||||
// use a native map in the target language to hold the keys and values.
|
||||
// The reflection APIs in such implementions still need to work as
|
||||
// The reflection APIs in such implementations still need to work as
|
||||
// if the field is a repeated message field.
|
||||
//
|
||||
// NOTE: Do not set the option in .proto files. Always use the maps syntax
|
||||
|
@ -486,6 +524,7 @@ message MessageOptions {
|
|||
reserved 8; // javalite_serializable
|
||||
reserved 9; // javanano_as_lite
|
||||
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
||||
|
@ -565,16 +604,16 @@ message FieldOptions {
|
|||
// implementation must either *always* check its required fields, or *never*
|
||||
// check its required fields, regardless of whether or not the message has
|
||||
// been parsed.
|
||||
optional bool lazy = 5 [default=false];
|
||||
optional bool lazy = 5 [default = false];
|
||||
|
||||
// Is this field deprecated?
|
||||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for accessors, or it will be completely ignored; in the very least, this
|
||||
// is a formalization for deprecating fields.
|
||||
optional bool deprecated = 3 [default=false];
|
||||
optional bool deprecated = 3 [default = false];
|
||||
|
||||
// For Google-internal migration only. Do not use.
|
||||
optional bool weak = 10 [default=false];
|
||||
optional bool weak = 10 [default = false];
|
||||
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
|
@ -604,7 +643,7 @@ message EnumOptions {
|
|||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the enum, or it will be completely ignored; in the very least, this
|
||||
// is a formalization for deprecating enums.
|
||||
optional bool deprecated = 3 [default=false];
|
||||
optional bool deprecated = 3 [default = false];
|
||||
|
||||
reserved 5; // javanano_as_lite
|
||||
|
||||
|
@ -620,7 +659,7 @@ message EnumValueOptions {
|
|||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the enum value, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating enum values.
|
||||
optional bool deprecated = 1 [default=false];
|
||||
optional bool deprecated = 1 [default = false];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
@ -640,7 +679,7 @@ message ServiceOptions {
|
|||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the service, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating services.
|
||||
optional bool deprecated = 33 [default=false];
|
||||
optional bool deprecated = 33 [default = false];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
@ -660,18 +699,18 @@ message MethodOptions {
|
|||
// Depending on the target platform, this can emit Deprecated annotations
|
||||
// for the method, or it will be completely ignored; in the very least,
|
||||
// this is a formalization for deprecating methods.
|
||||
optional bool deprecated = 33 [default=false];
|
||||
optional bool deprecated = 33 [default = false];
|
||||
|
||||
// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
|
||||
// or neither? HTTP based RPC implementation may choose GET verb for safe
|
||||
// methods, and PUT verb for idempotent methods instead of the default POST.
|
||||
enum IdempotencyLevel {
|
||||
IDEMPOTENCY_UNKNOWN = 0;
|
||||
NO_SIDE_EFFECTS = 1; // implies idempotent
|
||||
IDEMPOTENT = 2; // idempotent, but may have side effects
|
||||
NO_SIDE_EFFECTS = 1; // implies idempotent
|
||||
IDEMPOTENT = 2; // idempotent, but may have side effects
|
||||
}
|
||||
optional IdempotencyLevel idempotency_level =
|
||||
34 [default=IDEMPOTENCY_UNKNOWN];
|
||||
optional IdempotencyLevel idempotency_level = 34
|
||||
[default = IDEMPOTENCY_UNKNOWN];
|
||||
|
||||
// The parser stores options it doesn't recognize here. See above.
|
||||
repeated UninterpretedOption uninterpreted_option = 999;
|
||||
|
@ -752,7 +791,7 @@ message SourceCodeInfo {
|
|||
// beginning of the "extend" block and is shared by all extensions within
|
||||
// the block.
|
||||
// - Just because a location's span is a subset of some other location's span
|
||||
// does not mean that it is a descendent. For example, a "group" defines
|
||||
// does not mean that it is a descendant. For example, a "group" defines
|
||||
// both a type and a field in a single declaration. Thus, the locations
|
||||
// corresponding to the type and field and their components will overlap.
|
||||
// - Code which tries to interpret locations should probably be designed to
|
||||
|
@ -783,14 +822,14 @@ message SourceCodeInfo {
|
|||
// [ 4, 3, 2, 7 ]
|
||||
// this path refers to the whole field declaration (from the beginning
|
||||
// of the label to the terminating semicolon).
|
||||
repeated int32 path = 1 [packed=true];
|
||||
repeated int32 path = 1 [packed = true];
|
||||
|
||||
// Always has exactly three or four elements: start line, start column,
|
||||
// end line (optional, otherwise assumed same as start line), end column.
|
||||
// These are packed into a single field for efficiency. Note that line
|
||||
// and column numbers are zero-based -- typically you will want to add
|
||||
// 1 to each before displaying to a user.
|
||||
repeated int32 span = 2 [packed=true];
|
||||
repeated int32 span = 2 [packed = true];
|
||||
|
||||
// If this SourceCodeInfo represents a complete declaration, these are any
|
||||
// comments appearing before and after the declaration which appear to be
|
||||
|
@ -855,7 +894,7 @@ message GeneratedCodeInfo {
|
|||
message Annotation {
|
||||
// Identifies the element in the original source .proto file. This field
|
||||
// is formatted the same as SourceCodeInfo.Location.path.
|
||||
repeated int32 path = 1 [packed=true];
|
||||
repeated int32 path = 1 [packed = true];
|
||||
|
||||
// Identifies the filesystem path to the original source .proto.
|
||||
optional string source_file = 2;
|
|
@ -34,7 +34,7 @@ package google.protobuf;
|
|||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "github.com/golang/protobuf/ptypes/duration";
|
||||
option go_package = "google.golang.org/protobuf/types/known/durationpb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "DurationProto";
|
||||
option java_multiple_files = true;
|
||||
|
@ -61,7 +61,7 @@ option objc_class_prefix = "GPB";
|
|||
// if (duration.seconds < 0 && duration.nanos > 0) {
|
||||
// duration.seconds += 1;
|
||||
// duration.nanos -= 1000000000;
|
||||
// } else if (durations.seconds > 0 && duration.nanos < 0) {
|
||||
// } else if (duration.seconds > 0 && duration.nanos < 0) {
|
||||
// duration.seconds -= 1;
|
||||
// duration.nanos += 1000000000;
|
||||
// }
|
||||
|
@ -101,7 +101,6 @@ option objc_class_prefix = "GPB";
|
|||
//
|
||||
//
|
||||
message Duration {
|
||||
|
||||
// Signed seconds of the span of time. Must be from -315,576,000,000
|
||||
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
||||
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
@ -33,7 +33,7 @@ syntax = "proto3";
|
|||
package google.protobuf;
|
||||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option go_package = "github.com/golang/protobuf/ptypes/empty";
|
||||
option go_package = "google.golang.org/protobuf/types/known/emptypb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "EmptyProto";
|
||||
option java_multiple_files = true;
|
|
@ -37,7 +37,8 @@ option java_package = "com.google.protobuf";
|
|||
option java_outer_classname = "FieldMaskProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
|
||||
option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb";
|
||||
option cc_enable_arenas = true;
|
||||
|
||||
// `FieldMask` represents a set of symbolic field paths, for example:
|
||||
//
|
||||
|
@ -107,57 +108,49 @@ option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
|
|||
// describe the updated values, the API ignores the values of all
|
||||
// fields not covered by the mask.
|
||||
//
|
||||
// If a repeated field is specified for an update operation, the existing
|
||||
// repeated values in the target resource will be overwritten by the new values.
|
||||
// Note that a repeated field is only allowed in the last position of a `paths`
|
||||
// string.
|
||||
// If a repeated field is specified for an update operation, new values will
|
||||
// be appended to the existing repeated field in the target resource. Note that
|
||||
// a repeated field is only allowed in the last position of a `paths` string.
|
||||
//
|
||||
// If a sub-message is specified in the last position of the field mask for an
|
||||
// update operation, then the existing sub-message in the target resource is
|
||||
// overwritten. Given the target message:
|
||||
// update operation, then new value will be merged into the existing sub-message
|
||||
// in the target resource.
|
||||
//
|
||||
// For example, given the target message:
|
||||
//
|
||||
// f {
|
||||
// b {
|
||||
// d : 1
|
||||
// x : 2
|
||||
// d: 1
|
||||
// x: 2
|
||||
// }
|
||||
// c : 1
|
||||
// c: [1]
|
||||
// }
|
||||
//
|
||||
// And an update message:
|
||||
//
|
||||
// f {
|
||||
// b {
|
||||
// d : 10
|
||||
// d: 10
|
||||
// }
|
||||
// c: [2]
|
||||
// }
|
||||
//
|
||||
// then if the field mask is:
|
||||
//
|
||||
// paths: "f.b"
|
||||
// paths: ["f.b", "f.c"]
|
||||
//
|
||||
// then the result will be:
|
||||
//
|
||||
// f {
|
||||
// b {
|
||||
// d : 10
|
||||
// d: 10
|
||||
// x: 2
|
||||
// }
|
||||
// c : 1
|
||||
// c: [1, 2]
|
||||
// }
|
||||
//
|
||||
// However, if the update mask was:
|
||||
//
|
||||
// paths: "f.b.d"
|
||||
//
|
||||
// then the result would be:
|
||||
//
|
||||
// f {
|
||||
// b {
|
||||
// d : 10
|
||||
// x : 2
|
||||
// }
|
||||
// c : 1
|
||||
// }
|
||||
// An implementation may provide options to override this default behavior for
|
||||
// repeated and message fields.
|
||||
//
|
||||
// In order to reset a field's value to the default, the field must
|
||||
// be in the mask and set to the default value in the provided resource.
|
||||
|
@ -243,9 +236,9 @@ option go_package = "google.golang.org/genproto/protobuf/field_mask;field_mask";
|
|||
//
|
||||
// ## Field Mask Verification
|
||||
//
|
||||
// The implementation of the all the API methods, which have any FieldMask type
|
||||
// field in the request, should verify the included field paths, and return
|
||||
// `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
|
||||
// The implementation of any API method which has a FieldMask type field in the
|
||||
// request should verify the included field paths, and return an
|
||||
// `INVALID_ARGUMENT` error if any path is unmappable.
|
||||
message FieldMask {
|
||||
// The set of field mask paths.
|
||||
repeated string paths = 1;
|
|
@ -37,7 +37,7 @@ option java_package = "com.google.protobuf";
|
|||
option java_outer_classname = "SourceContextProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option go_package = "google.golang.org/genproto/protobuf/source_context;source_context";
|
||||
option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb";
|
||||
|
||||
// `SourceContext` represents information about the source of a
|
||||
// protobuf element, like the file in which it is defined.
|
|
@ -34,13 +34,12 @@ package google.protobuf;
|
|||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "github.com/golang/protobuf/ptypes/struct;structpb";
|
||||
option go_package = "google.golang.org/protobuf/types/known/structpb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "StructProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
|
||||
|
||||
// `Struct` represents a structured data value, consisting of fields
|
||||
// which map to dynamically typed values. In some languages, `Struct`
|
||||
// might be supported by a native representation. For example, in
|
||||
|
@ -56,8 +55,8 @@ message Struct {
|
|||
|
||||
// `Value` represents a dynamically typed value which can be either
|
||||
// null, a number, a string, a boolean, a recursive struct value, or a
|
||||
// list of values. A producer of value is expected to set one of that
|
||||
// variants, absence of any variant indicates an error.
|
||||
// list of values. A producer of value is expected to set one of these
|
||||
// variants. Absence of any variant indicates an error.
|
||||
//
|
||||
// The JSON representation for `Value` is JSON value.
|
||||
message Value {
|
|
@ -34,23 +34,25 @@ package google.protobuf;
|
|||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "github.com/golang/protobuf/ptypes/timestamp";
|
||||
option go_package = "google.golang.org/protobuf/types/known/timestamppb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "TimestampProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
|
||||
// A Timestamp represents a point in time independent of any time zone
|
||||
// or calendar, represented as seconds and fractions of seconds at
|
||||
// nanosecond resolution in UTC Epoch time. It is encoded using the
|
||||
// Proleptic Gregorian Calendar which extends the Gregorian calendar
|
||||
// backwards to year one. It is encoded assuming all minutes are 60
|
||||
// seconds long, i.e. leap seconds are "smeared" so that no leap second
|
||||
// table is needed for interpretation. Range is from
|
||||
// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
|
||||
// By restricting to that range, we ensure that we can convert to
|
||||
// and from RFC 3339 date strings.
|
||||
// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
|
||||
// A Timestamp represents a point in time independent of any time zone or local
|
||||
// calendar, encoded as a count of seconds and fractions of seconds at
|
||||
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||
// Gregorian calendar backwards to year one.
|
||||
//
|
||||
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||
// second table is needed for interpretation, using a [24-hour linear
|
||||
// smear](https://developers.google.com/time/smear).
|
||||
//
|
||||
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||
// restricting to that range, we ensure that we can convert to and from [RFC
|
||||
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||
//
|
||||
// # Examples
|
||||
//
|
||||
|
@ -89,7 +91,16 @@ option objc_class_prefix = "GPB";
|
|||
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
//
|
||||
//
|
||||
// Example 5: Compute Timestamp from current time in Python.
|
||||
// Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
//
|
||||
// Instant now = Instant.now();
|
||||
//
|
||||
// Timestamp timestamp =
|
||||
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
// .setNanos(now.getNano()).build();
|
||||
//
|
||||
//
|
||||
// Example 6: Compute Timestamp from current time in Python.
|
||||
//
|
||||
// timestamp = Timestamp()
|
||||
// timestamp.GetCurrentTime()
|
||||
|
@ -103,23 +114,26 @@ option objc_class_prefix = "GPB";
|
|||
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
// is required, though only UTC (as indicated by "Z") is presently supported.
|
||||
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||
// able to accept both UTC and other timezones (as indicated by an offset).
|
||||
//
|
||||
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
// 01:30 UTC on January 15, 2017.
|
||||
//
|
||||
// In JavaScript, one can convert a Date object to this format using the
|
||||
// standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
|
||||
// standard
|
||||
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
// method. In Python, a standard `datetime.datetime` object can be converted
|
||||
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
||||
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
||||
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
|
||||
// to obtain a formatter capable of generating timestamps in this format.
|
||||
// to this format using
|
||||
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
// ) to obtain a formatter capable of generating timestamps in this format.
|
||||
//
|
||||
//
|
||||
message Timestamp {
|
||||
|
||||
// Represents seconds of UTC time since Unix epoch
|
||||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
// 9999-12-31T23:59:59Z inclusive.
|
|
@ -41,7 +41,7 @@ option java_package = "com.google.protobuf";
|
|||
option java_outer_classname = "TypeProto";
|
||||
option java_multiple_files = true;
|
||||
option objc_class_prefix = "GPB";
|
||||
option go_package = "google.golang.org/genproto/protobuf/ptype;ptype";
|
||||
option go_package = "google.golang.org/protobuf/types/known/typepb";
|
||||
|
||||
// A protocol buffer message type.
|
||||
message Type {
|
||||
|
@ -64,44 +64,44 @@ message Field {
|
|||
// Basic field types.
|
||||
enum Kind {
|
||||
// Field type unknown.
|
||||
TYPE_UNKNOWN = 0;
|
||||
TYPE_UNKNOWN = 0;
|
||||
// Field type double.
|
||||
TYPE_DOUBLE = 1;
|
||||
TYPE_DOUBLE = 1;
|
||||
// Field type float.
|
||||
TYPE_FLOAT = 2;
|
||||
TYPE_FLOAT = 2;
|
||||
// Field type int64.
|
||||
TYPE_INT64 = 3;
|
||||
TYPE_INT64 = 3;
|
||||
// Field type uint64.
|
||||
TYPE_UINT64 = 4;
|
||||
TYPE_UINT64 = 4;
|
||||
// Field type int32.
|
||||
TYPE_INT32 = 5;
|
||||
TYPE_INT32 = 5;
|
||||
// Field type fixed64.
|
||||
TYPE_FIXED64 = 6;
|
||||
TYPE_FIXED64 = 6;
|
||||
// Field type fixed32.
|
||||
TYPE_FIXED32 = 7;
|
||||
TYPE_FIXED32 = 7;
|
||||
// Field type bool.
|
||||
TYPE_BOOL = 8;
|
||||
TYPE_BOOL = 8;
|
||||
// Field type string.
|
||||
TYPE_STRING = 9;
|
||||
TYPE_STRING = 9;
|
||||
// Field type group. Proto2 syntax only, and deprecated.
|
||||
TYPE_GROUP = 10;
|
||||
TYPE_GROUP = 10;
|
||||
// Field type message.
|
||||
TYPE_MESSAGE = 11;
|
||||
TYPE_MESSAGE = 11;
|
||||
// Field type bytes.
|
||||
TYPE_BYTES = 12;
|
||||
TYPE_BYTES = 12;
|
||||
// Field type uint32.
|
||||
TYPE_UINT32 = 13;
|
||||
TYPE_UINT32 = 13;
|
||||
// Field type enum.
|
||||
TYPE_ENUM = 14;
|
||||
TYPE_ENUM = 14;
|
||||
// Field type sfixed32.
|
||||
TYPE_SFIXED32 = 15;
|
||||
TYPE_SFIXED32 = 15;
|
||||
// Field type sfixed64.
|
||||
TYPE_SFIXED64 = 16;
|
||||
TYPE_SFIXED64 = 16;
|
||||
// Field type sint32.
|
||||
TYPE_SINT32 = 17;
|
||||
TYPE_SINT32 = 17;
|
||||
// Field type sint64.
|
||||
TYPE_SINT64 = 18;
|
||||
};
|
||||
TYPE_SINT64 = 18;
|
||||
}
|
||||
|
||||
// Whether a field is optional, required, or repeated.
|
||||
enum Cardinality {
|
||||
|
@ -113,7 +113,7 @@ message Field {
|
|||
CARDINALITY_REQUIRED = 2;
|
||||
// For repeated fields.
|
||||
CARDINALITY_REPEATED = 3;
|
||||
};
|
||||
}
|
||||
|
||||
// The field type.
|
||||
Kind kind = 1;
|
|
@ -32,6 +32,11 @@
|
|||
// for embedding primitives in the `google.protobuf.Any` type and for places
|
||||
// where we need to distinguish between the absence of a primitive
|
||||
// typed field and its default value.
|
||||
//
|
||||
// These wrappers have no meaningful use within repeated fields as they lack
|
||||
// the ability to detect presence on individual elements.
|
||||
// These wrappers have no meaningful use within a map or a oneof since
|
||||
// individual entries of a map or fields of a oneof can already detect presence.
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
|
@ -39,7 +44,7 @@ package google.protobuf;
|
|||
|
||||
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "github.com/golang/protobuf/ptypes/wrappers";
|
||||
option go_package = "google.golang.org/protobuf/types/known/wrapperspb";
|
||||
option java_package = "com.google.protobuf";
|
||||
option java_outer_classname = "WrappersProto";
|
||||
option java_multiple_files = true;
|
|
@ -12,4 +12,4 @@ copy the contents of the 'include' directory somewhere as well, for example
|
|||
into '/usr/local/include/'.
|
||||
|
||||
Please refer to our official github site for more installation instructions:
|
||||
https://github.com/google/protobuf
|
||||
https://github.com/protocolbuffers/protobuf
|
Binary file not shown.
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
@echo off
|
||||
set work_path=%cd%
|
||||
set proto_path=%cd%\protocol
|
||||
set protoc3=%cd%\..\..\bin\protoc-3.5.1-win32\bin\protoc.exe
|
||||
set protoc3=%cd%\..\..\bin\protoc-3.19.4-win64\bin\protoc.exe
|
||||
set protoc-gen-go-plugin-path="%cd%\..\..\bin\protoc-gen-go.exe"
|
||||
|
||||
cd %proto_path%
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: corepacketid.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -3,7 +3,7 @@ package protocol;
|
|||
option go_package = ".;protocol";
|
||||
|
||||
enum CoreBuiltinPacketID {
|
||||
PACKET_COREBUILTIN_UNKNOW = 0;
|
||||
PACKET_COREBUILTIN_UNKNOW = 0;
|
||||
PACKET_SS_TX_START = -1000;
|
||||
PACKET_SS_TX_CMD = -1001;
|
||||
PACKET_SS_TX_RESULT = -1002;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: goserver_rpc.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: keepalive.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: sessionauth.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: slices.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: transact.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package action
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/srvlib"
|
||||
"mongo.games.com/goserver/srvlib/protocol"
|
||||
)
|
||||
|
||||
func init() {
|
||||
netlib.Register(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), &protocol.SSPacketBroadcast{}, BroadcastHandler)
|
||||
}
|
||||
|
||||
func BroadcastHandler(s *netlib.Session, packetId int, data interface{}) error {
|
||||
if bp, ok := data.(*protocol.SSPacketBroadcast); ok {
|
||||
pd := bp.GetData()
|
||||
sp := bp.GetSessParam()
|
||||
if bcss := sp.GetBcss(); bcss != nil {
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(bp.GetPacketId()), pd, int(bcss.GetSArea()), int(bcss.GetSType()))
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func CreateBroadcastPacket(sp *protocol.BCSessionUnion, packetId int, data interface{}) (proto.Message, error) {
|
||||
pack := &protocol.SSPacketBroadcast{
|
||||
SessParam: sp,
|
||||
PacketId: int32(packetId),
|
||||
}
|
||||
|
||||
if byteData, ok := data.([]byte); ok {
|
||||
pack.Data = byteData
|
||||
} else {
|
||||
byteData, err := netlib.MarshalPacket(packetId, data)
|
||||
if err == nil {
|
||||
pack.Data = byteData
|
||||
} else {
|
||||
logger.Logger.Warnf("CreateBroadcastPacket err:%v", err)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return pack, nil
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package action
|
||||
|
||||
import (
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/srvlib"
|
||||
"mongo.games.com/goserver/srvlib/protocol"
|
||||
)
|
||||
|
||||
func init() {
|
||||
netlib.Register(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), &protocol.SSPacketMulticast{}, MulticastHandler)
|
||||
}
|
||||
|
||||
func MulticastHandler(s *netlib.Session, packetid int, data interface{}) error {
|
||||
if mp, ok := data.(*protocol.SSPacketMulticast); ok {
|
||||
pd := mp.GetData()
|
||||
sis := mp.GetSessions()
|
||||
for _, si := range sis {
|
||||
ns := getSession(si)
|
||||
if ns != nil {
|
||||
ns.Send(int(mp.GetPacketId()), pd)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getSession(su *protocol.MCSessionUnion) *netlib.Session {
|
||||
cs := su.GetMccs()
|
||||
if cs != nil {
|
||||
return srvlib.ClientSessionMgrSington.GetSession(cs.GetSId())
|
||||
}
|
||||
|
||||
ss := su.GetMcss()
|
||||
if ss != nil {
|
||||
return srvlib.ServerSessionMgrSington.GetSession(int(ss.GetSArea()), int(ss.GetSType()), int(ss.GetSId()))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package action
|
||||
|
||||
import (
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/srvlib"
|
||||
"mongo.games.com/goserver/srvlib/protocol"
|
||||
)
|
||||
|
||||
type PacketRedirectPacketFactory struct {
|
||||
}
|
||||
|
||||
type PacketRedirectHandler struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_REDIRECT), &PacketRedirectHandler{})
|
||||
netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_REDIRECT), &PacketRedirectPacketFactory{})
|
||||
}
|
||||
|
||||
func (this *PacketRedirectPacketFactory) CreatePacket() interface{} {
|
||||
pack := &protocol.SSPacketRedirect{}
|
||||
return pack
|
||||
}
|
||||
|
||||
func (this *PacketRedirectHandler) Process(s *netlib.Session, packetid int, data interface{}) error {
|
||||
logger.Logger.Trace("PacketRedirectHandler.Process")
|
||||
if pr, ok := data.(*protocol.SSPacketRedirect); ok {
|
||||
packid, pack, err := netlib.UnmarshalPacket(pr.GetData())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
h := srvlib.GetHandler(packid)
|
||||
if h != nil {
|
||||
return h.Process(s, packid, pack, pr.GetClientSid(), pr.GetSrvRoutes())
|
||||
} else {
|
||||
nh := netlib.GetHandler(packid)
|
||||
if nh != nil {
|
||||
return nh.Process(s, packid, pack)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package action
|
||||
|
||||
import (
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/srvlib"
|
||||
"mongo.games.com/goserver/srvlib/protocol"
|
||||
)
|
||||
|
||||
type PacketTransitPacketFactory struct {
|
||||
}
|
||||
|
||||
type PacketTransitHandler struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_TRANSIT), &PacketTransitHandler{})
|
||||
netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_TRANSIT), &PacketTransitPacketFactory{})
|
||||
}
|
||||
|
||||
func (this *PacketTransitPacketFactory) CreatePacket() interface{} {
|
||||
pack := &protocol.SSPacketTransit{}
|
||||
return pack
|
||||
}
|
||||
|
||||
func (this *PacketTransitHandler) Process(s *netlib.Session, packetid int, data interface{}) error {
|
||||
logger.Logger.Trace("PacketTransitHandler.Process")
|
||||
if pr, ok := data.(*protocol.SSPacketTransit); ok {
|
||||
targetS := srvlib.ServerSessionMgrSington.GetSession(int(pr.GetSArea()), int(pr.GetSType()), int(pr.GetSId()))
|
||||
if targetS != nil {
|
||||
targetS.Send(int(pr.GetPacketId()), pr.GetData())
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
@echo off
|
||||
set work_path=%cd%
|
||||
set proto_path=%cd%\protocol
|
||||
set protoc3=%cd%\..\bin\protoc-3.5.1-win32\bin\protoc.exe
|
||||
set protoc3=%cd%\..\bin\protoc-3.19.4-win64\bin\protoc.exe
|
||||
set protoc-gen-go-plugin-path="%cd%\..\bin\protoc-gen-go.exe"
|
||||
|
||||
cd %proto_path%
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
package srvlib
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
"mongo.games.com/goserver/srvlib/protocol"
|
||||
)
|
||||
|
||||
var handlers = make(map[int]Handler)
|
||||
|
||||
type Handler interface {
|
||||
Process(s *netlib.Session, packetid int, data interface{}, sid int64, routes []*protocol.SrvInfo) error
|
||||
}
|
||||
|
||||
type HandlerWrapper func(s *netlib.Session, packetid int, data interface{}, sid int64, routes []*protocol.SrvInfo) error
|
||||
|
||||
func (hw HandlerWrapper) Process(s *netlib.Session, packetid int, data interface{}, sid int64, routes []*protocol.SrvInfo) error {
|
||||
return hw(s, packetid, data, sid, routes)
|
||||
}
|
||||
|
||||
func RegisterHandler(packetId int, h Handler) {
|
||||
if _, ok := handlers[packetId]; ok {
|
||||
panic(fmt.Sprintf("repeate register handler: %v Handler type=%v", packetId, reflect.TypeOf(h)))
|
||||
}
|
||||
|
||||
handlers[packetId] = h
|
||||
}
|
||||
|
||||
func Register1ToMHandler(h Handler, packetIds ...int) {
|
||||
for _, packetId := range packetIds {
|
||||
RegisterHandler(packetId, h)
|
||||
}
|
||||
}
|
||||
|
||||
func RegisterRangeHandler(start, end int, h Handler) {
|
||||
for ; start <= end; start++ {
|
||||
RegisterHandler(start, h)
|
||||
}
|
||||
}
|
||||
|
||||
func GetHandler(packetId int) Handler {
|
||||
if h, ok := handlers[packetId]; ok {
|
||||
return h
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: broadcast.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: multicast.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,254 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// source: redirect.proto
|
||||
|
||||
package protocol
|
||||
|
||||
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 SSPacketRedirect struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ClientSid int64 `protobuf:"varint,1,opt,name=ClientSid,proto3" json:"ClientSid,omitempty"`
|
||||
SrvRoutes []*SrvInfo `protobuf:"bytes,2,rep,name=SrvRoutes,proto3" json:"SrvRoutes,omitempty"`
|
||||
PacketId int32 `protobuf:"varint,3,opt,name=PacketId,proto3" json:"PacketId,omitempty"`
|
||||
Data []byte `protobuf:"bytes,4,opt,name=Data,proto3" json:"Data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SSPacketRedirect) Reset() {
|
||||
*x = SSPacketRedirect{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_redirect_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SSPacketRedirect) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SSPacketRedirect) ProtoMessage() {}
|
||||
|
||||
func (x *SSPacketRedirect) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_redirect_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 SSPacketRedirect.ProtoReflect.Descriptor instead.
|
||||
func (*SSPacketRedirect) Descriptor() ([]byte, []int) {
|
||||
return file_redirect_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SSPacketRedirect) GetClientSid() int64 {
|
||||
if x != nil {
|
||||
return x.ClientSid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SSPacketRedirect) GetSrvRoutes() []*SrvInfo {
|
||||
if x != nil {
|
||||
return x.SrvRoutes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SSPacketRedirect) GetPacketId() int32 {
|
||||
if x != nil {
|
||||
return x.PacketId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SSPacketRedirect) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SrvInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
SArea int32 `protobuf:"varint,1,opt,name=SArea,proto3" json:"SArea,omitempty"`
|
||||
SType int32 `protobuf:"varint,2,opt,name=SType,proto3" json:"SType,omitempty"`
|
||||
SId int32 `protobuf:"varint,3,opt,name=SId,proto3" json:"SId,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SrvInfo) Reset() {
|
||||
*x = SrvInfo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_redirect_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SrvInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SrvInfo) ProtoMessage() {}
|
||||
|
||||
func (x *SrvInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_redirect_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 SrvInfo.ProtoReflect.Descriptor instead.
|
||||
func (*SrvInfo) Descriptor() ([]byte, []int) {
|
||||
return file_redirect_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SrvInfo) GetSArea() int32 {
|
||||
if x != nil {
|
||||
return x.SArea
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SrvInfo) GetSType() int32 {
|
||||
if x != nil {
|
||||
return x.SType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SrvInfo) GetSId() int32 {
|
||||
if x != nil {
|
||||
return x.SId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_redirect_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_redirect_proto_rawDesc = []byte{
|
||||
0x0a, 0x0e, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x91, 0x01, 0x0a, 0x10, 0x53,
|
||||
0x53, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x64, 0x12, 0x2f, 0x0a,
|
||||
0x09, 0x53, 0x72, 0x76, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x72, 0x76, 0x49,
|
||||
0x6e, 0x66, 0x6f, 0x52, 0x09, 0x53, 0x72, 0x76, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x73, 0x12, 0x1a,
|
||||
0x0a, 0x08, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x08, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61,
|
||||
0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x47,
|
||||
0x0a, 0x07, 0x53, 0x72, 0x76, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x41, 0x72,
|
||||
0x65, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x41, 0x72, 0x65, 0x61, 0x12,
|
||||
0x14, 0x0a, 0x05, 0x53, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||
0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x03, 0x53, 0x49, 0x64, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_redirect_proto_rawDescOnce sync.Once
|
||||
file_redirect_proto_rawDescData = file_redirect_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_redirect_proto_rawDescGZIP() []byte {
|
||||
file_redirect_proto_rawDescOnce.Do(func() {
|
||||
file_redirect_proto_rawDescData = protoimpl.X.CompressGZIP(file_redirect_proto_rawDescData)
|
||||
})
|
||||
return file_redirect_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_redirect_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_redirect_proto_goTypes = []interface{}{
|
||||
(*SSPacketRedirect)(nil), // 0: protocol.SSPacketRedirect
|
||||
(*SrvInfo)(nil), // 1: protocol.SrvInfo
|
||||
}
|
||||
var file_redirect_proto_depIdxs = []int32{
|
||||
1, // 0: protocol.SSPacketRedirect.SrvRoutes:type_name -> protocol.SrvInfo
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_redirect_proto_init() }
|
||||
func file_redirect_proto_init() {
|
||||
if File_redirect_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_redirect_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SSPacketRedirect); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_redirect_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SrvInfo); 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_redirect_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_redirect_proto_goTypes,
|
||||
DependencyIndexes: file_redirect_proto_depIdxs,
|
||||
MessageInfos: file_redirect_proto_msgTypes,
|
||||
}.Build()
|
||||
File_redirect_proto = out.File
|
||||
file_redirect_proto_rawDesc = nil
|
||||
file_redirect_proto_goTypes = nil
|
||||
file_redirect_proto_depIdxs = nil
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
syntax = "proto3";
|
||||
package protocol;
|
||||
option go_package = ".;protocol";
|
||||
|
||||
message SSPacketRedirect {
|
||||
int64 ClientSid = 1;
|
||||
repeated SrvInfo SrvRoutes = 2;
|
||||
int32 PacketId = 3;
|
||||
bytes Data = 4;
|
||||
}
|
||||
|
||||
message SrvInfo {
|
||||
int32 SArea = 1;
|
||||
int32 SType = 2;
|
||||
int32 SId = 3;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: serviceinfo.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: srvlibpacketid.proto
|
||||
|
||||
package protocol
|
||||
|
@ -26,12 +26,10 @@ const (
|
|||
SrvlibPacketID_PACKET_SRVLIB_UNKNOW SrvlibPacketID = 0
|
||||
SrvlibPacketID_PACKET_SS_REGISTE SrvlibPacketID = -2000
|
||||
SrvlibPacketID_PACKET_SS_MULTICAST SrvlibPacketID = -2001
|
||||
SrvlibPacketID_PACKET_SS_BROADCAST SrvlibPacketID = -2002
|
||||
SrvlibPacketID_PACKET_SS_TRANSIT SrvlibPacketID = -2003
|
||||
SrvlibPacketID_PACKET_SS_REDIRECT SrvlibPacketID = -2004
|
||||
SrvlibPacketID_PACKET_SS_SERVICE_REGISTE SrvlibPacketID = -2005
|
||||
SrvlibPacketID_PACKET_SS_SERVICE_INFO SrvlibPacketID = -2006
|
||||
SrvlibPacketID_PACKET_SS_SERVICE_SHUT SrvlibPacketID = -2007
|
||||
SrvlibPacketID_PACKET_SS_BROADCAST SrvlibPacketID = -2002 // 消息广播;给一个
|
||||
SrvlibPacketID_PACKET_SS_SERVICE_REGISTE SrvlibPacketID = -2003
|
||||
SrvlibPacketID_PACKET_SS_SERVICE_INFO SrvlibPacketID = -2004
|
||||
SrvlibPacketID_PACKET_SS_SERVICE_SHUT SrvlibPacketID = -2005
|
||||
)
|
||||
|
||||
// Enum value maps for SrvlibPacketID.
|
||||
|
@ -41,22 +39,18 @@ var (
|
|||
-2000: "PACKET_SS_REGISTE",
|
||||
-2001: "PACKET_SS_MULTICAST",
|
||||
-2002: "PACKET_SS_BROADCAST",
|
||||
-2003: "PACKET_SS_TRANSIT",
|
||||
-2004: "PACKET_SS_REDIRECT",
|
||||
-2005: "PACKET_SS_SERVICE_REGISTE",
|
||||
-2006: "PACKET_SS_SERVICE_INFO",
|
||||
-2007: "PACKET_SS_SERVICE_SHUT",
|
||||
-2003: "PACKET_SS_SERVICE_REGISTE",
|
||||
-2004: "PACKET_SS_SERVICE_INFO",
|
||||
-2005: "PACKET_SS_SERVICE_SHUT",
|
||||
}
|
||||
SrvlibPacketID_value = map[string]int32{
|
||||
"PACKET_SRVLIB_UNKNOW": 0,
|
||||
"PACKET_SS_REGISTE": -2000,
|
||||
"PACKET_SS_MULTICAST": -2001,
|
||||
"PACKET_SS_BROADCAST": -2002,
|
||||
"PACKET_SS_TRANSIT": -2003,
|
||||
"PACKET_SS_REDIRECT": -2004,
|
||||
"PACKET_SS_SERVICE_REGISTE": -2005,
|
||||
"PACKET_SS_SERVICE_INFO": -2006,
|
||||
"PACKET_SS_SERVICE_SHUT": -2007,
|
||||
"PACKET_SS_SERVICE_REGISTE": -2003,
|
||||
"PACKET_SS_SERVICE_INFO": -2004,
|
||||
"PACKET_SS_SERVICE_SHUT": -2005,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -92,7 +86,7 @@ var File_srvlibpacketid_proto protoreflect.FileDescriptor
|
|||
var file_srvlibpacketid_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x73, 0x72, 0x76, 0x6c, 0x69, 0x62, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x69, 0x64,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
|
||||
0x2a, 0xc1, 0x02, 0x0a, 0x0e, 0x53, 0x72, 0x76, 0x6c, 0x69, 0x62, 0x50, 0x61, 0x63, 0x6b, 0x65,
|
||||
0x2a, 0x80, 0x02, 0x0a, 0x0e, 0x53, 0x72, 0x76, 0x6c, 0x69, 0x62, 0x50, 0x61, 0x63, 0x6b, 0x65,
|
||||
0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x52,
|
||||
0x56, 0x4c, 0x49, 0x42, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x10, 0x00, 0x12, 0x1e, 0x0a,
|
||||
0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53,
|
||||
|
@ -101,19 +95,15 @@ var file_srvlibpacketid_proto_rawDesc = []byte{
|
|||
0x43, 0x41, 0x53, 0x54, 0x10, 0xaf, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12,
|
||||
0x20, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x42, 0x52, 0x4f,
|
||||
0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0xae, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x01, 0x12, 0x1e, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x54,
|
||||
0x52, 0x41, 0x4e, 0x53, 0x49, 0x54, 0x10, 0xad, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x01, 0x12, 0x1f, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x52,
|
||||
0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x10, 0xac, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0x01, 0x12, 0x26, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f,
|
||||
0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x10,
|
||||
0xab, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x23, 0x0a, 0x16, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f,
|
||||
0x49, 0x4e, 0x46, 0x4f, 0x10, 0xaa, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12,
|
||||
0x23, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x53, 0x45, 0x52,
|
||||
0x56, 0x49, 0x43, 0x45, 0x5f, 0x53, 0x48, 0x55, 0x54, 0x10, 0xa9, 0xf0, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0x01, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
||||
0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x01, 0x12, 0x26, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x53,
|
||||
0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x10, 0xad,
|
||||
0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x23, 0x0a, 0x16, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x49,
|
||||
0x4e, 0x46, 0x4f, 0x10, 0xac, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x12, 0x23,
|
||||
0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x53, 0x45, 0x52, 0x56,
|
||||
0x49, 0x43, 0x45, 0x5f, 0x53, 0x48, 0x55, 0x54, 0x10, 0xab, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0x01, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
|
||||
0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -3,13 +3,11 @@ package protocol;
|
|||
option go_package = ".;protocol";
|
||||
|
||||
enum SrvlibPacketID {
|
||||
PACKET_SRVLIB_UNKNOW= 0;
|
||||
PACKET_SRVLIB_UNKNOW= 0;
|
||||
PACKET_SS_REGISTE = -2000;
|
||||
PACKET_SS_MULTICAST = -2001;
|
||||
PACKET_SS_BROADCAST = -2002; // 消息广播;给一个
|
||||
PACKET_SS_TRANSIT = -2003;
|
||||
PACKET_SS_REDIRECT = -2004;
|
||||
PACKET_SS_SERVICE_REGISTE = -2005;
|
||||
PACKET_SS_SERVICE_INFO = -2006;
|
||||
PACKET_SS_SERVICE_SHUT = -2007;
|
||||
PACKET_SS_SERVICE_REGISTE = -2003;
|
||||
PACKET_SS_SERVICE_INFO = -2004;
|
||||
PACKET_SS_SERVICE_SHUT = -2005;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: srvregiste.proto
|
||||
|
||||
package protocol
|
||||
|
|
|
@ -1,179 +0,0 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc v3.5.1
|
||||
// source: transit.proto
|
||||
|
||||
package protocol
|
||||
|
||||
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 SSPacketTransit struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
SArea int32 `protobuf:"varint,1,opt,name=SArea,proto3" json:"SArea,omitempty"`
|
||||
SType int32 `protobuf:"varint,2,opt,name=SType,proto3" json:"SType,omitempty"`
|
||||
SId int32 `protobuf:"varint,3,opt,name=SId,proto3" json:"SId,omitempty"`
|
||||
PacketId int32 `protobuf:"varint,4,opt,name=PacketId,proto3" json:"PacketId,omitempty"`
|
||||
Data []byte `protobuf:"bytes,5,opt,name=Data,proto3" json:"Data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SSPacketTransit) Reset() {
|
||||
*x = SSPacketTransit{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_transit_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SSPacketTransit) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SSPacketTransit) ProtoMessage() {}
|
||||
|
||||
func (x *SSPacketTransit) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_transit_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 SSPacketTransit.ProtoReflect.Descriptor instead.
|
||||
func (*SSPacketTransit) Descriptor() ([]byte, []int) {
|
||||
return file_transit_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SSPacketTransit) GetSArea() int32 {
|
||||
if x != nil {
|
||||
return x.SArea
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SSPacketTransit) GetSType() int32 {
|
||||
if x != nil {
|
||||
return x.SType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SSPacketTransit) GetSId() int32 {
|
||||
if x != nil {
|
||||
return x.SId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SSPacketTransit) GetPacketId() int32 {
|
||||
if x != nil {
|
||||
return x.PacketId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SSPacketTransit) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_transit_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_transit_proto_rawDesc = []byte{
|
||||
0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x7f, 0x0a, 0x0f, 0x53, 0x53, 0x50,
|
||||
0x61, 0x63, 0x6b, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x53, 0x41, 0x72, 0x65, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x41, 0x72,
|
||||
0x65, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x05, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x49, 0x64, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x53, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61,
|
||||
0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x50, 0x61,
|
||||
0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x05,
|
||||
0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x3b,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_transit_proto_rawDescOnce sync.Once
|
||||
file_transit_proto_rawDescData = file_transit_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_transit_proto_rawDescGZIP() []byte {
|
||||
file_transit_proto_rawDescOnce.Do(func() {
|
||||
file_transit_proto_rawDescData = protoimpl.X.CompressGZIP(file_transit_proto_rawDescData)
|
||||
})
|
||||
return file_transit_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_transit_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_transit_proto_goTypes = []interface{}{
|
||||
(*SSPacketTransit)(nil), // 0: protocol.SSPacketTransit
|
||||
}
|
||||
var file_transit_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] 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_transit_proto_init() }
|
||||
func file_transit_proto_init() {
|
||||
if File_transit_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_transit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SSPacketTransit); 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_transit_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_transit_proto_goTypes,
|
||||
DependencyIndexes: file_transit_proto_depIdxs,
|
||||
MessageInfos: file_transit_proto_msgTypes,
|
||||
}.Build()
|
||||
File_transit_proto = out.File
|
||||
file_transit_proto_rawDesc = nil
|
||||
file_transit_proto_goTypes = nil
|
||||
file_transit_proto_depIdxs = nil
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
syntax = "proto3";
|
||||
package protocol;
|
||||
option go_package = ".;protocol";
|
||||
|
||||
message SSPacketTransit {
|
||||
int32 SArea = 1;
|
||||
int32 SType = 2;
|
||||
int32 SId = 3;
|
||||
int32 PacketId = 4;
|
||||
bytes Data = 5;
|
||||
}
|
|
@ -51,7 +51,7 @@ func (ssm *ServerSessionMgr) RegisteSession(s *netlib.Session) bool {
|
|||
}
|
||||
|
||||
if _, exist := ssm.sessions[areaId][srvType][srvId]; !exist {
|
||||
logger.Logger.Infof("(ssm *ServerSessionMgr) RegisteSession %v", srvInfo)
|
||||
logger.Logger.Infof("ServerSessionMgr RegisteSession %v", srvInfo)
|
||||
ssm.sessions[areaId][srvType][srvId] = s
|
||||
if len(ssm.listeners) != 0 {
|
||||
for _, l := range ssm.listeners {
|
||||
|
@ -59,7 +59,7 @@ func (ssm *ServerSessionMgr) RegisteSession(s *netlib.Session) bool {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
logger.Logger.Warnf("###(ssm *ServerSessionMgr) RegisteSession repeated areaid:%v srvType:%v srvId:%v", areaId, srvType, srvId)
|
||||
logger.Logger.Warnf("ServerSessionMgr RegisteSession repeated areaid:%v srvType:%v srvId:%v", areaId, srvType, srvId)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -72,14 +72,14 @@ func (ssm *ServerSessionMgr) UnregisteSession(s *netlib.Session) bool {
|
|||
attr := s.GetAttribute(SessionAttributeServerInfo)
|
||||
if attr != nil {
|
||||
if srvInfo, ok := attr.(*protocol.SSSrvRegiste); ok && srvInfo != nil {
|
||||
logger.Logger.Infof("ServerSessionMgr.UnregisteSession try %v", srvInfo)
|
||||
logger.Logger.Infof("ServerSessionMgr UnregisteSession try %v", srvInfo)
|
||||
areaId := int(srvInfo.GetAreaId())
|
||||
srvType := int(srvInfo.GetType())
|
||||
srvId := int(srvInfo.GetId())
|
||||
if a, exist := ssm.sessions[areaId]; exist {
|
||||
if b, exist := a[srvType]; exist {
|
||||
if _, exist := b[srvId]; exist {
|
||||
logger.Logger.Infof("ServerSessionMgr.UnregisteSession %v success", srvInfo)
|
||||
logger.Logger.Infof("ServerSessionMgr UnregisteSession %v success", srvInfo)
|
||||
delete(b, srvId)
|
||||
if len(ssm.listeners) != 0 {
|
||||
for _, l := range ssm.listeners {
|
||||
|
@ -87,11 +87,13 @@ func (ssm *ServerSessionMgr) UnregisteSession(s *netlib.Session) bool {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
logger.Logger.Warnf("(ssm *ServerSessionMgr) UnregisteSession found not fit session, area:%v type:%v id:%v", areaId, srvType, srvId)
|
||||
logger.Logger.Warnf("ServerSessionMgr UnregisteSession found not fit session, area:%v type:%v id:%v", areaId, srvType, srvId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.Logger.Warnf("ServerSessionMgr.UnregisteSession SessionAttributeServerInfo=nil")
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ func (this *serviceMgr) RegisteService(s *netlib.Session, services []*protocol.S
|
|||
}
|
||||
if _, exist := this.servicesPool[srvtype][srvid]; !exist {
|
||||
this.servicesPool[srvtype][srvid] = service
|
||||
logger.Logger.Info("(this *serviceMgr) RegisteService: ", service.GetSrvName(), " Ip=", service.GetIp(), " Port=", service.GetPort())
|
||||
logger.Logger.Infof("ServiceMgr RegisteService Name:%v Ip:%v Port:%v", service.GetSrvName(), service.GetIp(), service.GetPort())
|
||||
pack := &protocol.SSServiceInfo{}
|
||||
pack.Service = service
|
||||
sessiontypes := GetCareSessionsByService(service.GetSrvType())
|
||||
|
@ -76,7 +76,7 @@ func (this *serviceMgr) UnregisteService(service *protocol.ServiceInfo) {
|
|||
if v, has := this.servicesPool[srvtype]; has {
|
||||
if ss, exist := v[srvid]; exist && ss == service {
|
||||
delete(v, srvid)
|
||||
logger.Logger.Info("(this *serviceMgr) UnregisteService: ", srvid)
|
||||
logger.Logger.Infof("ServiceMgr UnregisteService srvType:%v srvId:%v", srvtype, srvid)
|
||||
pack := &protocol.SSServiceShut{}
|
||||
pack.Service = service
|
||||
sessiontypes := GetCareSessionsByService(service.GetSrvType())
|
||||
|
|
Loading…
Reference in New Issue