Brief access info is now displayed under two circumstances: if you have been granted explicit access to the territory you are in ("access granted"), or if you are a normal member of the faction which owns the territory and access is denied to you ("access restricted"). This info will be displayed through Spout under the faction tag if possible, otherwise it will be displayed through chat.

New conf.json setting:
"spoutTerritoryAccessShow": true,  - whether to show brief access info using Spout
This commit is contained in:
Brettflan
2012-05-16 15:29:00 -05:00
parent 01d9f62bdd
commit 4460438365
7 changed files with 117 additions and 11 deletions

View File

@@ -181,11 +181,10 @@ public enum FPerm
public boolean has(Object testSubject, FLocation floc, boolean informIfNot)
{
TerritoryAccess access = Board.getTerritoryAccessAt(floc);
Faction factionThere = access.getHostFaction();
if (this.isTerritoryPerm())
{
if (access.subjectHasAccess(testSubject)) return true;
if ( ! access.isHostFactionAllowed() && access.doesHostFactionMatch(testSubject) && ! FPerm.ACCESS.has(testSubject, factionThere))
if (access.subjectAccessIsRestricted(testSubject))
{
if (informIfNot)
{
@@ -200,7 +199,7 @@ public enum FPerm
return false;
}
}
return this.has(testSubject, factionThere, informIfNot);
return this.has(testSubject, access.getHostFaction(), informIfNot);
}
public boolean has(Object testSubject, Location loc, boolean informIfNot)
{

View File

@@ -209,6 +209,12 @@ public class TerritoryAccess implements JsonDeserializer<TerritoryAccess>, JsonS
return factionIDs.contains(factionID);
}
// this should normally only be checked after running subjectHasAccess() or fPlayerHasAccess() above to see if they have access explicitly granted
public boolean subjectAccessIsRestricted(Object testSubject)
{
return ( ! this.isHostFactionAllowed() && this.doesHostFactionMatch(testSubject) && ! FPerm.ACCESS.has(testSubject, this.getHostFaction()));
}
//----------------------------------------------//
// JSON Serialize/Deserialize Type Adapters