master_huanxiang
mashiyu 2019-01-17 19:24:08 +08:00
parent 24f12c58f3
commit 03aff99c15
4 changed files with 5 additions and 27 deletions

View File

@ -4,8 +4,6 @@ option optimize_for = SPEED;
import "CommonProto.proto";
message HeroInfo{
message GetHeroInfoRequest{
optional int32 num = 1;
optional string str = 2;
@ -24,6 +22,3 @@ message HeroInfo{
message DrawHeroResponse{
repeated Hero heroList = 1;
}
}

View File

@ -4,8 +4,6 @@ option optimize_for = SPEED;
import "CommonProto.proto";
message MapInfo{
//
message MapGetInfoResponse{
// id
@ -22,6 +20,4 @@ message MapInfo{
repeated Cell mapList = 1;
//
optional int32 curXY = 2;
}
}
}

View File

@ -6,9 +6,6 @@ import "CommonProto.proto";
// request response
message PlayerInfo{
message LoginRequest{
optional int32 num = 1;
optional string openId = 2;
@ -38,6 +35,4 @@ message PlayerInfo{
message GetItemInfoResponse{
repeated Item itemlist = 1;
}
}
}

View File

@ -266,7 +266,7 @@ def code_gen_enum(enum_desc, env):
full_name = env.get_local_name()
obj_name = full_name.upper().replace('.', '_')
env.descriptor.append(
"%s = protobuf.EnumDescriptor();\n"% obj_name
"local %s = protobuf.EnumDescriptor();\n"% obj_name
)
context = Writer(obj_name)
@ -316,15 +316,7 @@ def code_gen_field(index, field_desc, env):
context('.default_value = %s\n' % default_value)
if field_desc.HasField('type_name'):
type_name = env.get_ref_name(field_desc.type_name)
try:
pos = type_name.index('_pb.') + 4
except:
pos = 0
type_name = type_name[:pos] + type_name[pos:].upper().replace('.', '_')
type_name = env.get_ref_name(field_desc.type_name).upper().replace('.', '_')
if field_desc.type == FDP.TYPE_MESSAGE:
context('.message_type = %s\n' % type_name)
else:
@ -346,7 +338,7 @@ def code_gen_message(message_descriptor, env, containing_type = None):
full_name = env.get_local_name()
obj_name = full_name.upper().replace('.', '_')
env.descriptor.append(
"%s = protobuf.Descriptor();\n"% obj_name
"local %s = protobuf.Descriptor();\n"% obj_name
)
context = Writer(obj_name)