コード例 #1
0
 public ExchangeRequestPackettHandler(IExchangeProvider exchangeProvider, ILogger logger,
                                      IBlacklistHttpClient blacklistHttpClient)
 {
     _exchangeProvider    = exchangeProvider;
     _logger              = logger;
     _blacklistHttpClient = blacklistHttpClient;
 }
コード例 #2
0
ファイル: ClientSession.cs プロジェクト: lwp001/NosCore
        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));
                }
            }
        }
コード例 #3
0
ファイル: ClientSession.cs プロジェクト: serodyx/NosCore
        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) !);
                }
            }
        }
コード例 #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;
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #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;
 }
コード例 #10
0
ファイル: ExchangeCommand.cs プロジェクト: treverson/prime
 public ExchangeCommand(IExchangeProvider provider)
 {
     Exchange = provider;
 }
コード例 #11
0
 public TransactionViewBuilder(IExchangeProvider exchangeProviderPerYear, IExchangeProvider exchangeProviderPerDay)
 {
     this.exchangeProviderPerYear = exchangeProviderPerYear ?? throw new ArgumentNullException(nameof(exchangeProviderPerYear));
     this.exchangeProviderPerDay  = exchangeProviderPerDay ?? throw new ArgumentNullException(nameof(exchangeProviderPerDay));
 }
コード例 #12
0
 public ExcListPacketHandler(IExchangeProvider exchangeProvider, ILogger logger)
 {
     _exchangeProvider = exchangeProvider;
     _logger           = logger;
 }
コード例 #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);
        }
コード例 #14
0
 public ExchangePacketController(WorldConfiguration worldConfiguration, IExchangeProvider exchangeProvider, ILogger logger)
 {
     _worldConfiguration = worldConfiguration;
     _exchangeProvider   = exchangeProvider;
     _logger             = logger;
 }
コード例 #15
0
 public ImportRepository(IExchangeProvider exchangeProvider, ICandleRepository candleDbRepository)
 {
     _exchangeProvider   = exchangeProvider;
     _candleDbRepository = candleDbRepository;
 }
コード例 #16
0
 public SettingsCurrencyCommandHandler(
     IUnitOfWork unitOfWork,
     ITelegramBotClient client,
     IExchangeProvider exchange)
     : base(unitOfWork, client) =>
コード例 #17
0
 public ClientSession(ServerConfiguration configuration, IEnumerable <IPacketController> packetControllers,
                      IMapInstanceProvider mapInstanceProvider, IExchangeProvider exchangeProvider) : this(configuration, packetControllers)
 {
     _mapInstanceProvider = mapInstanceProvider;
     _exchangeProvider    = exchangeProvider;
 }
コード例 #18
0
 public GetExchangeQueryHandler(IExchangeProvider provider) =>
コード例 #19
0
 public CurrencyParser(IExchangeProvider exchangeProvider)
 {
 }
コード例 #20
0
 public ExchangeHostedService(
     ILogger <ExchangeHostedService> logger,
     IExchangeProvider exchangeProvider,
     IServiceScopeFactory scopeFactory)
     : base(logger, scopeFactory) =>