master_huanxiang
parent
24f12c58f3
commit
03aff99c15
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue