diff options
author | KHobbits <rob@khobbits.co.uk> | 2011-07-26 14:23:14 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2011-07-26 14:23:14 +0100 |
commit | 0ab8a2760db34de0b2d184bb7a7edb5f8cf9c23e (patch) | |
tree | 4568fc5adbc3ed5163371420d5be5213c5c4d560 | |
parent | 8bb4067f061f1b2e449a670c2f7cacf3f89eda96 (diff) | |
download | Essentials-0ab8a2760db34de0b2d184bb7a7edb5f8cf9c23e.tar Essentials-0ab8a2760db34de0b2d184bb7a7edb5f8cf9c23e.tar.gz Essentials-0ab8a2760db34de0b2d184bb7a7edb5f8cf9c23e.tar.lz Essentials-0ab8a2760db34de0b2d184bb7a7edb5f8cf9c23e.tar.xz Essentials-0ab8a2760db34de0b2d184bb7a7edb5f8cf9c23e.zip |
Adding tempban/kick broadcast permissions and adding a banned by to the broadcast.
Adding tempban/kick broadcast permissions and adding a banned by to the broadcast.
Merge branch 'master' of github.com:khobbits/Essentials
Conflicts:
Essentials/src/messages.properties
Essentials/src/messages_da.properties
Essentials/src/messages_en.properties
Essentials/src/messages_fr.properties
Essentials/src/messages_nl.properties
Merge branch 'master' of github.com:khobbits/Essentials
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandban.java | 5 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandkick.java | 19 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandtempban.java | 12 | ||||
-rw-r--r-- | Essentials/src/messages.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_da.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_de.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_en.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_fr.properties | 4 | ||||
-rw-r--r-- | Essentials/src/messages_nl.properties | 6 |
9 files changed, 43 insertions, 19 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 45e6a2035..628058c6e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.Console; import com.earth2me.essentials.OfflinePlayer; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -53,12 +54,14 @@ public class Commandban extends EssentialsCommand } player.kickPlayer(banReason); ess.getBans().banByName(player.getName()); + String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + for(Player p : server.getOnlinePlayers()) { User u = ess.getUser(p); if(u.isAuthorized("essentials.ban.notify")) { - p.sendMessage(Util.format("playerBanned", player.getName(), banReason)); + p.sendMessage(Util.format("playerBanned", senderName, player.getName(), banReason)); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java index 6bae4e713..e9b3720fe 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java @@ -1,9 +1,11 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.Console; import org.bukkit.Server; import org.bukkit.command.CommandSender; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; +import org.bukkit.entity.Player; public class Commandkick extends EssentialsCommand @@ -21,15 +23,24 @@ public class Commandkick extends EssentialsCommand throw new NotEnoughArgumentsException(); } - User u = getPlayer(server, args, 0); - if (u.isAuthorized("essentials.kick.exempt")) + User player = getPlayer(server, args, 0); + if (player.isAuthorized("essentials.kick.exempt")) { sender.sendMessage(Util.i18n("kickExempt")); return; } charge(sender); final String kickReason = args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault"); - u.kickPlayer(kickReason); - server.broadcastMessage(Util.format("playerKicked", u.getName(), kickReason)); + player.kickPlayer(kickReason); + String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + + for(Player p : server.getOnlinePlayers()) + { + User u = ess.getUser(p); + if(u.isAuthorized("essentials.kick.notify")) + { + p.sendMessage(Util.format("playerKicked", senderName, player.getName(), kickReason)); + } + } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index c9495401e..a20ad067f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.Console; import com.earth2me.essentials.OfflinePlayer; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -48,6 +49,15 @@ public class Commandtempban extends EssentialsCommand player.setBanTimeout(banTimestamp); player.kickPlayer(banReason); ess.getBans().banByName(player.getName()); - server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason)); + String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME; + + for(Player p : server.getOnlinePlayers()) + { + User u = ess.getUser(p); + if(u.isAuthorized("essentials.ban.notify")) + { + p.sendMessage(Util.format("playerBanned", senderName, player.getName(), banReason)); + } + } } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 3691f2a83..e99f1eba2 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Error parsing {0} on line {1} pendingTeleportCancelled = \u00a7cPending teleportation request cancelled. permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. -playerBanned = \u00a7cPlayer {0} banned: {1} +playerBanned = \u00a7cPlayer {0} banned {1} for {2} playerInJail = \u00a7cPlayer is already in jail {0}. playerJailed = \u00a77Player {0} jailed. playerJailedFor = \u00a77Player {0} jailed for {1}. -playerKicked = \u00a7cPlayer {0} kicked: {1} +playerKicked = \u00a7cPlayer {0} kicked {1} for: {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cPlayer {0} was never on this server. diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 13f68b5db..d4ff0c3cf 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -213,11 +213,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Fejl ved parsing {0} p\u00e5 linje {1} pendingTeleportCancelled = \u00a7cVentende teleportations anmodning aflyst. permissionsError = Mangler Permissions/GroupManager; chat pr\u00e6fikser/suffikser vil v\u00e6re sl\u00e5et fra. -playerBanned = \u00a7cSpiller {0} bannet: {1} +playerBanned = \u00a7cSpiller {0} bannet {1} - {2} playerInJail = \u00a7cSpiller er allerede i f\u00e6ngsel {0}. playerJailed = \u00a77Spiller {0} f\u00e6ngslet. playerJailedFor = \u00a77Spiller {0} f\u00e6ngslet for {1}. -playerKicked = \u00a7cPlayer {0} kicked: {1} +playerKicked = \u00a7cPlayer {0} kicked {1} for: {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cSpiller {0} var aldrig p\u00e5 denne server. diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index be24d9ac0..61fa2f6a9 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather unterst\u00fctzt nur sun/storm. parseError = Fehler beim Parsen von {0} in Zeile {1} pendingTeleportCancelled = \u00a7cLaufende Teleportierung abgebrochen. permissionsError = Permissions/GroupManager fehlt; Chat-Prefixe/-Suffixe sind ausgeschaltet. -playerBanned = \u00a7cSpieler {0} gesperrt: {1} +playerBanned = \u00a7cSpieler {0} gesperrt: {1} - {2} playerInJail = \u00a7cSpieler ist bereits in Gef\u00e4ngnis {0}. playerJailed = \u00a77Spieler {0} eingesperrt. playerJailedFor = \u00a77Spieler {0} eingesperrt f\u00fcr {1}. -playerKicked = \u00a7cSpieler {0} rausgeworfen: {1} +playerKicked = \u00a7cSpieler {0} rausgeworfen: {1} - {2} playerMuted = \u00a77Du bist jetzt stumm. playerMutedFor = \u00a77Du bist jetzt stumm f\u00fcr {0}. playerNeverOnServer = \u00a7cSpieler {0} war niemals auf diesem Server. diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 38b84bb93..e1416122d 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Error parsing {0} on line {1} pendingTeleportCancelled = \u00a7cPending teleportation request cancelled. permissionsError = Missing Permissions/GroupManager; chat prefixes/suffixes will be disabled. -playerBanned = \u00a7cPlayer {0} banned: {1} +playerBanned = \u00a7cPlayer {0} banned {1} for: {2} playerInJail = \u00a7cPlayer is already in jail {0}. playerJailed = \u00a77Player {0} jailed. playerJailedFor = \u00a77Player {0} jailed for {1}. -playerKicked = \u00a7cPlayer {0} kicked: {1} +playerKicked = \u00a7cPlayer {0} kicked {1} for: {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cPlayer {0} was never on this server. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index e240b43af..3a3a2e6cc 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -211,11 +211,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Erreur de conversion {0} \u00e0 la ligne {1} pendingTeleportCancelled = \u00a7cRequete de t\u00e9l\u00e9portation annul\u00e9e. permissionsError = Permissions/GroupManager manquant, les pr\u00e9fixes et suffixes ne seront pas affich\u00e9s. -playerBanned = \u00a7cLe joueur {0} a \u00e9t\u00e9 banni: {1} +playerBanned = \u00a7cLe joueur {0} a \u00e9t\u00e9 banni: {1} - {2} playerInJail = \u00a7cLe joueur est d\u00e9j\u00e0 dans la prison {0}. playerJailed = \u00a77Le joueur {0} a \u00e9t\u00e9 emprisonn\u00e9. playerJailedFor = \u00a77{0} a \u00e9t\u00e9 emprisonn\u00e9 pour {1}. -playerKicked = \u00a7cPlayer {0} kicked: {1} +playerKicked = \u00a7cPlayer {0} kicked {1} for {2} playerMuted = \u00a77You have been muted playerMutedFor = \u00a77You have been muted for {0} playerNeverOnServer = \u00a7cLe joueur {0} n''a jamais \u00e9t\u00e9 sur le serveur. diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 1f3915f7f..001ee64ae 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -3,7 +3,7 @@ # Translations start here # by Geertje123 addedToAccount = \u00a7a{0} is gestort op je account. -addedToOthersAccount = \u00a7a{0} is overgemaakt naar {1}''s rekening +addedToOthersAccount = \u00a7a{0} is overgemaakt naar {1}'s rekening alertBroke = gebroken: alertFormat = \u00a73[{0}] \u00a7f {1} \u00a76 {2} bij: {3} alertPlaced = geplaatst: @@ -212,11 +212,11 @@ onlySunStorm = /weather only supports sun/storm. parseError = Fout bij ontleding {0} op regel {1} pendingTeleportCancelled = \u00a7cAangevraagde teleportatie afgelast. permissionsError = Permissions/GroupManager ontbreekt; chat prefixes/suffixes worden uitgeschakeld. -playerBanned = \u00a7cSpeler {0} is geband: {1} +playerBanned = \u00a7cSpeler {0} is geband: {1} - {2} playerInJail = \u00a7cSpeler zit al in de gevangenis {0}. playerJailed = \u00a77Speler {0} is in de gevangenis gezet. playerJailedFor = \u00a77Speler {0} is in de gevangenis gezet voor {1}. -playerKicked = \u00a7cPlayer {0} kicked: {1} +playerKicked = \u00a7cPlayer {0} kicked: {1} - {2} playerMuted = \u00a77Je kreeg het zwijgen opgelegd. playerMutedFor = \u00a77Je kreeg het zwijgen opgelegd voor {0} playerNeverOnServer = \u00a7cSpeler {0} is nooit op deze server geweest. |