oniksan / godobuf

A Google Protobuf implementation for Godot / GDScript
BSD 3-Clause "New" or "Revised" License
260 stars 36 forks source link

oneof Custom type not supported #33

Open rr13k opened 1 year ago

rr13k commented 1 year ago
message Ping {
    int64 sent_at = 1;
}

message Pong {
    int64 ping_sent_at = 1;
    int64 received_at = 2;
    int64 sent_at = 3;
}

message api_message {
    oneof notice_way {
        Ping ping = 1;
        Pong pong = 2;
    }
    string name = 7;
}
var test2 = apiProto.api_message.new()
test2.set_name("asdad")
test2.set_ping() # miss func

How to fill in values for custom types?

rr13k commented 1 year ago

The foundation type of oneof is possible and only appears in customization, Praising your great work at the same time

oniksan commented 1 year ago

Hi @rr13k ! Are you tried to use new_ping? - It's a Message, not a Scalar. See https://github.com/oniksan/godobuf#7-message

rcorre commented 10 months ago

Oneof messages work for me with test2.new_ping().set_sent_at(1234)