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); }