Include IP address when banning IP

This commit is contained in:
Necrodoom 2013-02-27 15:57:14 +02:00 committed by KHobbits
parent 13efbb666d
commit 090c1f6f83
14 changed files with 29 additions and 16 deletions

View File

@ -1,9 +1,13 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.OfflinePlayer;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.logging.Level;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Commandbanip extends EssentialsCommand public class Commandbanip extends EssentialsCommand
@ -26,7 +30,7 @@ public class Commandbanip extends EssentialsCommand
if (player == null) if (player == null)
{ {
ess.getServer().banIP(args[0]); ess.getServer().banIP(args[0]);
sender.sendMessage(_("banIpAddress")); sender.sendMessage(_("banIpAddress"), senderName, args[0]);
} }
else else
{ {
@ -35,8 +39,17 @@ public class Commandbanip extends EssentialsCommand
{ {
throw new Exception(_("playerNotFound")); throw new Exception(_("playerNotFound"));
} }
ess.getServer().banIP(player.getLastLoginAddress()); ess.getServer().banIP(ipAddress);
sender.sendMessage(_("banIpAddress")); final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
server.getLogger().log(Level.INFO, _("banIpAddress", senderName, ipAddress));
for (Player onlinePlayer : server.getOnlinePlayers())
{
final User player = ess.getUser(onlinePlayer);
if (onlinePlayer == sender || player.isAuthorized("essentials.ban.notify"))
{
sender.sendMessage(_("banIpAddress", senderName, ipAddress));
}
}
} }
} }
} }

View File

@ -24,7 +24,7 @@ balance=\u00a7aBalance:\u00a7c {0}
balanceTop=\u00a76Top balances ({0}) balanceTop=\u00a76Top balances ({0})
banExempt=\u00a74You can not ban that player. banExempt=\u00a74You can not ban that player.
banFormat=\u00a74Banned:\n\u00a7r{0} banFormat=\u00a74Banned:\n\u00a7r{0}
banIpAddress=\u00a76Banned IP address banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt. bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt.
bigTreeSuccess= \u00a76Big tree spawned. bigTreeSuccess= \u00a76Big tree spawned.
blockList=\u00a76Essentials relayed the following commands to another plugin: blockList=\u00a76Essentials relayed the following commands to another plugin:

View File

@ -27,7 +27,7 @@ balance=\u00a77Ucet: {0}
balanceTop=\u00a77Nejbohatsi hraci ({0}) balanceTop=\u00a77Nejbohatsi hraci ({0})
banExempt=\u00a7cNemuzes zabanovat tohoto hrace. banExempt=\u00a7cNemuzes zabanovat tohoto hrace.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77IP Adresa byla zabanovana banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cProblem pri vytvareni velkeho stromu. Zkuste znovu na trave nebo hline. bigTreeFailure=\u00a7cProblem pri vytvareni velkeho stromu. Zkuste znovu na trave nebo hline.
bigTreeSuccess= \u00a77Velky strom vytvoren. bigTreeSuccess= \u00a77Velky strom vytvoren.
blockList=Essentials prenechal nasledujici prikazy jinemu pluginu: blockList=Essentials prenechal nasledujici prikazy jinemu pluginu:

View File

@ -24,7 +24,7 @@ balance=\u00a77Saldo: {0}
balanceTop=\u00a77Top saldoer ({0}) balanceTop=\u00a77Top saldoer ({0})
banExempt=\u00a7cDu kan ikke banne den p\u00e5g\u00e6ldende spiller. banExempt=\u00a7cDu kan ikke banne den p\u00e5g\u00e6ldende spiller.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77Bannede IP addresse banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cFejl i generering af stort tr\u00e6. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord. bigTreeFailure=\u00a7cFejl i generering af stort tr\u00e6. Pr\u00f8v igen p\u00e5 gr\u00e6s eller jord.
bigTreeSuccess= \u00a77Stort tr\u00e6 bygget. bigTreeSuccess= \u00a77Stort tr\u00e6 bygget.
blockList=Essentials relayed the following commands to another plugin: blockList=Essentials relayed the following commands to another plugin:

View File

