Ejemplo n.º 1
0
 public ExchangeRequestPackettHandler(IExchangeProvider exchangeProvider, ILogger logger,
                                      IBlacklistHttpClient blacklistHttpClient)
 {
     _exchangeProvider    = exchangeProvider;
     _logger              = logger;
     _blacklistHttpClient = blacklistHttpClient;
 }
Ejemplo n.º 2
0
        public ClientSession(ServerConfiguration configuration, IEnumerable <IPacketController> packetControllers,
                             IMapInstanceProvider mapInstanceProvider, IExchangeProvider exchangeProvider, ILogger logger) : base(logger)
        {
            _logger = logger;

            if (configuration is WorldConfiguration worldConfiguration)
            {
                WorldConfiguration   = worldConfiguration;
                _mapInstanceProvider = mapInstanceProvider;
                _exchangeProvider    = exchangeProvider;
                _isWorldClient       = true;
            }

            foreach (var controller in packetControllers)
            {
                controller.RegisterSession(this);
                foreach (var methodInfo in controller.GetType().GetMethods().Where(x =>
                                                                                   typeof(PacketDefinition).IsAssignableFrom(x.GetParameters().FirstOrDefault()?.ParameterType)))
                {
                    var type         = methodInfo.GetParameters().FirstOrDefault()?.ParameterType;
                    var packetheader = (PacketHeaderAttribute)Array.Find(type?.GetCustomAttributes(true),
                                                                         ca => ca.GetType() == typeof(PacketHeaderAttribute));
                    _headerMethod.Add(packetheader, new Tuple <IPacketController, Type>(controller, type));
                    _controllerMethods.Add(packetheader,
                                           DelegateBuilder.BuildDelegate <Action <object, object> >(methodInfo));
                }
            }
        }
Ejemplo n.º 3
0
        public ClientSession(ServerConfiguration configuration, IMapInstanceProvider?mapInstanceProvider,
                             IExchangeProvider?exchangeProvider, ILogger logger,
                             IEnumerable <IPacketHandler> packetsHandlers, IFriendHttpClient friendHttpClient,
                             ISerializer packetSerializer, IPacketHttpClient packetHttpClient,
                             IMinilandProvider?minilandProvider) : base(logger)
        {
            _logger           = logger;
            _packetsHandlers  = packetsHandlers.ToList();
            _friendHttpClient = friendHttpClient;
            _packetSerializer = packetSerializer;
            _packetHttpClient = packetHttpClient;
            if (!(configuration is WorldConfiguration worldConfiguration))
            {
                return;
            }

            WorldConfiguration   = worldConfiguration;
            _mapInstanceProvider = mapInstanceProvider !;
            _exchangeProvider    = exchangeProvider !;
            _minilandProvider    = minilandProvider !;
            _isWorldClient       = true;
            foreach (var handler in _packetsHandlers)
            {
                var type = handler.GetType().BaseType?.GenericTypeArguments[0] !;
                if (!_attributeDic.ContainsKey(type ?? throw new InvalidOperationException()))
                {
                    _attributeDic.Add(type, type.GetCustomAttribute <PacketHeaderAttribute>(true) !);
                }
            }
        }
Ejemplo n.º 4
0
 public ClientSession(IOptions <WorldConfiguration> configuration, IMapInstanceProvider?mapInstanceProvider,
                      IExchangeProvider?exchangeProvider, ILogger logger,
                      IEnumerable <IPacketHandler> packetsHandlers, IFriendHttpClient friendHttpClient,
                      ISerializer packetSerializer, IPacketHttpClient packetHttpClient,
                      IMinilandProvider?minilandProvider) : this(logger, packetsHandlers, friendHttpClient, packetSerializer, packetHttpClient)
 {
     _mapInstanceProvider = mapInstanceProvider !;
     _exchangeProvider    = exchangeProvider !;
     _minilandProvider    = minilandProvider !;
     _isWorldClient       = true;
 }
