public bool Update(System.Xml.XmlNode _PlayerNode, UploadID _Uploader /*Contains LastSeen*/, DateTime _LastSeen, PlayerHistory _PlayerHistory, WowVersionEnum _WowVersion, Func <int, VF.SQLUploadID> _GetSQLUploadIDFunc = null) { var newCharacter = new PlayerData.CharacterData(_PlayerNode); var newGuild = new PlayerData.GuildData(_PlayerNode); var newGear = new PlayerData.GearData(_PlayerNode, _WowVersion); var newHonor = new PlayerData.HonorData(_PlayerNode, _WowVersion); if (newGear.Items.Count == 0 && newGuild.GuildName == "nil" && newGuild.GuildRank == "nil" && newHonor.CurrentRank == 0 && _WowVersion == WowVersionEnum.Vanilla) { return(true); } PlayerData.ArenaData newArena = null; string newTalentPointsData = null; if (_WowVersion == WowVersionEnum.TBC) { newArena = new PlayerData.ArenaData(_PlayerNode); newTalentPointsData = XMLUtility.GetChildValue(_PlayerNode, "TalentsData", ""); } if (_GetSQLUploadIDFunc != null) { UpdateSQL(_GetSQLUploadIDFunc, Uploader, _LastSeen, _PlayerHistory, _WowVersion, newCharacter, newGuild, newGear, newHonor, newArena, newTalentPointsData); } return(Update(_Uploader, _LastSeen, _PlayerHistory, _WowVersion, newCharacter, newGuild, newGear, newHonor, newArena, newTalentPointsData)); }
public static DateTime ParseLastSeenUTC(System.Xml.XmlNode _PlayerNode) { string dateTime = XMLUtility.GetChildValue(_PlayerNode, "DateTimeUTC", "2000-01-01 01:01:01"); DateTime lastSeen; System.DateTime.TryParse(dateTime, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AssumeUniversal | System.Globalization.DateTimeStyles.AdjustToUniversal, out lastSeen); return(lastSeen); }
public static string ParseRealm(System.Xml.XmlNode _PlayerNode) { try { string[] playerData = XMLUtility.GetChildValue(_PlayerNode, "PlayerData", "").Split(new char[] { ':' }); return(playerData[7]); } catch (Exception) { } return(""); }
public bool Update(System.Xml.XmlNode _PlayerNode, UploadID _Uploader /*Contains LastSeen*/, DateTime _LastSeen, PlayerHistory _PlayerHistory, WowVersionEnum _WowVersion) { var newCharacter = new PlayerData.CharacterData(_PlayerNode); var newGuild = new PlayerData.GuildData(_PlayerNode); var newGear = new PlayerData.GearData(_PlayerNode, _WowVersion); var newHonor = new PlayerData.HonorData(_PlayerNode, _WowVersion); if (newGear.Items.Count == 0 && newGuild.GuildName == "nil" && newGuild.GuildRank == "nil" && newHonor.CurrentRank == 0 && _WowVersion == WowVersionEnum.Vanilla) { return(true); } PlayerData.ArenaData newArena = null; string newTalentPointsData = null; if (_WowVersion == WowVersionEnum.TBC) { newArena = new PlayerData.ArenaData(_PlayerNode); _PlayerHistory.AddToHistory(newArena, _Uploader); newTalentPointsData = XMLUtility.GetChildValue(_PlayerNode, "TalentsData", ""); _PlayerHistory.AddTalentsToHistory(newTalentPointsData, _Uploader); } _PlayerHistory.AddToHistory(newCharacter, _Uploader); _PlayerHistory.AddToHistory(newGuild, _Uploader); if (newGear.Items.Count > 0) { _PlayerHistory.AddToHistory(newGear, _Uploader); } _PlayerHistory.AddToHistory(newHonor, _Uploader); if (_LastSeen > LastSeen) { Uploader = _Uploader; LastSeen = _LastSeen; Character = newCharacter; Guild = newGuild; if (newGear.Items.Count > 0) { Gear = newGear; } Honor = newHonor; Arena = newArena; TalentPointsData = newTalentPointsData; return(false); } return(true); }
public ArenaData(System.Xml.XmlNode _PlayerNode) { InitData(XMLUtility.GetChildValue(_PlayerNode, "ArenaData", "")); }
public void AddData(UploadID _Uploader, System.Xml.XmlNode _PlayerNode) { AddData(_Uploader, XMLUtility.GetChildValue(_PlayerNode, "ExtraData", "")); }
public HonorData(System.Xml.XmlNode _PlayerNode, WowVersionEnum _WowVersion) { InitData(XMLUtility.GetChildValue(_PlayerNode, "HonorData", ""), _WowVersion); }
public CharacterData(System.Xml.XmlNode _PlayerNode) { InitData(XMLUtility.GetChildValue(_PlayerNode, "PlayerData", "")); }
public void AddData(UploadID _Uploader, System.Xml.XmlNode _PlayerNode, VF.SQLPlayerID?_PlayerID = null, Func <int, VF.SQLUploadID> _GetSQLUploadIDFunc = null) { AddData(_Uploader, XMLUtility.GetChildValue(_PlayerNode, "ExtraData", ""), _PlayerID, _GetSQLUploadIDFunc); }