I wonder if there are any reasons to why this would fail to parse on
the Server side of a game which a few friends me are making.

||Protocol:

package net_protocol;

//Login Protocol 2
message LoginInfo {
        required string name = 1;
        required string password = 2;
}

//Message Protocol 3
message ChatMessage {
        required string name = 1;
        required string body = 2;
}

//The Protocol Main
message NMessage {
        required int32 type = 1;
        optional LoginInfo type2 = 2;
        optional ChatMessage type3 = 3;
}

||Code which sends the Protocol:
      net_protocol::NMessage Msg;
      Msg.set_type( Network::MsgType::RECIEVE_LOGIN_INFO );

    net_protocol::LoginInfo *LoginInfos;
      LoginInfos = Msg.mutable_type2();
      LoginInfos->set_name( this->name->GetValue().c_str() );
      LoginInfos->set_password( this->password->GetValue().c_str() );
      //Send away it here with some Network stuff

When the server gets that and tries to parse it so does it autofail.
Just sending the NMessage without any optional structures work fine.

And the documentation are vague at it's best to describe how to use
optional messages.

I would be grateful if someone could give me more insight on this :).
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to