Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

about 'optional' field . #48

Open
dhb118 opened this issue Jan 8, 2015 · 2 comments
Open

about 'optional' field . #48

dhb118 opened this issue Jan 8, 2015 · 2 comments

Comments

@dhb118
Copy link

dhb118 commented Jan 8, 2015

the message like this:
message Role{
optional int32 fieldA = 1;
}

i got message from server, but server didn't packed 'fieldA' everytime .
so how did know if 'fieldA' exist by lua code ?

@cloudwu
Copy link
Owner

cloudwu commented Jan 8, 2015

FieldA has a type int32, it must be a value with this type any time.
If the value equal the default value, the implemention would not encode it.

read the document of google protocol buffers for more detail.

发自我的 iPad

在 2015年1月8日,下午5:19,dhb118 notifications@github.com 写道:

the message like this:
message Role{
optional int32 fieldA = 1;
}

i got message from server, but server didn't packed 'fieldA' everytime .
so how did know if 'fieldA' exist by lua code ?


Reply to this email directly or view it on GitHub.

@dhb118
Copy link
Author

dhb118 commented Jan 8, 2015

thanks @cloudwu

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants