1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-21 14:03:54 +02:00

[Feature] Broadcast unbans to online staff.

This commit is contained in:
Skylexia-PC
2013-03-10 03:22:35 -04:00
parent 56bd973e94
commit ee7b50a014
16 changed files with 48 additions and 14 deletions

View File

@@ -395,6 +395,11 @@ is divided into following sections:
</and> </and>
</condition> </condition>
</target> </target>
<target name="-init-test-properties">
<property name="test.binaryincludes" value="&lt;nothing&gt;"/>
<property name="test.binarytestincludes" value=""/>
<property name="test.binaryexcludes" value=""/>
</target>
<target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}"> <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/> <attribute default="${includes}" name="includes"/>
@@ -418,7 +423,7 @@ is divided into following sections:
</sequential> </sequential>
</macrodef> </macrodef>
</target> </target>
<target if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}"> <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/> <attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/> <attribute default="${excludes}" name="excludes"/>
@@ -432,6 +437,9 @@ is divided into following sections:
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/> <filename name="@{testincludes}"/>
</fileset> </fileset>
<fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
<filename name="${test.binarytestincludes}"/>
</fileset>
</batchtest> </batchtest>
<syspropertyset> <syspropertyset>
<propertyref prefix="test-sys-prop."/> <propertyref prefix="test-sys-prop."/>
@@ -559,7 +567,7 @@ is divided into following sections:
</sequential> </sequential>
</macrodef> </macrodef>
</target> </target>
<target if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch"> <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
<macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/> <attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/> <attribute default="${excludes}" name="excludes"/>
@@ -573,6 +581,9 @@ is divided into following sections:
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/> <filename name="@{testincludes}"/>
</fileset> </fileset>
<fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
<filename name="${test.binarytestincludes}"/>
</fileset>
</batchtest> </batchtest>
<syspropertyset> <syspropertyset>
<propertyref prefix="test-sys-prop."/> <propertyref prefix="test-sys-prop."/>
@@ -952,7 +963,7 @@ is divided into following sections:
<target if="has.persistence.xml" name="-copy-persistence-xml"> <target if="has.persistence.xml" name="-copy-persistence-xml">
<mkdir dir="${build.classes.dir}/META-INF"/> <mkdir dir="${build.classes.dir}/META-INF"/>
<copy todir="${build.classes.dir}/META-INF"> <copy todir="${build.classes.dir}/META-INF">
<fileset dir="${meta.inf.dir}" includes="persistence.xml"/> <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
</copy> </copy>
</target> </target>
<target name="-post-compile"> <target name="-post-compile">

View File

@@ -4,8 +4,8 @@ build.xml.stylesheet.CRC32=28e38971@1.38.2.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=a830bc14 nbproject/build-impl.xml.data.CRC32=a830bc14
nbproject/build-impl.xml.script.CRC32=7c507372 nbproject/build-impl.xml.script.CRC32=21ffdddf
nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46 nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46
nbproject/profiler-build-impl.xml.data.CRC32=ab78ce15 nbproject/profiler-build-impl.xml.data.CRC32=ab78ce15
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1 nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1

View File

@@ -1,10 +1,12 @@
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.User; import com.earth2me.essentials.User;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
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 Commandunban extends EssentialsCommand public class Commandunban extends EssentialsCommand
@@ -21,25 +23,33 @@ public class Commandunban extends EssentialsCommand
{ {
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
String name;
try try
{ {
final User user = getPlayer(server, args, 0, true); final User user = getPlayer(server, args, 0, true);
name = user.getName();
user.setBanned(false); user.setBanned(false);
user.setBanTimeout(0); user.setBanTimeout(0);
sender.sendMessage(_("unbannedPlayer"));
} }
catch (NoSuchFieldException e) catch (NoSuchFieldException e)
{ {
final OfflinePlayer player = server.getOfflinePlayer(args[0]); final OfflinePlayer player = server.getOfflinePlayer(args[0]);
if (player.isBanned()) name = player.getName();
if (!player.isBanned())
{ {
throw new Exception(_("playerNotFound"), e);
}
player.setBanned(false); player.setBanned(false);
sender.sendMessage(_("unbannedPlayer"));
return;
} }
throw new Exception(_("playerNotFound"), e); final String senderName = sender instanceof Player ? ((Player)sender).getDisplayName() : Console.NAME;
for (Player onlinePlayer : server.getOnlinePlayers())
{
final User onlineUser = ess.getUser(onlinePlayer);
if (onlinePlayer == sender || onlineUser.isAuthorized("essentials.ban.notify"))
{
onlinePlayer.sendMessage(_("playerUnbanned", senderName, name));
}
} }
} }
} }