Ejemplo n.º 5
0
        public EthMacdStrategy(IOptions <MacdStrategyOptions> options, IIndicatorFactory indicatorFactory, IExchangeProvider exchangeProvider)
        {
            _exchangeProvider   = exchangeProvider;
            _options            = options.Value;
            _shortEmaIndicator  = indicatorFactory.GetEmaIndicator(_options.ShortWeight);
            _longEmaIndicator   = indicatorFactory.GetEmaIndicator(_options.LongWeight);
            _signalEmaIndicator = indicatorFactory.GetEmaIndicator(_options.Signal);

            _macdStatistcsQueue      = new FixedSizedQueue <MacdStatistic>(6);
            _macdTempStatisticsQueue = new FixedSizedQueue <MacdStatistic>(200);
            _volumenQueue            = new FixedSizedQueue <decimal>(100);
        }
Ejemplo n.º 6
0
        public CustomBtcStrategy(IOptions <MacdStrategyOptions> options, IIndicatorFactory indicatorFactory, IExchangeProvider exchangeProvider)
        {
            _exchangeProvider   = exchangeProvider;
            _options            = options.Value;
            _shortEmaIndicator  = indicatorFactory.GetEmaIndicator(_options.ShortWeight);
            _longEmaIndicator   = indicatorFactory.GetEmaIndicator(_options.LongWeight);
            _signalEmaIndicator = indicatorFactory.GetEmaIndicator(_options.Signal);

            _ichimokuCloudIndicator = indicatorFactory.GetIchimokuCloud();

            _volumenQueue = new FixedSizedQueue <decimal>(100);
        }
Ejemplo n.º 7
0
 public HotToursNotifierService(
     IUnitOfWork unitOfWork,
     IExchangeProvider exchangeProvider,
     ITelegramBotClient telegram,
     IHotTourFoundRepository cache,
     ILogger <HotToursNotifierService> logger)
 {
     _unitOfWork       = unitOfWork;
     _exchangeProvider = exchangeProvider;
     _telegram         = telegram;
     _cache            = cache;
     _logger           = logger;
 }
Ejemplo n.º 8
0
 public RealTimeTraderService(IStrategy strategy,
                              IUserBalanceService userBalanceService,
                              IExchangeProvider exchangeProvider,
                              ICandleRepository candleRepository,
                              IEmailService emailService,
                              IOptions <CryptoTradingOptions> options)
 {
     _strategy             = strategy;
     _userBalanceService   = userBalanceService;
     _exchangeProvider     = exchangeProvider;
     _candleRepository     = candleRepository;
     _emailService         = emailService;
     _cryptoTradingOptions = options.Value;
 }
Ejemplo n.º 9
0
 public Character(IInventoryService inventory, IExchangeProvider exchangeProvider, IItemProvider itemProvider,
                  IDao <CharacterDto, long> characterDao, IDao <IItemInstanceDto?, Guid> itemInstanceDao,
                  IDao <InventoryItemInstanceDto, Guid> inventoryItemInstanceDao, IDao <AccountDto, long> accountDao,
                  ILogger logger, IDao <StaticBonusDto, long> staticBonusDao,
                  IDao <QuicklistEntryDto, Guid> quicklistEntriesDao, IDao <MinilandDto, Guid> minilandDao,
                  IMinilandProvider minilandProvider, IDao <TitleDto, Guid> titleDao, IDao <CharacterQuestDto, Guid> characterQuestDao,
                  IHpService hpService, IMpService mpService, IExperienceService experienceService, IJobExperienceService jobExperienceService, IHeroExperienceService heroExperienceService, ISpeedService speedService,
                  IReputationService reputationService, IDignityService dignityService, IOptions <WorldConfiguration> worldConfiguration)
 {
     InventoryService         = inventory;
     ExchangeProvider         = exchangeProvider;
     ItemProvider             = itemProvider;
     GroupRequestCharacterIds = new ConcurrentDictionary <long, long>();
     Group                     = new Group(GroupType.Group);
     Requests                  = new Subject <RequestData>();
     _characterDao             = characterDao;
     _itemInstanceDao          = itemInstanceDao;
     _accountDao               = accountDao;
     _logger                   = logger;
     _inventoryItemInstanceDao = inventoryItemInstanceDao;
     _staticBonusDao           = staticBonusDao;
     _titleDao                 = titleDao;
     QuicklistEntries          = new List <QuicklistEntryDto>();
     _quicklistEntriesDao      = quicklistEntriesDao;
     _characterQuestsDao       = characterQuestDao;
     _minilandDao              = minilandDao;
     _minilandProvider         = minilandProvider;
     _hpService                = hpService;
     _mpService                = mpService;
     _experienceService        = experienceService;
     _jobExperienceService     = jobExperienceService;
     _heroExperienceService    = heroExperienceService;
     _speedService             = speedService;
     _reputationService        = reputationService;
     _dignityService           = dignityService;
     _worldConfiguration       = worldConfiguration;
 }