@ -24,7 +24,7 @@ balance=\u00a77Geldb\u00f6rse: {0}
balanceTop=\u00a77Top Guthaben ({0}) balanceTop=\u00a77Top Guthaben ({0})
banExempt=\u00a7cDu kannst diesen Spieler nicht sperren. banExempt=\u00a7cDu kannst diesen Spieler nicht sperren.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77IP-Adresse gesperrt. banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cFehler beim Pflanzen eines grossen Baums. Versuch es auf Gras oder Dreck. bigTreeFailure=\u00a7cFehler beim Pflanzen eines grossen Baums. Versuch es auf Gras oder Dreck.
bigTreeSuccess= \u00a77Grosser Baum gepflanzt. bigTreeSuccess= \u00a77Grosser Baum gepflanzt.
blockList=Essentials relayed the following commands to another plugin: blockList=Essentials relayed the following commands to another plugin:

View File

@ -24,7 +24,7 @@ balance=\u00a7aBalance:\u00a7c {0}
balanceTop=\u00a76Top balances ({0}) balanceTop=\u00a76Top balances ({0})
banExempt=\u00a74You can not ban that player. banExempt=\u00a74You can not ban that player.
banFormat=\u00a74Banned:\n\u00a7r{0} banFormat=\u00a74Banned:\n\u00a7r{0}
banIpAddress=\u00a76Banned IP address banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt. bigTreeFailure=\u00a74Big tree generation failure. Try again on grass or dirt.
bigTreeSuccess= \u00a76Big tree spawned. bigTreeSuccess= \u00a76Big tree spawned.
blockList=\u00a76Essentials relayed the following commands to another plugin: blockList=\u00a76Essentials relayed the following commands to another plugin:

View File

@ -24,7 +24,7 @@ balance=\u00a77Cantidad: {0}
balanceTop=\u00a77Ranking de cantidades ({0}) balanceTop=\u00a77Ranking de cantidades ({0})
banExempt=\u00a7cNo puedes bannear a ese jugador. banExempt=\u00a7cNo puedes bannear a ese jugador.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77Direccion IP baneada. banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cBig Generacion de arbol fallida. Prueba de nuevo en hierba o arena. bigTreeFailure=\u00a7cBig Generacion de arbol fallida. Prueba de nuevo en hierba o arena.
bigTreeSuccess= \u00a77Big Arbol generado. bigTreeSuccess= \u00a77Big Arbol generado.
blockList=Essentials le ha cedido los siguientes comandos a otros plugins: blockList=Essentials le ha cedido los siguientes comandos a otros plugins:

View File

@ -24,7 +24,7 @@ balance=\u00a77Rahatilanne: {0}
balanceTop=\u00a77Top rahatilanteet ({0}) balanceTop=\u00a77Top rahatilanteet ({0})
banExempt=\u00a7cEt voi bannia pelaajaa. banExempt=\u00a7cEt voi bannia pelaajaa.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77Bannattu IP osoite banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cIson puun luominen ep\u00e4onnistui. Yrit\u00e4 uudelleen nurmikolla tai mullalla. bigTreeFailure=\u00a7cIson puun luominen ep\u00e4onnistui. Yrit\u00e4 uudelleen nurmikolla tai mullalla.
bigTreeSuccess= \u00a77Iso puu luotu. bigTreeSuccess= \u00a77Iso puu luotu.
blockList=Essentials siirsi seuraavat komennot muihin plugineihin: blockList=Essentials siirsi seuraavat komennot muihin plugineihin:

View File

@ -24,7 +24,7 @@ balance=\u00a77Solde : {0}
balanceTop=\u00a77Meilleurs soldes au ({0}) balanceTop=\u00a77Meilleurs soldes au ({0})
banExempt=\u00a77Vous ne pouvez pas bannir ce joueur. banExempt=\u00a77Vous ne pouvez pas bannir ce joueur.
banFormat=Banni : {0} banFormat=Banni : {0}
banIpAddress=\u00a77Adresse IP bannie. banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l'herbe. bigTreeFailure=\u00a7c\u00c9chec de la g\u00e9n\u00e9ration du gros arbre. Essayez de nouveau sur de la terre ou de l'herbe.
bigTreeSuccess=\u00a77Gros arbre cr\u00e9e. bigTreeSuccess=\u00a77Gros arbre cr\u00e9e.
blockList=Essentials a relay\u00e9 les commandes suivantes \u00e0 un autre plugin : blockList=Essentials a relay\u00e9 les commandes suivantes \u00e0 un autre plugin :

View File

@ -24,7 +24,7 @@ balance=\u00a77Bilancio: {0}
balanceTop=\u00a77Top bilanci ({0}) balanceTop=\u00a77Top bilanci ({0})
banExempt=\u00a7cNon puoi bannare questo player. banExempt=\u00a7cNon puoi bannare questo player.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77IP address bannato banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cCreazione del grande albero fallita. Riprova sull''erba o sul terreno. bigTreeFailure=\u00a7cCreazione del grande albero fallita. Riprova sull''erba o sul terreno.
bigTreeSuccess= \u00a77Grande albero creato. bigTreeSuccess= \u00a77Grande albero creato.
blockList=Essentials ha trasmesso i seguenti comandi ad un altro plugin: blockList=Essentials ha trasmesso i seguenti comandi ad un altro plugin:

