Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium
New issue 355 by seewin...@gmail.com: SerializeToString question
http://code.google.com/p/protobuf/issues/detail?id=355
What steps will reproduce the problem?
message Position3D
{
required float x = 1;
required float y = 2;
required float h = 3;
}
message Speed3D
{
required float x = 1;
required float y = 2;
required float h = 3;
}
enum FacingType
{
FACE_LEFT = -1;
FACE_RIGHT = 1;
}
enum DirectionType
{
CENTER = 0;
LEFT = 8;
RIGHT = 10;
UP = 5;
DOWN = 4;
LEFTUP = 13;
LEFTDOWN = 12;
RIGHTUP = 15;
RIGHTDOWN = 14;
}
message Action {
required Position3D pos = 1;
optional Speed3D speed = 2;
optional FacingType facing_direction = 3;
optional DirectionType moving_direction = 4;
optional int32 act_id = 5;
}
message SyncActResponse
{
required int32 id = 1;
required game.Action action = 2;
}
question:
data
= '\x08\x93N\x123\n\x0f\r\x00\x00^C\x15\x00\x80\xe1C\x1d\x00\x00\x00\x00\x12\x0f\r\xcd\xcc\xcc=\x15\n\xd7#=\x1d\x00\x00\x00\x00\x18\x01
\x0e(\x02 \xff\xff\xff\xff\xff\xff\xff\xff\xff\x01'
the data is SerializeToString by one SyncActResponse object(use
cpp_message.py).
use python to ParseFromString data, it will set moving_direction property
twice. Is the data wrong? how it made?
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
--
You received this message because you are subscribed to the Google Groups "Protocol
Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.