private bool ReadBuilding(SQLiteRowsReader reader, out BuildingSaveData result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new BuildingSaveData(); result.Id = reader.GetString("id"); result.ParentId = reader.GetString("parentId"); result.EntityId = reader.GetInt32("entityId"); result.CurrentHp = reader.GetInt32("currentHp"); result.Position = new Vector3(reader.GetFloat("positionX"), reader.GetFloat("positionY"), reader.GetFloat("positionZ")); result.Rotation = Quaternion.Euler(reader.GetFloat("rotationX"), reader.GetFloat("rotationY"), reader.GetFloat("rotationZ")); result.IsLocked = reader.GetBoolean("isLocked"); result.LockPassword = reader.GetString("lockPassword"); result.CreatorId = reader.GetString("creatorId"); result.CreatorName = reader.GetString("creatorName"); return(true); } result = new BuildingSaveData(); return(false); }
private bool ReadCharacterItem(SQLiteRowsReader reader, out CharacterItem result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new CharacterItem(); result.id = reader.GetString("id"); result.dataId = reader.GetInt32("dataId"); result.level = reader.GetInt16("level"); result.amount = reader.GetInt16("amount"); result.equipSlotIndex = reader.GetByte("equipSlotIndex"); result.durability = reader.GetFloat("durability"); result.exp = reader.GetInt32("exp"); result.lockRemainsDuration = reader.GetFloat("lockRemainsDuration"); result.ammo = reader.GetInt16("ammo"); result.sockets = ReadSockets(reader.GetString("sockets")); return(true); } result = CharacterItem.Empty; return(false); }
private bool ReadCharacter(SQLiteRowsReader reader, out PlayerCharacterData result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new PlayerCharacterData(); result.Id = reader.GetString("id"); result.DataId = reader.GetInt32("dataId"); result.EntityId = reader.GetInt32("entityId"); result.FactionId = reader.GetInt32("factionId"); result.CharacterName = reader.GetString("characterName"); result.Level = reader.GetInt16("level"); result.Exp = reader.GetInt32("exp"); result.CurrentHp = reader.GetInt32("currentHp"); result.CurrentMp = reader.GetInt32("currentMp"); result.CurrentStamina = reader.GetInt32("currentStamina"); result.CurrentFood = reader.GetInt32("currentFood"); result.CurrentWater = reader.GetInt32("currentWater"); result.EquipWeaponSet = reader.GetByte("equipWeaponSet"); result.StatPoint = reader.GetInt16("statPoint"); result.SkillPoint = reader.GetInt16("skillPoint"); result.Gold = reader.GetInt32("gold"); result.PartyId = reader.GetInt32("partyId"); result.GuildId = reader.GetInt32("guildId"); result.GuildRole = reader.GetByte("guildRole"); result.SharedGuildExp = reader.GetInt32("sharedGuildExp"); result.CurrentMapName = reader.GetString("currentMapName"); result.CurrentPosition = new Vector3(reader.GetFloat("currentPositionX"), reader.GetFloat("currentPositionY"), reader.GetFloat("currentPositionZ")); result.RespawnMapName = reader.GetString("respawnMapName"); result.RespawnPosition = new Vector3(reader.GetFloat("respawnPositionX"), reader.GetFloat("respawnPositionY"), reader.GetFloat("respawnPositionZ")); result.MountDataId = reader.GetInt32("mountDataId"); result.LastUpdate = (int)(reader.GetDateTime("updateAt").Ticks / System.TimeSpan.TicksPerMillisecond); return(true); } result = null; return(false); }
private bool ReadCharacterItem(SQLiteRowsReader reader, out CharacterItem result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new CharacterItem(); result.dataId = reader.GetInt32("dataId"); result.level = (short)reader.GetInt32("level"); result.amount = (short)reader.GetInt32("amount"); result.durability = reader.GetFloat("durability"); result.exp = reader.GetInt32("exp"); result.lockRemainsDuration = reader.GetFloat("lockRemainsDuration"); return(true); } result = CharacterItem.Empty; return(false); }
private bool ReadCharacterSkill(SQLiteRowsReader reader, out CharacterSkill result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new CharacterSkill(); result.dataId = reader.GetInt32("dataId"); result.level = reader.GetInt16("level"); result.coolDownRemainsDuration = reader.GetFloat("coolDownRemainsDuration"); return(true); } result = CharacterSkill.Empty; return(false); }
private bool ReadCharacterSkillUsage(SQLiteRowsReader reader, out CharacterSkillUsage result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new CharacterSkillUsage(); result.type = (SkillUsageType)reader.GetSByte("type"); result.dataId = reader.GetInt32("dataId"); result.coolDownRemainsDuration = reader.GetFloat("coolDownRemainsDuration"); return(true); } result = CharacterSkillUsage.Empty; return(false); }
private bool ReadCharacterBuff(SQLiteRowsReader reader, out CharacterBuff result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new CharacterBuff(); result.type = (BuffType)reader.GetSByte("type"); result.dataId = reader.GetInt32("dataId"); result.level = (short)reader.GetInt32("level"); result.buffRemainsDuration = reader.GetFloat("buffRemainsDuration"); return(true); } result = CharacterBuff.Empty; return(false); }
private bool ReadCharacterSummon(SQLiteRowsReader reader, out CharacterSummon result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new CharacterSummon(); result.type = (SummonType)reader.GetSByte("type"); result.dataId = reader.GetInt32("dataId"); result.summonRemainsDuration = reader.GetFloat("summonRemainsDuration"); result.level = (short)reader.GetInt32("level"); result.exp = reader.GetInt32("exp"); result.currentHp = reader.GetInt32("currentHp"); result.currentMp = reader.GetInt32("currentMp"); return(true); } result = CharacterSummon.Empty; return(false); }
private bool ReadCharacterItem(SQLiteRowsReader reader, out CharacterItem result, bool resetReader = true) { if (resetReader) { reader.ResetReader(); } if (reader.Read()) { result = new CharacterItem(); result.dataId = reader.GetInt32("dataId"); result.level = reader.GetInt16("level"); result.amount = reader.GetInt16("amount"); result.durability = reader.GetFloat("durability"); result.isSummoned = reader.GetBoolean("isSummoned"); result.currentSummonedHp = reader.GetInt32("currentSummonedHp"); result.currentSummonedMp = reader.GetInt32("currentSummonedMp"); result.currentSummonedExp = reader.GetInt32("currentSummonedExp"); return(true); } result = CharacterItem.Empty; return(false); }