Ejemplo n.º 10
0
 public ExchangeCommand(IExchangeProvider provider)
 {
     Exchange = provider;
 }
 public TransactionViewBuilder(IExchangeProvider exchangeProviderPerYear, IExchangeProvider exchangeProviderPerDay)
 {
     this.exchangeProviderPerYear = exchangeProviderPerYear ?? throw new ArgumentNullException(nameof(exchangeProviderPerYear));
     this.exchangeProviderPerDay  = exchangeProviderPerDay ?? throw new ArgumentNullException(nameof(exchangeProviderPerDay));
 }
Ejemplo n.º 12
0
 public ExcListPacketHandler(IExchangeProvider exchangeProvider, ILogger logger)
 {
     _exchangeProvider = exchangeProvider;
     _logger           = logger;
 }
Ejemplo n.º 13
0
        public static async Task <IDictionary <DateTime, ICurrencyList> > FetchCurrencyListsForDatesAsync(this IExchangeProvider exchangeProvider, ISet <DateTime> dates)
        {
            var output = new Dictionary <DateTime, ICurrencyList>();

            foreach (var date in dates)
            {
                output.Add(date, await exchangeProvider.FetchCurrencyListByDateAsync(date));
            }

            return(output);
        }
Ejemplo n.º 14
0
 public ExchangePacketController(WorldConfiguration worldConfiguration, IExchangeProvider exchangeProvider, ILogger logger)
 {
     _worldConfiguration = worldConfiguration;
     _exchangeProvider   = exchangeProvider;
     _logger             = logger;
 }
Ejemplo n.º 15
0
 public ImportRepository(IExchangeProvider exchangeProvider, ICandleRepository candleDbRepository)
 {
     _exchangeProvider   = exchangeProvider;
     _candleDbRepository = candleDbRepository;
 }
 public SettingsCurrencyCommandHandler(
     IUnitOfWork unitOfWork,
     ITelegramBotClient client,
     IExchangeProvider exchange)
     : base(unitOfWork, client) =>
Ejemplo n.º 17
0
 public ClientSession(ServerConfiguration configuration, IEnumerable <IPacketController> packetControllers,
                      IMapInstanceProvider mapInstanceProvider, IExchangeProvider exchangeProvider) : this(configuration, packetControllers)
 {
     _mapInstanceProvider = mapInstanceProvider;
     _exchangeProvider    = exchangeProvider;
 }
Ejemplo n.º 18
0
 public GetExchangeQueryHandler(IExchangeProvider provider) =>
Ejemplo n.º 19
0
 public CurrencyParser(IExchangeProvider exchangeProvider)
 {
 }
 public ExchangeHostedService(
     ILogger <ExchangeHostedService> logger,
     IExchangeProvider exchangeProvider,
     IServiceScopeFactory scopeFactory)
     : base(logger, scopeFactory) =>