修复CPU占用问题,添加servers.JOIN,LEAVE,LIST包
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.6
|
||||
// protoc v5.29.3
|
||||
// protoc v6.31.1
|
||||
// source: server.proto
|
||||
|
||||
package minecraft
|
||||
@ -29,6 +29,9 @@ const (
|
||||
ServerPacketType_NEW ServerPacketType = 2
|
||||
ServerPacketType_DELETE ServerPacketType = 3
|
||||
ServerPacketType_CONNECT ServerPacketType = 4
|
||||
ServerPacketType_JOIN ServerPacketType = 5
|
||||
ServerPacketType_LEAVE ServerPacketType = 6
|
||||
ServerPacketType_LIST ServerPacketType = 7
|
||||
)
|
||||
|
||||
// Enum value maps for ServerPacketType.
|
||||
@ -39,6 +42,9 @@ var (
|
||||
2: "NEW",
|
||||
3: "DELETE",
|
||||
4: "CONNECT",
|
||||
5: "JOIN",
|
||||
6: "LEAVE",
|
||||
7: "LIST",
|
||||
}
|
||||
ServerPacketType_value = map[string]int32{
|
||||
"PING": 0,
|
||||
@ -46,6 +52,9 @@ var (
|
||||
"NEW": 2,
|
||||
"DELETE": 3,
|
||||
"CONNECT": 4,
|
||||
"JOIN": 5,
|
||||
"LEAVE": 6,
|
||||
"LIST": 7,
|
||||
}
|
||||
)
|
||||
|
||||
@ -308,6 +317,102 @@ func (x *ServerConnectPacket) GetPlayer() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
type ServerPlayerPacket struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Player string `protobuf:"bytes,1,opt,name=player,proto3" json:"player,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ServerPlayerPacket) Reset() {
|
||||
*x = ServerPlayerPacket{}
|
||||
mi := &file_server_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ServerPlayerPacket) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ServerPlayerPacket) ProtoMessage() {}
|
||||
|
||||
func (x *ServerPlayerPacket) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_server_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServerPlayerPacket.ProtoReflect.Descriptor instead.
|
||||
func (*ServerPlayerPacket) Descriptor() ([]byte, []int) {
|
||||
return file_server_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ServerPlayerPacket) GetPlayer() string {
|
||||
if x != nil {
|
||||
return x.Player
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ServerListPacket struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ServerId string `protobuf:"bytes,1,opt,name=serverId,proto3" json:"serverId,omitempty"`
|
||||
Players []string `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *ServerListPacket) Reset() {
|
||||
*x = ServerListPacket{}
|
||||
mi := &file_server_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *ServerListPacket) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ServerListPacket) ProtoMessage() {}
|
||||
|
||||
func (x *ServerListPacket) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_server_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ServerListPacket.ProtoReflect.Descriptor instead.
|
||||
func (*ServerListPacket) Descriptor() ([]byte, []int) {
|
||||
return file_server_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ServerListPacket) GetServerId() string {
|
||||
if x != nil {
|
||||
return x.ServerId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ServerListPacket) GetPlayers() []string {
|
||||
if x != nil {
|
||||
return x.Players
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_server_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_server_proto_rawDesc = "" +
|
||||
@ -329,14 +434,22 @@ const file_server_proto_rawDesc = "" +
|
||||
"\bserverId\x18\x01 \x01(\tR\bserverId\"I\n" +
|
||||
"\x13ServerConnectPacket\x12\x1a\n" +
|
||||
"\bserverId\x18\x01 \x01(\tR\bserverId\x12\x16\n" +
|
||||
"\x06player\x18\x02 \x01(\tR\x06player*H\n" +
|
||||
"\x06player\x18\x02 \x01(\tR\x06player\",\n" +
|
||||
"\x12ServerPlayerPacket\x12\x16\n" +
|
||||
"\x06player\x18\x01 \x01(\tR\x06player\"H\n" +
|
||||
"\x10ServerListPacket\x12\x1a\n" +
|
||||
"\bserverId\x18\x01 \x01(\tR\bserverId\x12\x18\n" +
|
||||
"\aplayers\x18\x02 \x03(\tR\aplayers*g\n" +
|
||||
"\x10ServerPacketType\x12\b\n" +
|
||||
"\x04PING\x10\x00\x12\b\n" +
|
||||
"\x04PONG\x10\x01\x12\a\n" +
|
||||
"\x03NEW\x10\x02\x12\n" +
|
||||
"\n" +
|
||||
"\x06DELETE\x10\x03\x12\v\n" +
|
||||
"\aCONNECT\x10\x04B\x12Z\x10router/minecraftb\x06proto3"
|
||||
"\aCONNECT\x10\x04\x12\b\n" +
|
||||
"\x04JOIN\x10\x05\x12\t\n" +
|
||||
"\x05LEAVE\x10\x06\x12\b\n" +
|
||||
"\x04LIST\x10\aB\x12Z\x10router/minecraftb\x06proto3"
|
||||
|
||||
var (
|
||||
file_server_proto_rawDescOnce sync.Once
|
||||
@ -351,13 +464,15 @@ func file_server_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_server_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_server_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_server_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_server_proto_goTypes = []any{
|
||||
(ServerPacketType)(0), // 0: ServerPacketType
|
||||
(*ServerPacket)(nil), // 1: ServerPacket
|
||||
(*ServerNewPacket)(nil), // 2: ServerNewPacket
|
||||
(*ServerDeletePacket)(nil), // 3: ServerDeletePacket
|
||||
(*ServerConnectPacket)(nil), // 4: ServerConnectPacket
|
||||
(*ServerPlayerPacket)(nil), // 5: ServerPlayerPacket
|
||||
(*ServerListPacket)(nil), // 6: ServerListPacket
|
||||
}
|
||||
var file_server_proto_depIdxs = []int32{
|
||||
0, // 0: ServerPacket.typ:type_name -> ServerPacketType
|
||||
@ -380,7 +495,7 @@ func file_server_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_server_proto_rawDesc), len(file_server_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 4,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
Reference in New Issue
Block a user