mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 14:38:58 +00:00
v0.35:
- Fix chat spy.
This commit is contained in:
1 parent
3ada8dd4ec
commit
bc4fd7d887
3 files changed
+27
-2
No files matched your search
@@ -133,3 +133,5 @@ v0.33:
|
|||||||
- Only modify the chat format if modify_chat = true for all channels.
|
- Only modify the chat format if modify_chat = true for all channels.
|
||||||
v0.34:
|
v0.34:
|
||||||
- Make sure craftIRC is loaded first (if using)
|
- Make sure craftIRC is loaded first (if using)
|
||||||
|
v0.35:
|
||||||
|
- Fix chat spy.
|
||||||
@@ -66,6 +66,7 @@ public class StandardChannel extends Channel {
|
|||||||
}
|
}
|
||||||
Format = ChatSettings.getRelevantFormatGroup(player).getTOWN();
|
Format = ChatSettings.getRelevantFormatGroup(player).getTOWN();
|
||||||
recipients = new HashSet<Player>(findRecipients(player, TownyUniverse.getOnlinePlayers(town)));
|
recipients = new HashSet<Player>(findRecipients(player, TownyUniverse.getOnlinePlayers(town)));
|
||||||
|
recipients = checkSpying(recipients);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NATION:
|
case NATION:
|
||||||
@@ -75,6 +76,7 @@ public class StandardChannel extends Channel {
|
|||||||
}
|
}
|
||||||
Format = ChatSettings.getRelevantFormatGroup(player).getNATION();
|
Format = ChatSettings.getRelevantFormatGroup(player).getNATION();
|
||||||
recipients = new HashSet<Player>(findRecipients(player, TownyUniverse.getOnlinePlayers(nation)));
|
recipients = new HashSet<Player>(findRecipients(player, TownyUniverse.getOnlinePlayers(nation)));
|
||||||
|
recipients = checkSpying(recipients);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEFAULT:
|
case DEFAULT:
|
||||||
@@ -145,7 +147,6 @@ public class StandardChannel extends Channel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the distance between players and return a result based upon the range setting
|
* Check the distance between players and return a result based upon the range setting
|
||||||
* -1 = no limit
|
* -1 = no limit
|
||||||
@@ -225,4 +226,26 @@ public class StandardChannel extends Channel {
|
|||||||
return recipients;
|
return recipients;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add all spying players to the recipients list.
|
||||||
|
*
|
||||||
|
* @param recipients
|
||||||
|
* @return new recipients including spying.
|
||||||
|
*/
|
||||||
|
private Set<Player> checkSpying(Set<Player> recipients) {
|
||||||
|
|
||||||
|
List<Player> allOnline = new ArrayList<Player>(Arrays.asList(BukkitTools.getOnlinePlayers()));
|
||||||
|
|
||||||
|
// Compile the list of recipients with spy perms
|
||||||
|
for (Player test : allOnline) {
|
||||||
|
|
||||||
|
if ((plugin.getTowny().hasPlayerMode(test, "spy")) && !(recipients.contains(test))) {
|
||||||
|
recipients.add(test);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return recipients;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name: TownyChat
|
name: TownyChat
|
||||||
main: com.palmergames.bukkit.TownyChat.Chat
|
main: com.palmergames.bukkit.TownyChat.Chat
|
||||||
version: 0.34
|
version: 0.35
|
||||||
author: ElgarL, Shade, phrstbrn
|
author: ElgarL, Shade, phrstbrn
|
||||||
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
website: http://code.google.com/a/eclipselabs.org/p/towny/
|
||||||
description: >
|
description: >
|
||||||
|
|||||||
Reference in new issue
Block a user