View File

@@ -520,3 +520,4 @@ year=year
years=years years=years
youAreHealed=\u00a76You have been healed. youAreHealed=\u00a76You have been healed.
youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages! Type \u00a7c/mail read\u00a76 to view your mail. youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages! Type \u00a7c/mail read\u00a76 to view your mail.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -523,3 +523,4 @@ year=rok
years=roky years=roky
youAreHealed=\u00a77Byl jsi uzdraven. youAreHealed=\u00a77Byl jsi uzdraven.
youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Napis \u00a77/mail read\u00a7f aby jsi si precetl sve zpravy. youHaveNewMail=\u00a7cMas {0} zprav!\u00a7f Napis \u00a77/mail read\u00a7f aby jsi si precetl sve zpravy.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=\u00e5r
years=\u00e5r years=\u00e5r
youAreHealed=\u00a77Du er blevet healed. Halleluja! youAreHealed=\u00a77Du er blevet healed. Halleluja!
youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost. youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=Jahr
years=Jahre years=Jahre
youAreHealed=\u00a77Du wurdest geheilt. youAreHealed=\u00a77Du wurdest geheilt.
youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen. youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=year
years=years years=years
youAreHealed=\u00a76You have been healed. youAreHealed=\u00a76You have been healed.
youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages! Type \u00a7c/mail read\u00a76 to view your mail. youHaveNewMail=\u00a76You have\u00a7c {0} \u00a76messages! Type \u00a7c/mail read\u00a76 to view your mail.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=ano
years=anos years=anos
youAreHealed=\u00a77Has sido curado. youAreHealed=\u00a77Has sido curado.
youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!. youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=vuosi
years=vuosia years=vuosia
youAreHealed=\u00a77Sinut on parannettu. youAreHealed=\u00a77Sinut on parannettu.
youHaveNewMail=\u00a7cSinulla on {0} viesti(\u00e4)!\u00a7f Kirjoita \u00a77/mail read\u00a7f lukeaksesi viestit. youHaveNewMail=\u00a7cSinulla on {0} viesti(\u00e4)!\u00a7f Kirjoita \u00a77/mail read\u00a7f lukeaksesi viestit.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=ann\u00e9e
years=ann\u00e9es years=ann\u00e9es
youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9.
youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier. youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=anno
years=anni years=anni
youAreHealed=\u00a77Sei stato curato. youAreHealed=\u00a77Sei stato curato.
youHaveNewMail=\u00a7cHai {0} messaggi!\u00a7f digita \u00a77/mail read\u00a7f per consultare la tua mail. youHaveNewMail=\u00a7cHai {0} messaggi!\u00a7f digita \u00a77/mail read\u00a7f per consultare la tua mail.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=jaar
years=jaren years=jaren
youAreHealed=\u00a77Je bent genezen. youAreHealed=\u00a77Je bent genezen.
youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken. youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=rok
years=lat years=lat
youAreHealed=\u00a77Zostales/as uleczony/na. youAreHealed=\u00a77Zostales/as uleczony/na.
youHaveNewMail=\u00a77Masz\u00a7c {0} \u00a77wiadomosci! Wpisz \u00a7c/mail read\u00a77 aby je przeczytac. youHaveNewMail=\u00a77Masz\u00a7c {0} \u00a77wiadomosci! Wpisz \u00a7c/mail read\u00a77 aby je przeczytac.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=ano
years=anos years=anos
youAreHealed=\u00a77Voc\u00ea foi curado. youAreHealed=\u00a77Voc\u00ea foi curado.
youHaveNewMail=\u00a7cVoc\u00ea tem {0} mensagens!\u00a7f Digite \u00a77/mail read\u00a7f para ver seu email. youHaveNewMail=\u00a7cVoc\u00ea tem {0} mensagens!\u00a7f Digite \u00a77/mail read\u00a7f para ver seu email.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.

View File

@@ -520,3 +520,4 @@ year=\u00e5r
years=\u00e5r years=\u00e5r
youAreHealed=\u00a77Du har blivit l\u00e4kt. youAreHealed=\u00a77Du har blivit l\u00e4kt.
youHaveNewMail=\u00a7cDu har {0} meddelanden!\u00a7f Skriv \u00a77/mail read\u00a7f f\u00f6r att l\u00e4sa dina meddelanden. youHaveNewMail=\u00a7cDu har {0} meddelanden!\u00a7f Skriv \u00a77/mail read\u00a7f f\u00f6r att l\u00e4sa dina meddelanden.
playerUnbanned=\u00a76Player\u00a7c {0} \u00a76unbanned {1}.