From: Hendrik B. <nh...@us...> - 2013-01-06 16:24:37
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10528/src/games/stendhal/server/actions/buddy Modified Files: GrumpyAction.java IgnoreAction.java AddBuddyAction.java RemoveBuddyAction.java UnignoreAction.java BuddyAction.java BuddyCleanup.java Log Message: code cleanup (mostly @Override) Index: UnignoreAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy/UnignoreAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** UnignoreAction.java 19 Sep 2010 02:21:47 -0000 1.7 --- UnignoreAction.java 6 Jan 2013 16:24:03 -0000 1.8 *************** *** 20,23 **** --- 20,24 ---- class UnignoreAction implements ActionListener { + @Override public void onAction(final Player player, final RPAction action) { if (action.has(TARGET)) { Index: BuddyCleanup.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy/BuddyCleanup.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BuddyCleanup.java 10 Jan 2011 19:07:04 -0000 1.2 --- BuddyCleanup.java 6 Jan 2013 16:24:03 -0000 1.3 *************** *** 71,74 **** --- 71,75 ---- } + @Override public void onTurnReached(int currentTurn) { QueryCanonicalCharacterNamesCommand checkCommand = DBCommandQueue.get().getOneResult(QueryCanonicalCharacterNamesCommand.class, handle); *************** *** 106,110 **** final Player buddy = SingletonRepository.getRuleProcessor().getPlayer(newName); ! if (player.addBuddy(newName, buddy!=null && !buddy.isGhost())) { new GameEvent(player.getName(), "buddy", "add", newName).raise(); } --- 107,111 ---- final Player buddy = SingletonRepository.getRuleProcessor().getPlayer(newName); ! if (player.addBuddy(newName, (buddy!=null) && !buddy.isGhost())) { new GameEvent(player.getName(), "buddy", "add", newName).raise(); } Index: BuddyAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy/BuddyAction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BuddyAction.java 25 Feb 2009 23:42:53 -0000 1.5 --- BuddyAction.java 6 Jan 2013 16:24:03 -0000 1.6 *************** *** 21,25 **** public class BuddyAction { ! public static void register() { CommandCenter.register(ADDBUDDY, new AddBuddyAction()); --- 21,25 ---- public class BuddyAction { ! public static void register() { CommandCenter.register(ADDBUDDY, new AddBuddyAction()); Index: AddBuddyAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy/AddBuddyAction.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AddBuddyAction.java 10 Jan 2011 19:07:04 -0000 1.22 --- AddBuddyAction.java 6 Jan 2013 16:24:02 -0000 1.23 *************** *** 37,41 **** */ class AddBuddyAction implements ActionListener, TurnListener { ! private ResultHandle handle = new ResultHandle(); --- 37,41 ---- */ class AddBuddyAction implements ActionListener, TurnListener { ! private ResultHandle handle = new ResultHandle(); *************** *** 48,51 **** --- 48,52 ---- * The action. */ + @Override public void onAction(final Player player, final RPAction action) { if (countBuddies(player) > 500) { *************** *** 66,69 **** --- 67,71 ---- * @param currentTurn ignored */ + @Override public void onTurnReached(int currentTurn) { QueryCanonicalCharacterNamesCommand checkcommand = DBCommandQueue.get().getOneResult(QueryCanonicalCharacterNamesCommand.class, handle); Index: RemoveBuddyAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy/RemoveBuddyAction.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RemoveBuddyAction.java 26 Feb 2012 15:39:10 -0000 1.15 --- RemoveBuddyAction.java 6 Jan 2013 16:24:03 -0000 1.16 *************** *** 21,24 **** --- 21,25 ---- class RemoveBuddyAction implements ActionListener { + @Override public void onAction(final Player player, final RPAction action) { if (action.has(TARGET)) { *************** *** 32,36 **** new GameEvent(player.getName(), "buddy", "remove", name).raise(); player.sendPrivateText(name + " was removed from your buddy list."); ! ++removed; } --- 33,37 ---- new GameEvent(player.getName(), "buddy", "remove", name).raise(); player.sendPrivateText(name + " was removed from your buddy list."); ! ++removed; } Index: GrumpyAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy/GrumpyAction.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GrumpyAction.java 19 Sep 2010 02:21:47 -0000 1.6 --- GrumpyAction.java 6 Jan 2013 16:24:02 -0000 1.7 *************** *** 28,31 **** --- 28,32 ---- * The action. */ + @Override public void onAction(final Player player, final RPAction action) { if (action.has(REASON)) { Index: IgnoreAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/buddy/IgnoreAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IgnoreAction.java 2 Apr 2011 15:44:20 -0000 1.8 --- IgnoreAction.java 6 Jan 2013 16:24:02 -0000 1.9 *************** *** 32,40 **** public void onAction(final Player player, final RPAction action) { if (action.has(LIST)) { // if we don't test this then getSlot and it was empty does something bad to client. if (player.getSlot("!ignore").size() > 0) { ! // clone the !ignore slot to avoid a ConcurrentModificationException // as the check in getIgnore modifies !ignore final RPSlot ignoreSlot = (RPSlot) player.getSlot("!ignore").clone(); --- 32,41 ---- + @Override public void onAction(final Player player, final RPAction action) { if (action.has(LIST)) { // if we don't test this then getSlot and it was empty does something bad to client. if (player.getSlot("!ignore").size() > 0) { ! // clone the !ignore slot to avoid a ConcurrentModificationException // as the check in getIgnore modifies !ignore final RPSlot ignoreSlot = (RPSlot) player.getSlot("!ignore").clone(); *************** *** 55,59 **** if (checkIgnore != null) { String reason; ! if (checkIgnore.length() == 0) { reason = ""; } else { --- 56,60 ---- if (checkIgnore != null) { String reason; ! if (checkIgnore.length() == 0) { reason = ""; } else { *************** *** 71,75 **** } else { // list could be unfeasibly long to print out to player so give a sublist but also the total number out of interest ! player.sendPrivateText("You are ignoring " + namesAndReasons.size() + " players. The first 50 entries in your ignore list are " + Grammar.enumerateCollection(namesAndReasons.subList(0, 50)) + "."); } --- 72,76 ---- } else { // list could be unfeasibly long to print out to player so give a sublist but also the total number out of interest ! player.sendPrivateText("You are ignoring " + namesAndReasons.size() + " players. The first 50 entries in your ignore list are " + Grammar.enumerateCollection(namesAndReasons.subList(0, 50)) + "."); } |