public TitleInfo(DbDataReader reader, HeroesTextHelper HeroesText) { Stats = new Dictionary <string, int>(); this.TitleID = reader.ReadInt64("titleid"); // Convert.ToInt64(ToString(reader["titleid"])); string tmp; this.Name = reader.ReadString("name", ""); if (HeroesText.TitleNames.TryGetValue(this.Name.ToLower(), out tmp)) { this.Name = tmp; } this.Description = reader.ReadString("description", ""); if (HeroesText.TitleDescs.TryGetValue(this.Description.ToLower(), out tmp)) { this.Description = tmp; } this.Category = reader.ReadString("Category"); this.Feature = reader.ReadString("feature", ""); this.OnlyClass = this.Feature.ToClassInfo(); this.AutoGiveLevel = reader.ReadInt32("AutoGiveLevel"); this.RequiredLevel = reader.ReadInt32("RequiredLevel"); this.ClassRestriction = reader.ReadInt32("ClassRestriction", -1); this.TotalCount = reader.ReadInt32("tcount", -1); this.Effect = ""; }
public ItemClassInfo(DbDataReader reader, HeroesTextHelper HeroesText) { this.ItemClass = reader.ReadString("ItemClass", "").ToLower(); this.SubCategory = reader.ReadEnum <SubCategory>("Category", SubCategory.NONE); this.MainCategory = reader.ReadEnum <MainCategory>("TradeCategory", MainCategory.NONE); this.MaxStack = reader.ReadInt64("MaxStack"); this.RequiredLevel = reader.ReadInt32("RequiredLevel"); this.ClassRestriction = reader.ReadInt32("ClassRestriction"); string tmp; if (HeroesText.ItemNames.TryGetValue(this.ItemClass, out tmp)) { this.Name = tmp; } if (HeroesText.ItemDescs.TryGetValue(this.ItemClass, out tmp)) { this.Desc = tmp; } ItemStatInfo stat = new ItemStatInfo(reader); if (!stat.IsEmpty()) { this.Stat = stat; } this.Feature = reader.ReadString("Feature"); }
public Mail AttachBox(DbDataReader reader) { this.MailID = reader.ReadInt64("MailID"); string title = reader.ReadString("title"); title = HeroesTextHelper.GetMailTitle(title); this.Title = title; //Content this.Text = reader.ReadString("content"); return(this); }
public Mail(DbDataReader reader) { //mailID this.MailID = reader.ReadInt64("RowID"); string title = reader.ReadString("MailTitle"); title = HeroesTextHelper.GetMailTitle(title); this.Title = title; this.ItemClassEx = reader.ReadString("ItemClassEx"); //Content this.Text = reader.ReadString("MailContent"); this.Count = reader.ReadInt32("Count"); }
void InitTask(IWaitDialog dlg) { dlg.SetTitle(R.TipInit); dlg.SetInfo(R.ConnectSqlServer); if (!Db.Open()) { Db.Close(); Db = null; this.Error(R.ErrorSqlServerNotConnect); Invoke(new InitFail(ShowServerManager), new object[] { true }); return; } else { try{ Db.ExcuteSQL("use heroes;"); }catch (Exception e) { this.Error("" + e); Db.Close(); Db = null; Invoke(new InitFail(ShowServerManager), new object[] { true }); return; } } dlg.SetInfo(R.TipReadText); var HeroesText = new HeroesTextHelper(); HeroesText.Read(Config.GameText, Config.PatchText); // dlg.SetInfo(R.TipReadItem); //读取物品 try{ DataHelper.ReadData(HeroesText); }catch (Exception e) { this.Error("ReadData\n" + e); } if (Searcher == null) { Searcher = new SearchHelper(DataHelper.Items); } else { Searcher.Attch(DataHelper.Items); } // MessageBox.Show("count="+DataHelper.Items.Count); dlg.SetInfo(R.TipReadUsers); Invoke(new InitOk(InitAllMenus)); //读取用户 ReadUsers(true); }
public SkillBonusInfo(DbDataReader reader, HeroesTextHelper HeroesText) { this.ID = reader.ReadInt32("ID"); this.Grade = reader.ReadString("Grade"); this.ClassRestriction = reader.ReadInt32("ClassRestriction"); this.DESC = reader.ReadString("DESCID"); string tmp; if (HeroesText.SynSkillBonuds.TryGetValue("" + ID, out tmp)) { this.DESC = tmp; } this.SkillID = reader.ReadString("SkillID"); this.Type = reader.ReadString("Type"); this.Value = reader.ReadInt32("Value"); }
public EnchantInfo(DbDataReader reader2, HeroesTextHelper HeroesText) { this.Class = reader2.ReadString("EnchantClass", "").ToLower(); this.Constraint = reader2.ReadString("ItemConstraint"); this.Desc = reader2.ReadString("ItemConstraintDesc"); this.IsPrefix = reader2.ReadBoolean("IsPrefix"); this.MinArg = reader2.ReadInt32("MinArgValue"); this.MaxArg = reader2.ReadInt32("MaxArgValue"); this.EnchantLevel = reader2.ReadInt32("EnchantLevel"); string tmp; if (this.IsPrefix) { if (!HeroesText.PrefixNames.TryGetValue(this.Class, out tmp)) { this.Name = this.Class; } else { this.Name = tmp; } } else { if (!HeroesText.SuffixNames.TryGetValue(this.Class, out tmp)) { this.Name = this.Class; } else { this.Name = tmp; } } if (HeroesText.EnchantDescs.TryGetValue(this.Class, out tmp)) { this.Desc = tmp; } this.Effect = ""; bool has = false; for (int i = 1; i <= 5; i++) { has = false; if (HeroesText.EnchantEffects.TryGetValue(this.Class + "_" + i, out tmp)) { if (!string.IsNullOrEmpty(tmp)) { has = true; this.Effect += i + "." + tmp; } } if (has) { if (HeroesText.EnchantEffectIfs.TryGetValue(this.Class + "_" + i, out tmp)) { if (!string.IsNullOrEmpty(tmp)) { this.Effect += "[" + tmp + "]"; } } this.Effect += "\n"; } else { break; } } if (this.Effect.Contains("{0}")) { this.Effect = this.Effect.Replace("{0}", this.GetValue()); } }