Example #1
0
 public bool LoadSkinData(string skinName, int skinNumber)
 {
     if (File.Exists(Application.persistentDataPath + "/skinsInfo.data"))
     {
         BinaryFormatter bf   = new BinaryFormatter();
         FileStream      file = File.Open(Application.persistentDataPath + "/skinsInfo.data",
                                          FileMode.Open);
         if (file.Length != 0)
         {
             ShopSettings data = (ShopSettings)bf.Deserialize(file);
             file.Close();
             bool isAvailable = false;
             if (skinName.Contains("Planet"))
             {
                 isAvailable = data.PlanetSkins[skinNumber];
             }
             else if (skinName.Contains("Shield"))
             {
                 isAvailable = data.ShieldSkins[skinNumber];
             }
             return(isAvailable);
         }
         file.Close();
         return(false);
     }
     return(false);
 }
Example #2
0
 public int LoadUsedSkin(string skinName)
 {
     if (File.Exists(Application.persistentDataPath + "/skinsInfo.data"))
     {
         BinaryFormatter bf   = new BinaryFormatter();
         FileStream      file = File.Open(Application.persistentDataPath + "/skinsInfo.data",
                                          FileMode.Open);
         if (file.Length != 0)
         {
             ShopSettings data = (ShopSettings)bf.Deserialize(file);
             file.Close();
             int usedSkin = 0;
             if (skinName.Contains("Planet"))
             {
                 usedSkin = data.PlanetSkinUsed;
             }
             else if (skinName.Contains("Shield"))
             {
                 usedSkin = data.ShieldSkinUsed;
             }
             return(usedSkin);
         }
         file.Close();
         return(0);
     }
     return(0);
 }
Example #3
0
 protected override void InitializeSkin(Control skin)
 {
     LiteralShowMenu = (Literal)skin.FindControl("LiteralShowMenu");
     LabelShopCopy   = (Label)skin.FindControl("LabelShopCopy");
     method_0();
     LabelShopCopy.Text = ShopSettings.GetValue("CopyrightShop");
 }
Example #4
0
 public GetShopSettingsViewModel(ShopSettings shopSettings)
 {
     Theme       = shopSettings.Theme;
     Logo        = shopSettings.Logo;
     Currency    = shopSettings.Currency;
     Regulations = shopSettings.Regulations;
 }
Example #5
0
    public void InitShopPurchasable(ShopSettings settings)
    {
        this.settings = settings;
        GameObject gui = GameObject.Instantiate(settings.guiObject);

        gui.transform.parent = settings.guiObjectParent;
        gui.GetComponent <ShopPurchasableGUI>().SetShopPurchasable(this);
    }
Example #6
0
        public string GetSetting(string key)
        {
            var setting = ShopSettings.FirstOrDefault(x => String.Equals(x.ItemKey, key, StringComparison.CurrentCultureIgnoreCase));

            if (setting != null)
            {
                return(setting.Value);
            }
            return("");
        }
Example #7
0
        public async Task CanParse()
        {
            // Arrange
            IParserSettings parserSettings = new ShopSettings(1, 1);
            HtmlLoader      loader         = new HtmlLoader(parserSettings);
            ShopParser      parser         = new ShopParser();
            var             domParser      = new HtmlParser();
            var             source         = await loader.GetSourceByPageId(2);

            var document = await domParser.ParseAsync(source);

            // Act
            var result = parser.Parse(document);

            //Assert
            Assert.IsNotNull(parser.PricesList);
        }
Example #8
0
 protected override void InitializeSkin(Control skin)
 {
     ButtonOut          = (LinkButton)skin.FindControl("ButtonOut");
     LabelMemberID      = (Label)skin.FindControl("LabelMemberID");
     LabelMemberID.Text = base.MemLoginID;
     ButtonOut.Click   += ButtonOut_Click;
     LabelMsg           = (Label)skin.FindControl("LabelMsg");
     LabelGouWuChe      = (Label)skin.FindControl("LabelGouWuChe");
     ImageShopLogo      = (Image)skin.FindControl("ImageShopLogo");
     try
     {
         ImageShopLogo.ImageUrl = ShopSettings.GetValue("MemberLogo");
     }
     catch (Exception)
     {
     }
     GetDataInfo();
 }
Example #9
0
        public void SetUpEngineSettings()
        {
            EngineSettings.Initialize(new EngineSettings(new Vector2(0f, 0.0009f), new Vector2(0.5f, 0.5f)));

            ShopSettings.Initialize(new ShopSettings(6 * 6));
            StatusEffectsSettings.Initialize(new StatusEffectsSettings(500));
            GroupSettings.Initialize(new GroupSettings(10, 1000 * 60, (x, y) => true));
            QuestSettings.Initialize(new QuestSettings(20));
            GameTimeSettings.Initialize(new GameTimeSettings(19, 6, -0.5f, 50, new DateTime(2010, 1, 1), 1000f));
            PeerTradingSettings.Initialize(new PeerTradingSettings(20, 128));

            var rankNames = new string[] { "Recruit", "Member", "VIP", "Founder" };
            var nameRules = new StringRules(3, 50, CharType.All);
            var tagRules  = new StringRules(1, 4, CharType.All);
            var maxRank   = (GuildRank)(rankNames.Length - 1);

            GuildSettings.Initialize(new GuildSettings(1000 * 60, maxRank, rankNames, nameRules, tagRules, 3, 2, 1, 1, 2, 2));
        }
