From 77d7523dc472ff89c76bc2c0cced4b7b723295dd Mon Sep 17 00:00:00 2001 From: magenoxx Date: Mon, 25 Feb 2013 13:09:08 +0400 Subject: [PATCH 1/6] Added MaxPermSize=256m to server startup scripts in release folder --- Mage.Server/release/startServer.bat | 2 +- Mage.Server/release/startServer.command | 2 +- Mage.Server/release/startServer.sh | 2 +- Mage.Server/release/startServerWin7.bat | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Server/release/startServer.bat b/Mage.Server/release/startServer.bat index 8006f82932..789cd7bce6 100644 --- a/Mage.Server/release/startServer.bat +++ b/Mage.Server/release/startServer.bat @@ -1,3 +1,3 @@ @ECHO OFF -java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M +java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M -XX:MaxPermSize=256m pause diff --git a/Mage.Server/release/startServer.command b/Mage.Server/release/startServer.command index 6555e2b1e9..7026a29219 100644 --- a/Mage.Server/release/startServer.command +++ b/Mage.Server/release/startServer.command @@ -2,4 +2,4 @@ cd "`dirname "$0"`" -java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M +java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M -XX:MaxPermSize=256m diff --git a/Mage.Server/release/startServer.sh b/Mage.Server/release/startServer.sh index d4b22d2440..5c807d21e3 100644 --- a/Mage.Server/release/startServer.sh +++ b/Mage.Server/release/startServer.sh @@ -1,3 +1,3 @@ #!/bin/sh -java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M +java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M -XX:MaxPermSize=256m diff --git a/Mage.Server/release/startServerWin7.bat b/Mage.Server/release/startServerWin7.bat index 530862dd22..79a72e68b0 100644 --- a/Mage.Server/release/startServerWin7.bat +++ b/Mage.Server/release/startServerWin7.bat @@ -4,4 +4,4 @@ set JAVA_HOME="C:\Program Files (x86)\Java\jre6\" set CLASSPATH=%JAVA_HOME%/bin;%CLASSPATH% set PATH=%JAVA_HOME%/bin;%PATH% :NOJAVADIR -java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M \ No newline at end of file +java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -Dlog4j.configuration=file:./config/log4j.properties -jar ./lib/mage-server-${project.version}.jar -Xms256M -Xmx512M -XX:MaxPermSize=256m \ No newline at end of file From 7db2889ab30d657a1f650784a4285140f8c8099e Mon Sep 17 00:00:00 2001 From: magenoxx Date: Mon, 25 Feb 2013 13:22:25 +0400 Subject: [PATCH 2/6] Added MaxPermSize to client scripts in release folder --- Mage.Client/release/startClient.bat | 2 +- Mage.Client/release/startClient.command | 2 +- Mage.Client/release/startClient.sh | 2 +- Mage.Client/release/startClientWin7.bat | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Client/release/startClient.bat b/Mage.Client/release/startClient.bat index 6e14cbccfe..230bd9a40e 100644 --- a/Mage.Client/release/startClient.bat +++ b/Mage.Client/release/startClient.bat @@ -4,4 +4,4 @@ set JAVA_HOME="C:\Program Files\Java\jre6" set CLASSPATH=%JAVA_HOME%/bin;%CLASSPATH% set PATH=%JAVA_HOME%/bin;%PATH% :NOJAVADIR -start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M \ No newline at end of file +start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M \ No newline at end of file diff --git a/Mage.Client/release/startClient.command b/Mage.Client/release/startClient.command index 72ed4a1968..0ed90abefa 100644 --- a/Mage.Client/release/startClient.command +++ b/Mage.Client/release/startClient.command @@ -2,4 +2,4 @@ cd "`dirname "$0"`" -java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M & \ No newline at end of file +java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M & \ No newline at end of file diff --git a/Mage.Client/release/startClient.sh b/Mage.Client/release/startClient.sh index 1bca2d3303..90f597dad3 100644 --- a/Mage.Client/release/startClient.sh +++ b/Mage.Client/release/startClient.sh @@ -1,3 +1,3 @@ #!/bin/sh -java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M & \ No newline at end of file +java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M & \ No newline at end of file diff --git a/Mage.Client/release/startClientWin7.bat b/Mage.Client/release/startClientWin7.bat index 54f54e5fb9..57e708bc10 100644 --- a/Mage.Client/release/startClientWin7.bat +++ b/Mage.Client/release/startClientWin7.bat @@ -4,4 +4,4 @@ set JAVA_HOME="C:\Program Files (x86)\Java\jre6\" set CLASSPATH=%JAVA_HOME%/bin;%CLASSPATH% set PATH=%JAVA_HOME%/bin;%PATH% :NOJAVADIR -start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M \ No newline at end of file +start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M \ No newline at end of file From 19c4bfc1dd0c41a8180041223d8176b878a6aa7a Mon Sep 17 00:00:00 2001 From: magenoxx Date: Mon, 25 Feb 2013 19:39:54 +0400 Subject: [PATCH 3/6] Clean up --- Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java b/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java index 2b1a06fd9b..4543b6a64b 100644 --- a/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java +++ b/Mage.Sets/src/mage/sets/futuresight/Narcomoeba.java @@ -27,8 +27,6 @@ */ package mage.sets.futuresight; -import com.sun.corba.se.impl.orbutil.closure.Constant; -import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -37,10 +35,8 @@ import mage.abilities.common.ZoneChangeTriggeredAbility; import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.counters.CounterType; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; + +import java.util.UUID; /** * From a5598c3c4b0fdae25d0ebdf9fac8db7c4871f369 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Mon, 25 Feb 2013 19:47:41 +0400 Subject: [PATCH 4/6] JVM tuning for scripts --- Mage.Client/release/startClient.bat | 2 +- Mage.Client/release/startClient.command | 2 +- Mage.Client/release/startClient.sh | 2 +- Mage.Client/release/startClientWin7.bat | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Client/release/startClient.bat b/Mage.Client/release/startClient.bat index 230bd9a40e..43a977108f 100644 --- a/Mage.Client/release/startClient.bat +++ b/Mage.Client/release/startClient.bat @@ -4,4 +4,4 @@ set JAVA_HOME="C:\Program Files\Java\jre6" set CLASSPATH=%JAVA_HOME%/bin;%CLASSPATH% set PATH=%JAVA_HOME%/bin;%PATH% :NOJAVADIR -start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M \ No newline at end of file +start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled \ No newline at end of file diff --git a/Mage.Client/release/startClient.command b/Mage.Client/release/startClient.command index 0ed90abefa..5c1f84ada5 100644 --- a/Mage.Client/release/startClient.command +++ b/Mage.Client/release/startClient.command @@ -2,4 +2,4 @@ cd "`dirname "$0"`" -java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M & \ No newline at end of file +java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled & \ No newline at end of file diff --git a/Mage.Client/release/startClient.sh b/Mage.Client/release/startClient.sh index 90f597dad3..1ab1815bf3 100644 --- a/Mage.Client/release/startClient.sh +++ b/Mage.Client/release/startClient.sh @@ -1,3 +1,3 @@ #!/bin/sh -java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M & \ No newline at end of file +java -jar ./lib/mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled & \ No newline at end of file diff --git a/Mage.Client/release/startClientWin7.bat b/Mage.Client/release/startClientWin7.bat index 57e708bc10..ca2e1dabee 100644 --- a/Mage.Client/release/startClientWin7.bat +++ b/Mage.Client/release/startClientWin7.bat @@ -4,4 +4,4 @@ set JAVA_HOME="C:\Program Files (x86)\Java\jre6\" set CLASSPATH=%JAVA_HOME%/bin;%CLASSPATH% set PATH=%JAVA_HOME%/bin;%PATH% :NOJAVADIR -start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M \ No newline at end of file +start javaw -jar .\lib\mage-client-${project.version}.jar -Xms256M -Xmx1024M -XX:MaxPermSize=256M -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled \ No newline at end of file From cd7b0f5b082f030f12fe4630eb9cdff2e2febf1e Mon Sep 17 00:00:00 2001 From: magenoxx Date: Mon, 25 Feb 2013 20:29:09 +0400 Subject: [PATCH 5/6] Client start up time speed up: don't check for new images by default --- Mage.Client/src/main/java/mage/client/MageFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 5d7e989fd3..400324c7ba 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -318,7 +318,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { @Override public void run() { disableButtons(); - if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_CHECK, "true").equals("true")) { + if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_IMAGES_CHECK, "false").equals("true")) { checkForNewImages(); } logger.info("Client start up time: " + ((System.currentTimeMillis() - startTime) / 1000 + " seconds")); From f3ae9c85a6efd35896f7350c507b4980740a0a13 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Mon, 25 Feb 2013 21:01:48 +0400 Subject: [PATCH 6/6] Fixed Issue#146: Creature moving to exile zone instead graveyard --- .../src/mage/sets/gatecrash/AureliasFury.java | 11 ++++++----- Mage.Sets/src/mage/sets/iceage/TinderWall.java | 9 +++++---- .../src/mage/sets/magic2013/FaithsReward.java | 2 +- .../mage/sets/newphyrexia/CathedralMembrane.java | 15 ++++++--------- .../mage/sets/scarsofmirrodin/SteelHellkite.java | 12 ++++++------ .../src/mage/sets/zendikar/ArchmageAscension.java | 10 ++++------ Mage.Sets/src/mage/sets/zendikar/Gomazoa.java | 9 +++++---- .../src/mage/sets/zendikar/RuneflareTrap.java | 4 +++- .../watchers/common/AttackedThisTurnWatcher.java | 2 +- .../mage/watchers/common/DamagedByWatcher.java | 9 +++++---- .../common/PlayerDamagedBySourceWatcher.java | 9 +++++---- .../watchers/common/SourceDidDamageWatcher.java | 9 +++++---- 12 files changed, 52 insertions(+), 49 deletions(-) diff --git a/Mage.Sets/src/mage/sets/gatecrash/AureliasFury.java b/Mage.Sets/src/mage/sets/gatecrash/AureliasFury.java index f2dcd31014..86b5be0410 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/AureliasFury.java +++ b/Mage.Sets/src/mage/sets/gatecrash/AureliasFury.java @@ -27,9 +27,6 @@ */ package mage.sets.gatecrash; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Outcome; @@ -55,6 +52,10 @@ import mage.target.common.TargetCreatureOrPlayerAmount; import mage.target.targetpointer.FixedTarget; import mage.watchers.WatcherImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * GATECRASH FAQ 11.01.2013 * @@ -198,8 +199,8 @@ class AureliasFuryDamagedByWatcher extends WatcherImpl { public BlockedByWatcher(final BlockedByWatcher watcher) { super(watcher); - this.blockedByWatcher = watcher.blockedByWatcher; + this.blockedByWatcher.addAll(watcher.blockedByWatcher); } @Override diff --git a/Mage.Sets/src/mage/sets/magic2013/FaithsReward.java b/Mage.Sets/src/mage/sets/magic2013/FaithsReward.java index bef23ac53f..a1d018c2a6 100644 --- a/Mage.Sets/src/mage/sets/magic2013/FaithsReward.java +++ b/Mage.Sets/src/mage/sets/magic2013/FaithsReward.java @@ -110,7 +110,7 @@ class FaithsRewardWatcher extends WatcherImpl { public FaithsRewardWatcher(final FaithsRewardWatcher watcher) { super(watcher); - this.cards = (ArrayList) watcher.cards.clone(); + this.cards.addAll(watcher.cards); } @Override diff --git a/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java b/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java index ef2641dcbe..e86e7868f7 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/CathedralMembrane.java @@ -27,15 +27,8 @@ */ package mage.sets.newphyrexia; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.Constants; -import mage.Constants.CardType; -import mage.Constants.Rarity; -import mage.Constants.TurnPhase; -import mage.Constants.WatcherScope; -import mage.Constants.Zone; +import mage.Constants.*; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.ZoneChangeTriggeredAbility; @@ -47,6 +40,10 @@ import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.watchers.WatcherImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * * @author BetaSteward @@ -149,7 +146,7 @@ class CathedralMembraneWatcher extends WatcherImpl { public CathedralMembraneWatcher(final CathedralMembraneWatcher watcher) { super(watcher); - this.blockedCreatures = watcher.blockedCreatures; + this.blockedCreatures.addAll(watcher.blockedCreatures); } @Override diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java index 117d55a10d..d7837065ae 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SteelHellkite.java @@ -30,6 +30,7 @@ package mage.sets.scarsofmirrodin; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.WatcherScope; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.ActivateOncePerTurnActivatedAbility; @@ -40,15 +41,16 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.filter.common.FilterNonlandPermanent; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.watchers.WatcherImpl; -import java.util.*; -import mage.Constants.WatcherScope; -import mage.filter.common.FilterNonlandPermanent; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; /** * @author nantuko @@ -125,9 +127,7 @@ class SteelHellkiteWatcher extends WatcherImpl { public SteelHellkiteWatcher(final SteelHellkiteWatcher watcher) { super(watcher); - for (UUID playerId: watcher.damagedPlayers) { - damagedPlayers.add(playerId); - } + damagedPlayers.addAll(watcher.damagedPlayers); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/ArchmageAscension.java b/Mage.Sets/src/mage/sets/zendikar/ArchmageAscension.java index e3556279ae..412abd5e30 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ArchmageAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/ArchmageAscension.java @@ -27,13 +27,8 @@ */ package mage.sets.zendikar; -import java.util.UUID; import mage.Constants; -import mage.Constants.CardType; -import mage.Constants.Duration; -import mage.Constants.Outcome; -import mage.Constants.Rarity; -import mage.Constants.WatcherScope; +import mage.Constants.*; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -50,6 +45,8 @@ import mage.players.Player; import mage.target.common.TargetCardInLibrary; import mage.watchers.WatcherImpl; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -122,6 +119,7 @@ class CardsDrawnControllerWatcher extends WatcherImpl { public BlockedByWatcher(final BlockedByWatcher watcher) { super(watcher); - this.blockedByWatcher = watcher.blockedByWatcher; + this.blockedByWatcher.addAll(watcher.blockedByWatcher); } @Override diff --git a/Mage.Sets/src/mage/sets/zendikar/RuneflareTrap.java b/Mage.Sets/src/mage/sets/zendikar/RuneflareTrap.java index 48cf4d368a..6760be5fb3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RuneflareTrap.java +++ b/Mage.Sets/src/mage/sets/zendikar/RuneflareTrap.java @@ -27,7 +27,6 @@ */ package mage.sets.zendikar; -import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.WatcherScope; @@ -43,6 +42,8 @@ import mage.players.Player; import mage.target.TargetPlayer; import mage.watchers.WatcherImpl; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -114,6 +115,7 @@ class CardsDrawnOpponentWatcher extends WatcherImpl { public CardsDrawnOpponentWatcher(final CardsDrawnOpponentWatcher watcher) { super(watcher); + this.cardsDrawn = watcher.cardsDrawn; } @Override diff --git a/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java b/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java index 04f4ba7d16..dfcbd3425d 100644 --- a/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java +++ b/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java @@ -49,7 +49,7 @@ public class AttackedThisTurnWatcher extends WatcherImpl { public DamagedByWatcher(final DamagedByWatcher watcher) { super(watcher); - this.damagedCreatures = watcher.damagedCreatures; + this.damagedCreatures.addAll(watcher.damagedCreatures); } @Override diff --git a/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java b/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java index ec6bed5569..71a1925825 100644 --- a/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java +++ b/Mage/src/mage/watchers/common/PlayerDamagedBySourceWatcher.java @@ -27,15 +27,16 @@ */ package mage.watchers.common; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; import mage.Constants.WatcherScope; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.watchers.WatcherImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + /** * Watcher stores whitch sources did damage to a player * @@ -52,7 +53,7 @@ public class PlayerDamagedBySourceWatcher extends WatcherImpl public SourceDidDamageWatcher(final SourceDidDamageWatcher watcher) { super(watcher); - this.damageSources = watcher.damageSources; + this.damageSources.addAll(watcher.damageSources); } @Override