NakamaGrpcClient constructor
NakamaGrpcClient({})
Implementation
NakamaGrpcClient({
required this.host,
this.port = 7349,
required this.ssl,
required String serverKey,
}) {
this.serverKey = 'Basic ${base64Encode('$serverKey:'.codeUnits)}';
_log.info('Connecting to $host:$port');
_channel = ClientChannel(
host,
port: port,
options: ChannelOptions(
credentials: ssl == true
? const ChannelCredentials.secure()
: const ChannelCredentials.insecure(),
),
);
_client = NakamaClient(
_channel,
options: CallOptions(metadata: {'authorization': this.serverKey}),
);
}