View File

@ -24,7 +24,7 @@ balance=\u00a77Saldo: {0}
balanceTop=\u00a77 Top saldo ({0}) balanceTop=\u00a77 Top saldo ({0})
banExempt=\u00a77Je kunt deze speler niet verbannen. banExempt=\u00a77Je kunt deze speler niet verbannen.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77Verbannen IP-adres. banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cMaken van een grote boom is mislukt. Probeer het opnieuw op gras of dirt. bigTreeFailure=\u00a7cMaken van een grote boom is mislukt. Probeer het opnieuw op gras of dirt.
bigTreeSuccess= \u00a77Grote boom gemaakt. bigTreeSuccess= \u00a77Grote boom gemaakt.
blockList=Essentials heeft de volgende commandos doorgegeven naar een andere plugin: blockList=Essentials heeft de volgende commandos doorgegeven naar een andere plugin:

View File

@ -24,7 +24,7 @@ balance=\u00a7aStan konta:\u00a7c {0}
balanceTop=\u00a77Najbogatsi gracze ({0}) balanceTop=\u00a77Najbogatsi gracze ({0})
banExempt=\u00a74Nie mozesz zbanowac tego gracza. banExempt=\u00a74Nie mozesz zbanowac tego gracza.
banFormat=\u00a74Zbanowany: {0} banFormat=\u00a74Zbanowany: {0}
banIpAddress=\u00a77Zbanowano adres IP banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a74Nie mozna tutaj postawic duzego drzewa. Sprobuj ponownie na ziemi lub trawie. bigTreeFailure=\u00a74Nie mozna tutaj postawic duzego drzewa. Sprobuj ponownie na ziemi lub trawie.
bigTreeSuccess= \u00a77Stworzono duze drzewo. bigTreeSuccess= \u00a77Stworzono duze drzewo.
blockList=\u00a77Essentials przekazuje nastepujace polecenie do innej wtyczki: blockList=\u00a77Essentials przekazuje nastepujace polecenie do innej wtyczki:

View File

@ -24,7 +24,7 @@ balance=\u00a77Saldo: {0}
balanceTop=\u00a77 Saldos superiores ({0}) balanceTop=\u00a77 Saldos superiores ({0})
banExempt=\u00a7cVoc\u00ea nao pode banir este jogador. banExempt=\u00a7cVoc\u00ea nao pode banir este jogador.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77Endere\u00e7o de IP banido banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cFalha na gera\u00e7ao da \u00e1rvore grande. Tente de novo na terra ou grama. bigTreeFailure=\u00a7cFalha na gera\u00e7ao da \u00e1rvore grande. Tente de novo na terra ou grama.
bigTreeSuccess= \u00a77\u00c1rvore grande gerada. bigTreeSuccess= \u00a77\u00c1rvore grande gerada.
blockList=Essentials passou o seguinte comando a outro plugin: blockList=Essentials passou o seguinte comando a outro plugin:

View File

@ -24,7 +24,7 @@ balance=\u00a77Balans: {0}
balanceTop=\u00a77Topp balans ({0}) balanceTop=\u00a77Topp balans ({0})
banExempt=\u00a7cDu kan inte banna den spelaren. banExempt=\u00a7cDu kan inte banna den spelaren.
banFormat=Banned: {0} banFormat=Banned: {0}
banIpAddress=\u00a77Bannade IP-adress banIpAddress=\u00a76Player\u00a7c {0} \u00a76banned IP address {1} \u00a76.
bigTreeFailure=\u00a7cEtt stort tr\u00e4d kunde inte genereras misslyckades. F\u00f6s\u00f6k igen p\u00e5 gr\u00e4s eller jord. bigTreeFailure=\u00a7cEtt stort tr\u00e4d kunde inte genereras misslyckades. F\u00f6s\u00f6k igen p\u00e5 gr\u00e4s eller jord.
bigTreeSuccess= \u00a77Stort tr\u00e4d genererat. bigTreeSuccess= \u00a77Stort tr\u00e4d genererat.
blockList=Essentials vidarebefordrade f\u00f6ljande kommandon till ett annat insticksprogram: blockList=Essentials vidarebefordrade f\u00f6ljande kommandon till ett annat insticksprogram: