sahisahi
Member
Hello im using xmlpoints on my server, the system has a ''farm'' prevention to not let players earn points from same player over and over, but is not working, players getting points from same player
Anyone else having this issue?
if somebody want to take a look at it... thanks
maybe the canaffectpoints method is not correct
Anyone else having this issue?
if somebody want to take a look at it... thanks
Code:
private static TimeSpan m_KillDelay = TimeSpan.FromHours(1); // 6 hour default min interval between kills of the same player for point gain
maybe the canaffectpoints method is not correct
Code:
public bool CanAffectPoints(Mobile from, Mobile killer, Mobile killed, bool assumechallenge)
{
// uncomment this for newbie protection
if( ((killed.SkillsTotal < 6000 && (killer.SkillsTotal - killed.SkillsTotal ) > 1000) ||
(killed.RawStatTotal <= 200 && (killer.RawStatTotal - killed.RawStatTotal) > 20 ) ) && m_Challenger != killer && m_Challenger != killed) return false;
// check for within guild kills and ignore them if this has been disabled
if (!AllowWithinGuildPoints && SameGuild(killed, killer)) return false;
// check for within team kills and ignore them
if (AreTeamMembers(killer, killed)) return false;
// are the players challengers?
bool inchallenge = false;
if ((from == killer && m_Challenger == killed) || (from == killed && m_Challenger == killer))
{
inchallenge = true;
}
bool norestriction = UnrestrictedChallenges;
// check for team challenges
if (ChallengeGame != null && !ChallengeGame.Deleted)
{
// check to see if points have been disabled in this game
if (!ChallengeGame.AllowPoints) return false;
inchallenge = true;
// check for kill delay limitations on points awards
norestriction = !ChallengeGame.UseKillDelay;
}
// if UnlimitedChallenges has been set then allow points
// otherwise, challenges have to obey the same restrictions on minimum time between kills as normal pvp
if (norestriction && (inchallenge || assumechallenge)) return true;
// only allow guild kills to yield points if in a challenge
if (!(assumechallenge || inchallenge) && SameGuild(killed, killer)) return false;
// uncomment the line below to limit points to challenges. regular pvp will not give points
//if(!inchallenge && !assumechallenge) return false;
// check to see whether killing the target would yield points
// get a point for killing if they havent been killed recent
// get the points attachment on the killer if this isnt the killer
XmlPoints a = this;
if (from != killer)
{
a = (XmlPoints)XmlAttach.FindAttachment(killer, typeof(XmlPoints));
}
if (a != null)
{
a.RefreshKillList();
// check the kill list if there is one
if (a.KillList != null)
{
foreach (KillEntry k in a.KillList)
{
if (k.WhenKilled + m_KillDelay > DateTime.Now)
{
// found a match on the list so dont give any points
if (k.Killed == killed)
{
return false;
}
}
}
}
}
// check to see whether the killed target could yield points
if (from == killed)
{
// is it still within the minimum delay for being killed?
if (DateTime.Now < m_LastDeath + m_DeathDelay) return false;
}
return true;
}
Attachments
Last edited: