/// <summary> /// 获取系统用户列表 /// </summary> public void GetHeroList() { // 打开数据库 OpenDB(); // 读取整张表Hero reader = db.ReadFullTable("Hero"); // Dic Dictionary <string, HeroVO> map = new Dictionary <string, HeroVO>(); // 遍历数据 while (reader.Read()) { HeroVO hero = new HeroVO(); hero.id = reader.GetInt32(reader.GetOrdinal("id")) + ""; hero.uid = reader.GetString(reader.GetOrdinal("uid")); hero.name = reader.GetString(reader.GetOrdinal("name")); hero.type = reader.GetString(reader.GetOrdinal("type")); hero.role = reader.GetString(reader.GetOrdinal("role")); hero.weapon = reader.GetString(reader.GetOrdinal("weapon")); hero.description = reader.GetString(reader.GetOrdinal("description")); map.Add(hero.type, hero); } // 发送获取成功 SendNotification(NotificationList.GET_HERO_LIST + SUCCESS, map); // 关闭数据库 CloseDB(); }
/// <summary> /// 召唤按钮 /// </summary> void OnSummonBtnClick() { transform.parent.parent.parent.Find("GetHeroPanel").gameObject.SetActive(true); GetHeroPanel.instance.hero = heroVO; //读取英雄数据 HeroVO vo = VOManager.Instance().GetCSV <HeroCSV>("Hero").GetVO(heroVO.hero_id); //向服务器发送消息 if (DataDefine.isConectSocket) { ClientSendDataMgr.GetSingle().GetHeroSend().SendSoulStoneChangeHero(heroVO.hero_id, vo.init_star, vo.soul_gem, currentSoul); } }
protected override void Parse(string data) { base.Parse(data); string[] textColumn = data.Split("\n".ToCharArray()); obj = new object[textColumn.Length]; for (int i = 0; i < textColumn.Length; i++) { string [] textRow = textColumn[i].Split(" ".ToCharArray()); HeroVO vo = new HeroVO(); for (int j = 0; j < textRow.Length; j++) { vo.hero_id = int.Parse(textRow[0]); vo.types = int.Parse(textRow[1]); vo.name = textRow[2]; vo.describe = textRow[3]; vo.info = textRow[4]; vo.icon_atlas = textRow[5]; vo.icon_name = textRow[6]; vo.icon_name_y = textRow[7]; vo.model = textRow[8]; vo.original_painting = textRow[9]; vo.attribute = int.Parse(textRow[10]); vo.released = int.Parse(textRow[11]); vo.is_icon = int.Parse(textRow[12]); vo.sex = int.Parse(textRow[13]); vo.init_star = int.Parse(textRow[14]); vo.rate1 = textRow[15]; vo.rate2 = textRow[16]; vo.rate3 = textRow[17]; vo.rate4 = textRow[18]; vo.rate5 = textRow[19]; vo.soul_gem = int.Parse(textRow[20]); vo.skill_id = textRow[21]; vo.isHas = false; } obj[i] = vo; dic.Add(vo.hero_id, vo); } }