public void InsertMobile(Mobile mob) { string guildTitle = mob.GuildTitle; if (guildTitle == null || (guildTitle = guildTitle.Trim()).Length == 0) { guildTitle = "NULL"; } else { guildTitle = SafeString(guildTitle); } string notoTitle = SafeString(Titles.ComputeTitle(null, mob)); string female = (mob.Female ? "1" : "0"); bool pubBool = (mob is PlayerMobile) && (((PlayerMobile)mob).PublicMyRunUO); string pubString = (pubBool ? "1" : "0"); string guildId = (mob.Guild == null ? "NULL" : mob.Guild.Id.ToString()); if (Config.LoadDataInFile) { m_OpMobiles.Write(LineStart); m_OpMobiles.Write(mob.Serial.Value); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(SafeString(mob.Name)); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(mob.RawStr); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(mob.RawDex); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(mob.RawInt); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(female); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(mob.Kills); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(guildId); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(guildTitle); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(notoTitle); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(mob.Hue); m_OpMobiles.Write(EntrySep); m_OpMobiles.Write(pubString); m_OpMobiles.Write(LineEnd); } else { ExecuteNonQuery("INSERT INTO myrunuo_characters (char_id, char_name, char_str, char_dex, char_int, char_female, char_counts, char_guild, char_guildtitle, char_nototitle, char_bodyhue, char_public ) VALUES ({0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, '{9}', {10}, {11})", mob.Serial.Value.ToString(), SafeString(mob.Name), mob.RawStr.ToString(), mob.RawDex.ToString(), mob.RawInt.ToString(), female, mob.Kills.ToString(), guildId, guildTitle, notoTitle, mob.Hue.ToString(), pubString); } }
public void InsertMobile(Mobile mob) { string guildTitle = mob.GuildTitle; if (guildTitle == null || (guildTitle = guildTitle.Trim()).Length == 0) { guildTitle = "NULL"; } else { guildTitle = "'" + SafeString(guildTitle) + "'"; } string notoTitle = SafeString(Titles.ComputeTitle(null, mob)); string female = (mob.Female ? "1" : "0"); bool pubBool = (mob is PlayerMobile) && (((PlayerMobile)mob).PublicMyRunUO); string pubString = (pubBool ? "1" : "0"); string guildId = (mob.Guild == null ? "NULL" : mob.Guild.Id.ToString()); ExecuteNonQuery("INSERT INTO {12} (char_id, char_name, char_str, char_dex, char_int, char_female, char_counts, char_guild, char_guildtitle, char_nototitle, char_bodyhue, char_public ) VALUES ({0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, '{9}', {10}, {11})", mob.Serial.Value.ToString(), SafeString(mob.Name), mob.RawStr.ToString(), mob.RawDex.ToString(), mob.RawInt.ToString(), female, mob.Kills.ToString(), guildId, guildTitle, notoTitle, mob.Hue.ToString(), pubString, Config.CharsTable); }
public void InsertMobile(Mobile mob) { string guildTitle = mob.GuildTitle; // ----------------------------------------------------------------------------------------------- string skillTitle = mob.Title; if (guildTitle == null || (guildTitle = guildTitle.Trim()).Length == 0) { guildTitle = "NULL"; } else { guildTitle = this.SafeString(guildTitle); } string notoTitle = this.SafeString(Titles.ComputeTitle(null, mob)); string female = (mob.Female ? "1" : "0"); bool pubBool = (mob is PlayerMobile) && (((PlayerMobile)mob).PublicMyRunUO); string pubString = (pubBool ? "1" : "0"); string guildId = (mob.Guild == null ? "NULL" : mob.Guild.Id.ToString()); if (Config.LoadDataInFile) { this.m_OpMobiles.Write(LineStart); this.m_OpMobiles.Write(mob.Serial.Value); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(this.SafeString(mob.Name)); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(this.SafeString(mob.Title)); this.m_OpMobiles.Write(EntrySep); if (mob.Body == 0x190 || mob.Body == 0x191) { this.m_OpMobiles.Write("Human"); } else if (mob.Body == 0x25D || mob.Body == 0x25E) { this.m_OpMobiles.Write("Elf"); } else if (mob.Body == 0x29A || mob.Body == 0x29B) { this.m_OpMobiles.Write("Gargoyle"); } else { this.m_OpMobiles.Write("Other"); } this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.Body); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.RawStr); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.RawDex); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.RawInt); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(female); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.Kills); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(guildId); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(guildTitle); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(notoTitle); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.Hue); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.Karma); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(mob.Fame); this.m_OpMobiles.Write(EntrySep); this.m_OpMobiles.Write(pubString); this.m_OpMobiles.Write(LineEnd); } else { this.ExecuteNonQuery("INSERT INTO myrunuo_characters (char_id, char_name, char_title, char_race, char_body, char_str, char_dex, char_int, char_female, char_counts, char_guild, char_guildtitle, char_nototitle, char_bodyhue, char_karma, char_fame, char_public ) VALUES ({0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, '{9}', {10}, {11}, {12}, {13}, {14})", mob.Serial.Value.ToString(), this.SafeString(mob.Name), this.SafeString(mob.Title), mob.RawStr.ToString(), mob.RawDex.ToString(), mob.RawInt.ToString(), female, mob.Kills.ToString(), guildId, guildTitle, notoTitle, mob.Hue.ToString(), mob.Karma.ToString(), mob.Fame.ToString(), pubString); } }