public async Task <PlayerGameItem> GetCurrentPlayerInstance() { Channel channel = ChannelFactory.GetChannel(); var client = new UserInfo.UserInfoClient(channel); var reply = await client.GetUserInfoAsync(new Google.Protobuf.WellKnownTypes.Empty()); channel.ShutdownAsync().Wait(); PlayerGameItem player = new PlayerGameItem(); player.Id = reply.Uid; player.CustomName = reply.Nickname; return(player); }
public void TestRpc2() { try { Channel channel = ChannelFactory.GetChannel(); var client = new UserInfo.UserInfoClient(channel); var reply = client.GetUserInfo(new Google.Protobuf.WellKnownTypes.Empty()); channel.ShutdownAsync().Wait(); Debug.Log(JsonConvert.SerializeObject(reply)); } catch (System.Exception e) { Debug.Log(e.Message); } }