Example #1
0
        public bool UpdateStatistics(PvPTeam t, PlayerMobile pm, Action <PvPProfileHistoryEntry> update)
        {
            if (t == null || t.Deleted || pm == null || update == null)
            {
                return(false);
            }

            var s = t.GetStatistics(pm);

            if (s == null)
            {
                return(false);
            }

            var success = true;

            VitaNexCore.TryCatch(
                update,
                s,
                x =>
            {
                AutoPvP.CMOptions.ToConsole(x);
                success = false;
            });

            if (t.IsMember(pm))
            {
                t.UpdateActivity(pm);
            }

            return(success);
        }
Example #2
0
        public long GetStatistic(PvPTeam t, PlayerMobile pm, Func <PvPProfileHistoryEntry, long> fetch)
        {
            if (t == null || t.Deleted || pm == null || fetch == null)
            {
                return(0);
            }

            var s = t.GetStatistics(pm);

            if (s != null)
            {
                return(VitaNexCore.TryCatchGet(fetch, s, AutoPvP.CMOptions.ToConsole));
            }

            return(0);
        }