public RavenNestClient(
            ILogger logger,
            IGameManager gameManager,
            IAppSettings settings,
            IGameCache cache)
        {
            ServicePointManager.DefaultConnectionLimit = 100;
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateCertificate);
            //ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy();

            this.logger      = logger ?? new ConsoleLogger();      //new UnityLogger();
            this.gameManager = gameManager;
            var binarySerializer = new CompressedJsonSerializer(); //new BinarySerializer();

            appSettings = settings ?? new ProductionRavenNestStreamSettings();

            tokenProvider = new TokenProvider();
            var request = new WebApiRequestBuilderProvider(logger, appSettings, tokenProvider);

            Stream      = new WebSocketEndpoint(this, gameManager, logger, settings, tokenProvider, new GamePacketSerializer(binarySerializer), cache);
            Auth        = new WebBasedAuthEndpoint(this, logger, request);
            Game        = new WebBasedGameEndpoint(this, logger, request);
            Items       = new WebBasedItemsEndpoint(this, logger, request);
            Players     = new WebBasedPlayersEndpoint(this, logger, request);
            Marketplace = new WebBasedMarketplaceEndpoint(this, logger, request);
            Village     = new WebBasedVillageEndpoint(this, logger, request);
            Admin       = new WebBasedAdminEndpoint(this, logger, request);
        }
        public RavenNestClient(
            ILogger logger,
            GameManager gameManager,
            IAppSettings settings)
        {
            ServicePointManager.DefaultConnectionLimit = 100;
            ServicePointManager.CertificatePolicy      = new NoCheckCertificatePolicy();

            this.logger      = logger ?? new UnityLogger();
            this.gameManager = gameManager;
            var binarySerializer = new BinarySerializer();

            appSettings = settings ?? new RavenNestStreamSettings();

            tokenProvider = new TokenProvider();
            var request = new WebApiRequestBuilderProvider(appSettings, tokenProvider);

            Stream      = new WebSocketEndpoint(gameManager, logger, settings, tokenProvider, new GamePacketSerializer(binarySerializer));
            Auth        = new WebBasedAuthEndpoint(this, logger, request);
            Game        = new WebBasedGameEndpoint(this, logger, request);
            Items       = new WebBasedItemsEndpoint(this, logger, request);
            Players     = new WebBasedPlayersEndpoint(this, logger, request);
            Marketplace = new WebBasedMarketplaceEndpoint(this, logger, request);
            Village     = new WebBasedVillageEndpoint(this, logger, request);
        }