Beispiel #1
0
        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));
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public static string ParseRealm(System.Xml.XmlNode _PlayerNode)
 {
     try
     {
         string[] playerData = XMLUtility.GetChildValue(_PlayerNode, "PlayerData", "").Split(new char[] { ':' });
         return(playerData[7]);
     }
     catch (Exception)
     { }
     return("");
 }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 public ArenaData(System.Xml.XmlNode _PlayerNode)
 {
     InitData(XMLUtility.GetChildValue(_PlayerNode, "ArenaData", ""));
 }
Beispiel #6
0
 public void AddData(UploadID _Uploader, System.Xml.XmlNode _PlayerNode)
 {
     AddData(_Uploader, XMLUtility.GetChildValue(_PlayerNode, "ExtraData", ""));
 }
Beispiel #7
0
 public HonorData(System.Xml.XmlNode _PlayerNode, WowVersionEnum _WowVersion)
 {
     InitData(XMLUtility.GetChildValue(_PlayerNode, "HonorData", ""), _WowVersion);
 }
Beispiel #8
0
 public CharacterData(System.Xml.XmlNode _PlayerNode)
 {
     InitData(XMLUtility.GetChildValue(_PlayerNode, "PlayerData", ""));
 }
Beispiel #9
0
 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);
 }