Example #1
0
 public Player(string _Name, WowRealm _Realm, CharacterDataHistoryItem _Character, GuildDataHistoryItem _Guild, HonorDataHistoryItem _Honor, GearDataHistoryItem _Gear, ArenaDataHistoryItem _Arena, TalentsDataHistoryItem _Talents)
 {
     Name             = _Name;
     Realm            = _Realm;
     Character        = _Character.Data;
     Guild            = _Guild.Data;
     Honor            = _Honor.Data;
     Gear             = _Gear.Data;
     Arena            = _Arena.Data;
     TalentPointsData = _Talents.Data;
     Uploader         = _Character.Uploader;
     if (_Guild.Uploader.GetTime() > Uploader.GetTime())
     {
         Uploader = _Guild.Uploader;
     }
     if (_Honor.Uploader.GetTime() > Uploader.GetTime())
     {
         Uploader = _Honor.Uploader;
     }
     if (_Gear.Uploader.GetTime() > Uploader.GetTime())
     {
         Uploader = _Gear.Uploader;
     }
     if (_Arena.Uploader.GetTime() > Uploader.GetTime())
     {
         Uploader = _Arena.Uploader;
     }
     if (_Talents.Uploader.GetTime() > Uploader.GetTime())
     {
         Uploader = _Talents.Uploader;
     }
     LastSeen = Uploader.GetTime();
 }
Example #2
0
 public Player(SerializationInfo _Info, StreamingContext _Context)
 {
     Name      = _Info.GetString("Name");
     Realm     = (WowRealm)_Info.GetInt32("Realm");
     Character = (CharacterData)_Info.GetValue("Character", typeof(CharacterData));
     Guild     = (GuildData)_Info.GetValue("Guild", typeof(GuildData));
     Honor     = (HonorData)_Info.GetValue("Honor", typeof(HonorData));
     Gear      = (GearData)_Info.GetValue("Gear", typeof(GearData));
     LastSeen  = (DateTime)_Info.GetValue("LastSeen", typeof(DateTime));
     Uploader  = (UploadID)_Info.GetValue("Uploader", typeof(UploadID));
 }
Example #3
0
 public GuildPlayerStatus(GuildSummary _GuildSummary, PlayerData.GuildData _GuildData, DateTime _DateTime)
 {
     m_DateTime = _DateTime;
     if (_GuildData.GuildName == _GuildSummary.GuildName)
     {
         m_GuildRank   = _GuildData.GuildRank;
         m_GuildRankNr = _GuildData.GuildRankNr;
     }
     else
     {
         m_GuildRankNr = -1337;
         m_GuildRank   = "";
     }
 }
Example #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);
        }
Example #5
0
        public bool IsSame(GuildData _GuildData)
        {
            if (GuildName != _GuildData.GuildName)
            {
                return(false);
            }
            if (GuildRank != _GuildData.GuildRank)
            {
                return(false);
            }
            if (GuildRankNr != _GuildData.GuildRankNr)
            {
                return(false);
            }

            return(true);
        }
Example #6
0
        public int GenerateNewPlayerGuildDataEntry(PlayerData.GuildData _GuildData)
        {
            if (_GuildData == null)
            {
                return(0);
            }

            var conn = OpenConnection();

            try
            {
                using (var cmd = new NpgsqlCommand("INSERT INTO playerguildtable(id, guildname, guildrank, guildranknr) VALUES (DEFAULT, :GuildName, :GuildRank, :GuildRankNr) RETURNING id", conn))
                {
                    {
                        var guildNameParam = new NpgsqlParameter("GuildName", NpgsqlDbType.Text);
                        guildNameParam.Value = _GuildData.GuildName;
                        cmd.Parameters.Add(guildNameParam);
                    }
                    {
                        var guildRankrParam = new NpgsqlParameter("GuildRank", NpgsqlDbType.Text);
                        guildRankrParam.Value = _GuildData.GuildRank;
                        cmd.Parameters.Add(guildRankrParam);
                    }
                    {
                        var guildRankrNrParam = new NpgsqlParameter("GuildRankNr", NpgsqlDbType.Smallint);
                        guildRankrNrParam.Value = _GuildData.GuildRankNr;
                        cmd.Parameters.Add(guildRankrNrParam);
                    }
                    using (var reader = cmd.ExecuteReader())
                    {
                        if (reader.Read() == true)
                        {
                            return(reader.GetInt32(0));
                        }
                    }
                }
            }
            finally
            {
                CloseConnection();
            }
            return(0);
        }
Example #7
0
        public bool Update(UploadID _Uploader /*Contains LastSeen*/, DateTime _LastSeen, PlayerHistory _PlayerHistory, WowVersionEnum _WowVersion
                           , PlayerData.CharacterData _NewCharacter, PlayerData.GuildData _NewGuild, PlayerData.GearData _NewGear, PlayerData.HonorData _NewHonor, PlayerData.ArenaData _NewArena = null, string _NewTalents = null)
        {
            if (_WowVersion == WowVersionEnum.TBC)
            {
                if (_NewArena != null)
                {
                    _PlayerHistory.AddToHistory(_NewArena, _Uploader);
                }
                if (_NewTalents != null)
                {
                    _PlayerHistory.AddTalentsToHistory(_NewTalents, _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 = _NewTalents;
                return(false);
            }

            return(true);
        }
Example #8
0
 public void SetGuildData(PlayerData.GuildData _GuildData, DateTime _DateTime)
 {
     AddGuildPlayerStatus(new GuildPlayerStatus(m_CacheGuild, _GuildData, _DateTime));
 }
Example #9
0
 public GuildDataHistoryItem(SerializationInfo _Info, StreamingContext _Context)
 {
     Data     = (GuildData)_Info.GetValue("Data", typeof(GuildData));
     Uploader = (UploadID)_Info.GetValue("Uploader", typeof(UploadID));
 }
Example #10
0
 //public GuildDataHistoryItem()
 //{ }
 public GuildDataHistoryItem(GuildData _Guild, UploadID _Uploader)
 {
     Data     = _Guild;
     Uploader = _Uploader;
 }
Example #11
0
 public void AddToHistory(GuildData _GuildData, UploadID _Uploader)
 {
     UtilityClass.AddToHistory.RunGeneric(GuildHistory, _GuildData, _Uploader);
 }
Example #12
0
 public void SetData(GuildData _GuildData)
 {
     GuildName   = _GuildData.GuildName;
     GuildRank   = _GuildData.GuildRank;
     GuildRankNr = _GuildData.GuildRankNr;
 }