Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oneof command #47

Open
grzywkarafal opened this issue Oct 9, 2024 · 0 comments
Open

oneof command #47

grzywkarafal opened this issue Oct 9, 2024 · 0 comments

Comments

@grzywkarafal
Copy link

is it possible to serialize in such case?

syntax = "proto3";

message GameMessage {
  oneof command {
      AccountLogin accountLogin = 1;
    }
}


message AccountLogin {
  string username = 1;
  string password = 2; 
}
I tried like this:
var game_message = protocol.GameMessage.new()

var account_login = game_message.new_accountLogin()

account_login.set_username("a")
account_login.set_password("a")

print(game_message.to_string())
var serialized_data = account_login.to_bytes()

but it looks like there is no packaging in oneof

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

No branches or pull requests

1 participant