Пример #1
0
 public Client(IClientConfig config, Version octgnVersion)
 {
     _config = config;
     _clientAuthenticator = new ClientAuthenticator();
     _client = new Octgn.Communication.Client(_config.CreateConnection(_config.ChatHost), new Octgn.Communication.Serializers.XmlSerializer(), _clientAuthenticator);
     _client.InitializeSubscriptionModule();
     _client.InitializeHosting(octgnVersion);
 }
Пример #2
0
        public async Task <AuthenticationResult> Authenticate(Octgn.Communication.Client client, IConnection connection, CancellationToken cancellationToken)
        {
            var req = new Octgn.Communication.Packets.AuthenticationRequestPacket("session");

            req["sessionKey"] = SessionKey;
            req["userId"]     = UserId;
            req["deviceId"]   = DeviceId;

            var result = await client.Request(req, cancellationToken);

            return(result.As <AuthenticationResult>());
        }