Protobuf and REST API

Hi.
How nakama use protobuf and rest api together?
How clients connect by rest api while they dont serialize requests as protobuf?

@nkadd The questions aren’t clear to me. I’m not sure what exactly you want to use Protobuf for? I’ll try to answer as much as I can anyway.

How nakama use protobuf and rest api together?

Nakama can use Protobuf direct with the GRPC API we provide already if the client sdk supports it but for wider compatibility we also provide support for REST (with JSON messages).

How clients connect by rest api while they dont serialize requests as protobuf?

The client sdks which connect over port 7350 use the REST API but if 7349 is used it’s expected to be GRPC (which is Protobuf and HTTP/2). What we do internally is take the JSON message on the 7350 port and convert it to the Protobuf message to process it. The server logic always uses protocol buffers within the core engine.

For realtime multiplayer (both client-relayed and authoritative multiplayer) your data protocol can be developed as binary code or whatever format you prefer. We usually use Protobuf but you can use JSON, FlatBuffers, or any other format you want to use.

Thanks for Reply.

I am talking about server Side. I have installed Nakama code from Master Respository and trying to build

but given below files and folders are missing in Nakama Repository

github.com/heroiclabs/nakama-common/api
github.com/heroiclabs/nakama-common/api/api.proto;

So please suggest how to build code on server side.

Thanks & Regards,
Rajesj

@rajesh.jakhar You can follow the instructions on the README on how to build the game server from source:

https://github.com/heroiclabs/nakama#contribute

You shouldn’t need to build from source unless you want to contribute back to the codebase. If you want to extend the game server with custom logic have a look at the server runtime which lets you load code at runtime:

Thanks for reply.

I have one more question on same game server build

Which Go and Protoc Version is required to builld source code.

I have go1.14 version installed on my system.

Thanks & Regards,
Rajesh