Send data from a Lua server module to clients using protobuf

I use nk.json_encode() to send messages to the clients in my game. I’d like to reduce the amount of data by encoding the message with protobuf instead. First, would this be possible with Nakama? If so, is there an example of how to do this somewhere?

I’ve searched for this but not found anything. I suppose using a Lua module of an external library is one option, but I was hoping for something similar to nk.json_encode().

@totebo We’ve had a bunch of requests to provide a built-in utility to handle encode/decode of Protobuf and FlatBuffers. We already have an example of how to use Protobuf with Go code but for the TypeScript/JavaScript support and the Lua runtime we’d need to extend the runtime to officially handle the codec.

I think it’d be good to open a feature request for this on the GitHub repository.

1 Like

Thanks @novabyte ! I’ve added an issue here:

Feature request: Runtime support Protobuf support · Issue #579 · heroiclabs/nakama · GitHub

Let me know if more context is needed.

1 Like