This commit is contained in:
sk 2024-08-08 18:29:09 +08:00
parent 677abd6684
commit 5f2585b78d
3 changed files with 273 additions and 0 deletions

View File

@ -5,6 +5,7 @@
- 2000~4999 client->worldsrv
- 5000~9999 client->gamesrv
- 10000~12000 client->ranksrv
- 20000~29999 gamesrv->machine
--------------------------------------
# worldsrv

View File

@ -0,0 +1,256 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1-devel
// protoc v3.19.4
// source: machine.proto
package machine
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 PacketID int32
const (
PacketID_Zero PacketID = 0 // 弃用消息号
PacketID_Test PacketID = 20000 // 测试
)
// Enum value maps for PacketID.
var (
PacketID_name = map[int32]string{
0: "Zero",
20000: "Test",
}
PacketID_value = map[string]int32{
"Zero": 0,
"Test": 20000,
}
)
func (x PacketID) Enum() *PacketID {
p := new(PacketID)
*p = x
return p
}
func (x PacketID) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PacketID) Descriptor() protoreflect.EnumDescriptor {
return file_machine_proto_enumTypes[0].Descriptor()
}
func (PacketID) Type() protoreflect.EnumType {
return &file_machine_proto_enumTypes[0]
}
func (x PacketID) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PacketID.Descriptor instead.
func (PacketID) EnumDescriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{0}
}
// Test
type CSTest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ts int64 `protobuf:"varint,1,opt,name=Ts,proto3" json:"Ts,omitempty"`
}
func (x *CSTest) Reset() {
*x = CSTest{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CSTest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CSTest) ProtoMessage() {}
func (x *CSTest) ProtoReflect() protoreflect.Message {
mi := &file_machine_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 CSTest.ProtoReflect.Descriptor instead.
func (*CSTest) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{0}
}
func (x *CSTest) GetTs() int64 {
if x != nil {
return x.Ts
}
return 0
}
type SCTest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ts int64 `protobuf:"varint,1,opt,name=Ts,proto3" json:"Ts,omitempty"`
}
func (x *SCTest) Reset() {
*x = SCTest{}
if protoimpl.UnsafeEnabled {
mi := &file_machine_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SCTest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SCTest) ProtoMessage() {}
func (x *SCTest) ProtoReflect() protoreflect.Message {
mi := &file_machine_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 SCTest.ProtoReflect.Descriptor instead.
func (*SCTest) Descriptor() ([]byte, []int) {
return file_machine_proto_rawDescGZIP(), []int{1}
}
func (x *SCTest) GetTs() int64 {
if x != nil {
return x.Ts
}
return 0
}
var File_machine_proto protoreflect.FileDescriptor
var file_machine_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x07, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x22, 0x18, 0x0a, 0x06, 0x43, 0x53, 0x54, 0x65,
0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,
0x54, 0x73, 0x22, 0x18, 0x0a, 0x06, 0x53, 0x43, 0x54, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02,
0x54, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x54, 0x73, 0x2a, 0x20, 0x0a, 0x08,
0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x08, 0x0a, 0x04, 0x5a, 0x65, 0x72, 0x6f,
0x10, 0x00, 0x12, 0x0a, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x10, 0xa0, 0x9c, 0x01, 0x42, 0x27,
0x5a, 0x25, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f,
0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_machine_proto_rawDescOnce sync.Once
file_machine_proto_rawDescData = file_machine_proto_rawDesc
)
func file_machine_proto_rawDescGZIP() []byte {
file_machine_proto_rawDescOnce.Do(func() {
file_machine_proto_rawDescData = protoimpl.X.CompressGZIP(file_machine_proto_rawDescData)
})
return file_machine_proto_rawDescData
}
var file_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_machine_proto_goTypes = []interface{}{
(PacketID)(0), // 0: machine.PacketID
(*CSTest)(nil), // 1: machine.CSTest
(*SCTest)(nil), // 2: machine.SCTest
}
var file_machine_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_machine_proto_init() }
func file_machine_proto_init() {
if File_machine_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_machine_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSTest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_machine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCTest); 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_machine_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_machine_proto_goTypes,
DependencyIndexes: file_machine_proto_depIdxs,
EnumInfos: file_machine_proto_enumTypes,
MessageInfos: file_machine_proto_msgTypes,
}.Build()
File_machine_proto = out.File
file_machine_proto_rawDesc = nil
file_machine_proto_goTypes = nil
file_machine_proto_depIdxs = nil
}

View File

@ -0,0 +1,16 @@
syntax = "proto3";
package machine;
option go_package = "mongo.games.com/game/protocol/machine";
enum PacketID {
Zero = 0;//
Test = 20000; //
}
// Test
message CSTest {
int64 Ts = 1;
}
message SCTest {
int64 Ts = 1;
}