Example #10
0
        /// <summary>
        /// Initializes the <see cref="EngineSettingsInitializer"/> class.
        /// </summary>
        static EngineSettingsInitializer()
        {
            Initialize(new EngineSettingsInitializer());

            ShopSettings.Initialize(new ShopSettings(6 * 6));
            StatusEffectsSettings.Initialize(new StatusEffectsSettings(500));
            GroupSettings.Initialize(new GroupSettings(10, 1000 * 60, CanJoinGroupHandler));
            QuestSettings.Initialize(new QuestSettings(20));
            GameTimeSettings.Initialize(new GameTimeSettings(19, 6, -0.5f, 50, new DateTime(2010, 1, 1), 1000f));
            PeerTradingSettings.Initialize(new PeerTradingSettings(GameData.MaxInventorySize, 128));

            var rankNames = new string[] { "Recruit", "Member", "VIP", "Founder" };
            var nameRules = new StringRules(3, 50, CharType.All);
            var tagRules  = new StringRules(1, 4, CharType.All);
            var maxRank   = (GuildRank)(rankNames.Length - 1);

            GuildSettings.Initialize(new GuildSettings(1000 * 60, maxRank, rankNames, nameRules, tagRules, 3, 2, 1, 1, 2, 2));
        }
Example #11
0
        public void UpdateShopSettings(ShopSettings settings)
        {
            _settingsService.Set("DeliveryCost", settings.DeliveryCost);
            _settingsService.Set("SelfPickupCost", settings.SelfPickupCost);
            _settingsService.Set("CourierCities", settings.CourierCities);
            _settingsService.Set("ShopUrl", settings.ShopUrl);
            _settingsService.Set("DefaultPageSize", settings.DefaultPageSize);

            if (settings.SpecsInFilter.Any())
            {
                string specsInFilterString = String.Join(",", settings.SpecsInFilter.Select(x => x.ID));
                _settingsService.Set("Shop_SpecsInFilter", specsInFilterString);
            }
            else
            {
                _settingsService.Set("Shop_SpecsInFilter", "");
            }
        }
Example #12
0
        private void method_0(string string_2)
        {
            DataTable memInfo =
                ((ShopNum1_Member_Action)LogicFactory.CreateShopNum1_Member_Action()).GetMemInfo(string_2);

            try
            {
                if (memInfo.Rows.Count > 0)
                {
                    Lab_MemLoginID.Text = memInfo.Rows[0]["MemLoginID"].ToString();
                    txt_UserName.Value  = memInfo.Rows[0]["Name"].ToString();
                    txt_Email.Value     = memInfo.Rows[0]["Email"].ToString();
                    txt_Address.Value   = memInfo.Rows[0]["Address"].ToString();
                    txt_Mobile.Value    = memInfo.Rows[0]["Mobile"].ToString();
                    txt_Tel.Value       = memInfo.Rows[0]["Tel"].ToString();
                    txt_Voc.Value       = memInfo.Rows[0]["Vocation"].ToString();
                    txt_WebSite.Value   = memInfo.Rows[0]["WebSite"].ToString();
                    txt_Post.Value      = memInfo.Rows[0]["Postalcode"].ToString();
                    txt_Fax.Value       = memInfo.Rows[0]["Fax"].ToString();
                    txt_QQ.Value        = memInfo.Rows[0]["QQ"].ToString();
                    txt_Bth.Value       = (memInfo.Rows[0]["Birthday"].ToString() == string.Empty)
                        ? string.Empty
                        : DateTime.Parse(memInfo.Rows[0]["Birthday"].ToString())
                                          .ToString("yyyy-MM-dd");
                    hid_Sex.Value       = memInfo.Rows[0]["Sex"].ToString();
                    txt_PalyName.Value  = memInfo.Rows[0]["RealName"].ToString();
                    hid_AreaValue.Value = memInfo.Rows[0]["AddressValue"].ToString();
                    hid_AreaCode.Value  = memInfo.Rows[0]["AddressCode"].ToString();
                    ImagePath.ImageUrl  = (memInfo.Rows[0]["Photo"].ToString() == "")
                        ? ShopSettings.GetValue("MemberImage")
                        : memInfo.Rows[0]["Photo"].ToString();
                    hid_CheckEmail.Value  = memInfo.Rows[0]["IsEmailActivation"].ToString();
                    hid_CheckMobile.Value = memInfo.Rows[0]["IsMobileActivation"].ToString();
                }
            }
            catch (InvalidCastException)
            {
            }
        }
Example #13
0
    public void SaveSkinData(string skinName, int skinNumber, bool isAvailable)
    {
        ShopSettings    data;
        BinaryFormatter bf = new BinaryFormatter();
        FileStream      file;

        if (File.Exists(Application.persistentDataPath + "/skinsInfo.data"))
        {
            file = File.Open(Application.persistentDataPath + "/skinsInfo.data",
                             FileMode.Open);
            if (file.Length == 0)
            {
                file.Close();
                return;
            }
            data = (ShopSettings)bf.Deserialize(file);
            file.Close();
        }
        else
        {
            data = new ShopSettings();
        }
        file = File.Create(Application.persistentDataPath + "/skinsInfo.data");

        if (skinName.Contains("Planet"))
        {
            data.PlanetSkins[skinNumber] = isAvailable;
        }
        else if (skinName.Contains("Shield"))
        {
            data.ShieldSkins[skinNumber] = isAvailable;
        }

        bf.Serialize(file, data);
        file.Close();
    }
 private void Awake()
 {
     inst = this;
 }
 public void AddProductsToList(ShopSettings ChosenProduct)
 {
     ListOfItemsToSpawn.Add(ChosenProduct);
 }
Example #16
0
 public ResultModel Update(ShopSettings settings)
 {
     _shopSettingsService.UpdateShopSettings(settings);
     return(ResultModel.Success);
 }