Пример #1
0
        private static bool UpdateOriginalFeeds()
        {
            try
            {
                string        iSoftBetHash     = string.Empty;
                List <string> listISoftBetHash = new List <string>();

                ceDomainConfigEx systemDomain = new ceDomainConfigEx()
                {
                    DomainID = Constant.SystemDomainID,
                };

                ParseXProLiveCasinoGameList(systemDomain);

                //iSoftBetHash = ISoftBetIntegration.GameMgt.GetFeedsIdentifier(systemDomain);
                //ISoftBetIntegration.GameMgt.LoadRawGameFeeds(systemDomain);
                //if (!string.IsNullOrWhiteSpace(iSoftBetHash))
                //    listISoftBetHash.Add(iSoftBetHash);

                List <ceDomainConfigEx>    domains           = DomainManager.GetDomains();
                CasinoVendorAccessor       cva               = CasinoVendorAccessor.CreateInstance <CasinoVendorAccessor>();
                ChangeNotificationAccessor cna               = ChangeNotificationAccessor.CreateInstance <ChangeNotificationAccessor>();
                List <VendorID>            liveCasinoVendors = new List <VendorID>()
                {
                    VendorID.EvolutionGaming, VendorID.XProGaming
                };

                foreach (ceDomainConfigEx domain in domains)
                {
                    if (domain.DomainID == Constant.SystemDomainID)
                    {
                        continue;
                    }

                    List <VendorID> vendors = cva.GetLiveCasinoVendors(domain.DomainID);

                    if (!vendors.Exists(v => liveCasinoVendors.Contains(v)))
                    {
                        continue;
                    }

                    //iSoftBetHash = ISoftBetIntegration.GameMgt.GetFeedsIdentifier(domain);
                    //if (!string.IsNullOrWhiteSpace(iSoftBetHash) && !listISoftBetHash.Exists(h => h == iSoftBetHash))
                    //{
                    //    ISoftBetIntegration.GameMgt.LoadRawGameFeeds(domain);
                    //    listISoftBetHash.Add(iSoftBetHash);
                    //}

                    long xproGamesHash = 0L;
                    if (vendors.Exists(v => v == VendorID.XProGaming))
                    {
                        xproGamesHash = (long)ParseXProLiveCasinoGameList(domain);
                    }

                    long tableStatusHash = (long)GetLiveCasinoTableStatusHash(domain);

                    if (tableStatusHash > 0L || xproGamesHash > 0L)
                    {
                        ceChangeNotification notification = cna.GetLastSuccessfulChangeNotification(domain.DomainID
                                                                                                    , ChangeType.LiveCasinoTableList.ToString()
                                                                                                    , DateTime.Now.AddHours(-1)
                                                                                                    );
                        if (notification != null &&
                            notification.HashValue1 == xproGamesHash &&
                            notification.HashValue2 == tableStatusHash)
                        {
                            continue;
                        }

                        string error;
                        bool   success = Send(domain, ChangeType.LiveCasinoTableList, out error);

                        SqlQuery <ceChangeNotification> query = new SqlQuery <ceChangeNotification>();
                        notification            = new ceChangeNotification();
                        notification.Ins        = DateTime.Now;
                        notification.DomainID   = domain.DomainID;
                        notification.Succeeded  = success;
                        notification.Type       = ChangeType.LiveCasinoTableList.ToString();
                        notification.HashValue1 = xproGamesHash;
                        notification.HashValue2 = tableStatusHash;
                        query.Insert(notification);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Exception(ex);
                return(false);
            }

            return(true);
        }
Пример #2
0
        private static bool ReloadNetentOriginalFeeds()
        {
            try
            {
                ulong netentFeedURLHash = 0;
                Dictionary <ulong, bool> dicNetentFeedURLHash = new Dictionary <ulong, bool>();

                ceDomainConfigEx systemDomain = new ceDomainConfigEx()
                {
                    DomainID = Constant.SystemDomainID,
                };

                ParseNetEntLiveCasinoTableList(systemDomain);
                netentFeedURLHash = CRC64.ComputeAsUtf8String(systemDomain.GetCfg(CE.DomainConfig.NetEnt.LiveCasinoQueryOpenTablesApiURL));
                dicNetentFeedURLHash.Add(netentFeedURLHash, true);

                List <ceDomainConfigEx>    domains = DomainManager.GetDomains();
                CasinoVendorAccessor       cva     = CasinoVendorAccessor.CreateInstance <CasinoVendorAccessor>();
                ChangeNotificationAccessor cna     = ChangeNotificationAccessor.CreateInstance <ChangeNotificationAccessor>();

                foreach (ceDomainConfigEx domain in domains)
                {
                    if (domain.DomainID == Constant.SystemDomainID)
                    {
                        continue;
                    }

                    List <VendorID> vendors = cva.GetLiveCasinoVendors(domain.DomainID);

                    if (!vendors.Exists(v => v == VendorID.NetEnt))
                    {
                        continue;
                    }

                    long hash1 = (long)CRC64.ComputeAsUtf8String(VendorID.NetEnt.ToString());
                    long hash2 = 0L;
                    netentFeedURLHash = CRC64.ComputeAsUtf8String(domain.GetCfg(CE.DomainConfig.NetEnt.LiveCasinoQueryOpenTablesApiURL));
                    if (!dicNetentFeedURLHash.Keys.Contains(netentFeedURLHash))
                    {
                        dicNetentFeedURLHash.Add(netentFeedURLHash, true);
                        ParseNetEntLiveCasinoTableList(domain);

                        hash2 = domain.DomainID;
                    }

                    if (hash1 > 0L || hash2 > 0L)
                    {
                        ceChangeNotification notification = cna.GetLastSuccessfulChangeNotification(domain.DomainID
                                                                                                    , ChangeType.LiveCasinoTableList.ToString()
                                                                                                    , DateTime.Now.AddHours(-1)
                                                                                                    );
                        if (notification != null &&
                            notification.HashValue1 == hash1 &&
                            notification.HashValue2 == hash2)
                        {
                            continue;
                        }

                        string error;
                        bool   success = Send(domain, ChangeType.LiveCasinoTableList, out error);

                        SqlQuery <ceChangeNotification> query = new SqlQuery <ceChangeNotification>();
                        notification            = new ceChangeNotification();
                        notification.Ins        = DateTime.Now;
                        notification.DomainID   = domain.DomainID;
                        notification.Succeeded  = success;
                        notification.Type       = ChangeType.LiveCasinoTableList.ToString();
                        notification.HashValue1 = hash1;
                        notification.HashValue2 = hash2;
                        query.Insert(notification);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Exception(ex);
                return(false);
            }

            return(true);
        }