Page 1 of 1

SVN Revision 2723 - IsAllowedToAttack vs IsSameRealm

PostPosted: Mon Dec 13, 2010 7:56 pm
by DOLBot
Commit from tolakram

Log Messages
- Bugfix: All combat oriented actions now use IsAllowedToAttack instead of IsSameRealm. This attempts to fix a bug with the pvp ruleset where spells of type 'realm' and other friendly spells would heal/buff enemy players because those players are still considered part of the same realm. On PvP there are two determinations for actions: Can we attack the player (group, guild, alliance checks) and can we invite the player to a group, or guild (SameRealm checks). You have to be able to invite 'enemy' players so the checks have to be separate. IsAllowedToAttack should always be used for combat actions (attack/heal/buff) while IsSameRealm should be used for all non-combat actions (group invite/guild invite/etc).

This may introduce a new problem if the PvP ruleset allows players to buff each other without being 'friendly'. This fix will no longer allow buffing on PvP outside of a group / guild / alliance.

- Bugfix: Ignore bind areas when showing kill messages

Files Changed:
MODIFY - DOLSharp/trunk/GameServer/ai/brain/Animist/TurretBrain.cs
MODIFY - DOLSharp/trunk/GameServer/ai/brain/ControlledNpcBrain.cs
MODIFY - DOLSharp/trunk/GameServer/ai/brain/GuardBrain.cs
MODIFY - DOLSharp/trunk/GameServer/ai/brain/StandardMobBrain.cs
MODIFY - DOLSharp/trunk/GameServer/commands/playercommands/GroundAssist.cs
MODIFY - DOLSharp/trunk/GameServer/commands/playercommands/target.cs
MODIFY - DOLSharp/trunk/GameServer/commands/playercommands/who.cs
MODIFY - DOLSharp/trunk/GameServer/gameobjects/GamePlayer.cs
MODIFY - DOLSharp/trunk/GameServer/minotaurrelics/MinotaurRelic.cs
MODIFY - DOLSharp/trunk/GameServer/realmabilities/handlers/PerfectRecoveryAbility.cs
MODIFY - DOLSharp/trunk/GameServer/serverrules/IServerRules.cs
MODIFY - DOLSharp/trunk/GameServer/spells/FocusShellHandler.cs
MODIFY - DOLSharp/trunk/GameServer/spells/Heretic/MonsterRez.cs
MODIFY - DOLSharp/trunk/GameServer/spells/Masterlevel/MasterLevelBase.cs
MODIFY - DOLSharp/trunk/GameServer/spells/ProcSpellHandler.cs
MODIFY - DOLSharp/trunk/GameServer/spells/SpellHandler.cs

View Changes:
http://dolserver.svn.sourceforge.net/do ... v&rev=2723

Re: SVN Revision 2723

PostPosted: Fri Jan 07, 2011 11:13 am
by Shursan
Can we make a serverrules IsAllowedtoCast ?

it seems IsAllowedtoAttack is not verry reliable, wrong message when you cast a spell.target == Realm

Or another possible possibility ?

Re: SVN Revision 2723

PostPosted: Fri Jan 07, 2011 12:38 pm
by Tolakram
That would require massive changes to spellhandler which, whenever changed, breaks everything because the code is horrible. What exactly is the problem, besides safe areas not allowing buffs?

Re: SVN Revision 2723 - IsAllowedToAttack vs IsSameRealm

PostPosted: Sat Jan 08, 2011 2:35 am
by Shursan
the two quiet message is wrong.

if (attacker == defender) send a message you can't attack yourself and you can't attack... must be you can't cast this spell on this target ? no ?