diff --git a/build.ant.properties b/build.ant.properties index ed556285df..665e79b023 100644 --- a/build.ant.properties +++ b/build.ant.properties @@ -75,8 +75,8 @@ updates_server = http://arianne.sourceforge.net/stendhal/updates version_server = http://arianne.sourceforge.net/stendhal.version # current version of stendhal -version.old = 0.81 -version = 0.81.5 +version.old = 0.82 +version = 0.82.2 # javac options javac.deprecation = true diff --git a/data/conf/zones/kirdneh.xml b/data/conf/zones/kirdneh.xml index 51e278b694..cff8987b72 100644 --- a/data/conf/zones/kirdneh.xml +++ b/data/conf/zones/kirdneh.xml @@ -49,7 +49,7 @@ Whut I be buyin: cod 10 char 30 trout 45 -roach 30 +roach 10 perch 22 mackerel 20 clownfish 30 diff --git a/doc/CHANGES.txt b/doc/CHANGES.txt index 36aed1a549..25f9af3000 100644 --- a/doc/CHANGES.txt +++ b/doc/CHANGES.txt @@ -1,15 +1,28 @@ Changelog --------- +0.82.2 +*bugfixes* +- recover automatically from corrupted cache files + + +0.82.1 +*bugfixes* +- new command /clickmode to toggle between single click walking and double click walking +- fixed movement to drop target (only Microsoft Windows was affected) +- fixed /mute not being stored accross restarts +- fixed pets not ownable + + 0.82 *features - single click movement -- easter bunny -- pied piper quest +- Easter Bunny +- Pied Piper quest - open manual on key F1 - added /volume support for sound - asynchronous database access -- kalavan orb -- sad scientist quest +- Kalavan orb +- Sad Scientist quest *admins* - new /script AdminPortal.class @@ -24,7 +37,10 @@ Changelog - Carmen only asks for her quest if the player is at least level 2. - improved stability of the client in uncommon situations - stat changes that occurred during zone change (like losing xp on death) did not update the stats window. -- click walking is now a lot smother +- click walking is now a lot smoother +- fixed Harold telling players about expiring earnings every minute + + 0.81.3 - prevent crash on "No line matching interface" (fixes #2970406) diff --git a/libs/marauroa.jar b/libs/marauroa.jar index c5b5778855..24273f583d 100644 Binary files a/libs/marauroa.jar and b/libs/marauroa.jar differ diff --git a/runserver.bat b/runserver.bat index 29aca7e507..e84cf0c7f4 100644 --- a/runserver.bat +++ b/runserver.bat @@ -1,3 +1,3 @@ -set STENDHAL_VERSION=0.81.5 +set STENDHAL_VERSION=0.82.1 set LOCALCLASSPATH=.;data\script;data\conf;stendhal-server-%STENDHAL_VERSION%.jar;marauroa.jar;mysql-connector.jar;log4j.jar;commons-lang.jar;h2.jar java -Xmx400m -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c server.ini -l diff --git a/runserver.sh b/runserver.sh index 8322a4b628..2d38e844fc 100644 --- a/runserver.sh +++ b/runserver.sh @@ -1,5 +1,5 @@ #!/bin/sh -STENDHAL_VERSION="0.81.5" +STENDHAL_VERSION="0.82.1" LOCALCLASSPATH=.:data/script/:data/conf/:stendhal-server-$STENDHAL_VERSION.jar:marauroa.jar:mysql-connector.jar:log4j.jar:commons-lang.jar:h2.jar diff --git a/src/games/stendhal/client/StendhalClient.java b/src/games/stendhal/client/StendhalClient.java index fd4482e7cb..f9014889b2 100644 --- a/src/games/stendhal/client/StendhalClient.java +++ b/src/games/stendhal/client/StendhalClient.java @@ -249,7 +249,6 @@ public class StendhalClient extends ClientFramework { handler.apply(message, world_objects); } catch (final Exception e) { logger.error("error processing message " + message, e); - System.exit(1); } } @@ -301,7 +300,9 @@ public class StendhalClient extends ClientFramework { } catch (final Exception e) { e.printStackTrace(); logger.error(e, e); - System.exit(1); + + // request retransmission + item.ack = true; } } else { logger.debug("Content " + item.name @@ -349,7 +350,6 @@ public class StendhalClient extends ClientFramework { contentHandling(item.name, new ByteArrayInputStream(item.data)); } catch (final Exception e) { logger.error("onTransfer", e); - System.exit(2); } } diff --git a/src/games/stendhal/client/actions/ClickModeAction.java b/src/games/stendhal/client/actions/ClickModeAction.java new file mode 100644 index 0000000000..0b9d38e422 --- /dev/null +++ b/src/games/stendhal/client/actions/ClickModeAction.java @@ -0,0 +1,34 @@ +package games.stendhal.client.actions; + +import games.stendhal.client.ClientSingletonRepository; +import games.stendhal.client.gui.chatlog.StandardEventLine; +import games.stendhal.client.gui.wt.core.WtWindowManager; + +/** + * switches between single click and double click + * + * @author hendrik + */ +public class ClickModeAction implements SlashAction { + + public boolean execute(String[] params, String remainder) { + boolean doubleClick = Boolean.parseBoolean(WtWindowManager.getInstance().getProperty("ui.doubleclick", "false")); + doubleClick = !doubleClick; + WtWindowManager.getInstance().setProperty("ui.doubleclick", Boolean.toString(doubleClick)); + if (doubleClick) { + ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Click mode is now set to double click.")); + } else { + ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Click mode is now set to single click.")); + } + return true; + } + + public int getMaximumParameters() { + return 0; + } + + public int getMinimumParameters() { + return 0; + } + +} diff --git a/src/games/stendhal/client/actions/HelpAction.java b/src/games/stendhal/client/actions/HelpAction.java index 554718975e..d3cf2b9ff0 100644 --- a/src/games/stendhal/client/actions/HelpAction.java +++ b/src/games/stendhal/client/actions/HelpAction.java @@ -47,11 +47,11 @@ class HelpAction implements SlashAction { "- /grumpy \t\tRemove status grumpy", "- /name \tGive a name to your pet", "* Misc: ", + "- /clickmode \t\t switches between single click mode and double click mode", "- /info \t\tFind out what the current server time is", "- /mute\t\tMute or unmute the sounds", - "- /volume show\t\tShow the current volume of sounds and music", - "- /volume \t\tSets the volume for the specified group" - }; + "- /volume\t\tLists or sets the volume for sound and music" + }; for (final String line : lines) { ClientSingletonRepository.getUserInterface().addEventLine(new HeaderLessEventLine(line, NotificationType.CLIENT)); diff --git a/src/games/stendhal/client/actions/MuteAction.java b/src/games/stendhal/client/actions/MuteAction.java index b6f2025402..2155970b3e 100644 --- a/src/games/stendhal/client/actions/MuteAction.java +++ b/src/games/stendhal/client/actions/MuteAction.java @@ -29,7 +29,7 @@ class MuteAction implements SlashAction { if (play) { ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Sounds are now on.")); } else { - ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Sounds are now off. (You may need to change the zone to stop the background music).")); + ClientSingletonRepository.getUserInterface().addEventLine(new StandardEventLine("Sounds are now off.")); } return true; } diff --git a/src/games/stendhal/client/actions/SlashActionRepository.java b/src/games/stendhal/client/actions/SlashActionRepository.java index c8b9f478ef..b5dbfa3b1c 100644 --- a/src/games/stendhal/client/actions/SlashActionRepository.java +++ b/src/games/stendhal/client/actions/SlashActionRepository.java @@ -30,8 +30,9 @@ public class SlashActionRepository { actions.put("ban", new BanAction()); actions.put("clear", new ClearChatLogAction()); + actions.put("clickmode", new ClickModeAction()); actions.put("crash", new CrashClientAction()); - + actions.put("drop", new DropAction()); actions.put("faq", new FAQAction()); diff --git a/src/games/stendhal/client/gui/j2d/entity/Portal2DView.java b/src/games/stendhal/client/gui/j2d/entity/Portal2DView.java index 293aa52700..142132e920 100644 --- a/src/games/stendhal/client/gui/j2d/entity/Portal2DView.java +++ b/src/games/stendhal/client/gui/j2d/entity/Portal2DView.java @@ -73,4 +73,10 @@ class Portal2DView extends InvisibleEntity2DView { break; } } + + @Override + public boolean isInteractive() { + return false; + } + } diff --git a/src/games/stendhal/client/gui/wt/GroundContainer.java b/src/games/stendhal/client/gui/wt/GroundContainer.java index b0bffa9c7b..c56438f7b5 100644 --- a/src/games/stendhal/client/gui/wt/GroundContainer.java +++ b/src/games/stendhal/client/gui/wt/GroundContainer.java @@ -24,8 +24,10 @@ import games.stendhal.client.gui.j2d.entity.EntityView; import games.stendhal.client.gui.wt.core.WtBaseframe; import games.stendhal.client.gui.wt.core.WtDraggable; import games.stendhal.client.gui.wt.core.WtDropTarget; +import games.stendhal.client.gui.wt.core.WtWindowManager; import java.awt.Cursor; +import java.awt.KeyboardFocusManager; import java.awt.Point; import java.awt.event.InputEvent; import java.awt.event.MouseEvent; @@ -46,6 +48,10 @@ public class GroundContainer extends WtBaseframe implements WtDropTarget, /** the game client. */ private final StendhalClient client; + private boolean windowWasActiveOnMousePressed = true; + private int xOnMousePressed; + private int yOnMousePressed; + /** * The UI. */ @@ -94,17 +100,38 @@ public class GroundContainer extends WtBaseframe implements WtDropTarget, } /** + * remembers whether the client was active on last mouse down + */ + @Override + public synchronized void mousePressed(MouseEvent e) { + windowWasActiveOnMousePressed = (KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() != null); + xOnMousePressed = e.getX(); + yOnMousePressed = e.getY(); + super.mousePressed(e); + } + + /** + * Handles mouse click events * - * - * + * @param p point of click */ @Override public synchronized boolean onMouseClick(final Point p) { + + // on MS Windows releasing the mouse after a drag&drop action is + // counted as mouse click: https://sourceforge.net/support/tracker.php?aid=2976895 + if ((Math.abs(p.getX() - xOnMousePressed) > 10) + || (Math.abs(p.getY() - yOnMousePressed) > 10)) { + return false; + } + + // base class checks if the click is within a child if (super.onMouseClick(p)) { // yes, click already processed return true; } + // get clicked entity final Point2D point = screen.convertScreenViewToWorld(p); @@ -127,8 +154,13 @@ public class GroundContainer extends WtBaseframe implements WtDropTarget, return true; } } else if (getWtPanelAt(p) == null) { - createAndSendMoveToAction(point); - return true; + if (windowWasActiveOnMousePressed) { + boolean doubleClick = Boolean.parseBoolean(WtWindowManager.getInstance().getProperty("ui.doubleclick", "false")); + if (!doubleClick) { + createAndSendMoveToAction(point); + } + } + return false; } return false; diff --git a/src/games/stendhal/client/sound/sound/ExtendedSoundManager.java b/src/games/stendhal/client/sound/sound/ExtendedSoundManager.java index bc7ee74913..7e3d23e883 100644 --- a/src/games/stendhal/client/sound/sound/ExtendedSoundManager.java +++ b/src/games/stendhal/client/sound/sound/ExtendedSoundManager.java @@ -133,6 +133,7 @@ public class ExtendedSoundManager extends SoundManagerNG implements WorldListene ExtendedSoundManager() { super(!Boolean.parseBoolean(WtWindowManager.getInstance().getProperty("sound.play", "true")), mDeviceEvaluator.createDeviceList(mAudioFormat), mAudioFormat); + initMute(); initVolumes(); } @@ -149,6 +150,12 @@ public class ExtendedSoundManager extends SoundManagerNG implements WorldListene this.getGroup("music").changeVolume(Numeric.intToFloat(config.getPropertyInt("sound.volume.music", 60), 100.0f)); } + private void initMute() { + WtWindowManager config = WtWindowManager.getInstance(); + boolean play = Boolean.parseBoolean(config.getProperty("sound.play", "true")); + mute(!play, false, new Time(0, Time.Unit.SEC)); + } + public void playerMoved() { float[] position = Algebra.vecf((float) User.get().getX(), (float) User.get().getY()); super.setHearerPosition(position); diff --git a/src/games/stendhal/client/update/Version.java b/src/games/stendhal/client/update/Version.java index 0570658d44..ca354d09f5 100644 --- a/src/games/stendhal/client/update/Version.java +++ b/src/games/stendhal/client/update/Version.java @@ -10,7 +10,7 @@ package games.stendhal.client.update; public class Version { /** Version Number. */ - public static final String VERSION = "0.81.5"; + public static final String VERSION = "0.82.1"; /** * Extract the specified number of parts from a version-string. diff --git a/src/games/stendhal/common/Debug.java b/src/games/stendhal/common/Debug.java index f34aa74bdb..607e71d580 100644 --- a/src/games/stendhal/common/Debug.java +++ b/src/games/stendhal/common/Debug.java @@ -25,7 +25,7 @@ public interface Debug { /** server version. */ // Note: This line is updated by build.xml using a regexp so be sure to adjust it in case you modify this line. - String VERSION = "0.81.5"; + String VERSION = "0.82.1"; /** diff --git a/src/games/stendhal/server/actions/pet/OwnAction.java b/src/games/stendhal/server/actions/pet/OwnAction.java index 54e5a2bfd7..4cd5185d7b 100644 --- a/src/games/stendhal/server/actions/pet/OwnAction.java +++ b/src/games/stendhal/server/actions/pet/OwnAction.java @@ -55,7 +55,7 @@ public class OwnAction implements ActionListener { final Entity entity = EntityHelper.entityFromTargetName(action.get(TARGET), player); if (entity != null) { - if (checkEntityIsDomesticAnimal(player, entity)) { + if (!checkEntityIsDomesticAnimal(player, entity)) { return; } diff --git a/src/games/stendhal/server/core/engine/GenerateINI.java b/src/games/stendhal/server/core/engine/GenerateINI.java index 815639af54..75362fb2ab 100644 --- a/src/games/stendhal/server/core/engine/GenerateINI.java +++ b/src/games/stendhal/server/core/engine/GenerateINI.java @@ -233,7 +233,7 @@ public class GenerateINI { out.println(); out.println("server_typeGame=" + gameName); out.println("server_name=" + gameName + " Marauroa server"); - out.println("server_version=0.81.5"); + out.println("server_version=0.82.1"); out.println("server_contact=https://sourceforge.net/tracker/?atid=514826&group_id=66537&func=browse"); out.println(); out.println("# Extensions configured on the server. Enable at will."); diff --git a/src/games/stendhal/server/core/events/TutorialEventType.java b/src/games/stendhal/server/core/events/TutorialEventType.java index af803bea87..241582e2a0 100644 --- a/src/games/stendhal/server/core/events/TutorialEventType.java +++ b/src/games/stendhal/server/core/events/TutorialEventType.java @@ -16,7 +16,7 @@ public enum TutorialEventType { VISIT_SEMOS_CITY( "You can get a map of Semos from Monogenes. Start by saying \"hi\". Or you can go down the steps to the dungeons and fight some creatures."), VISIT_SEMOS_DUNGEON( - "You can attack creatures by right clicking on them and choosing \"Attack\""), + "You can attack creatures by right clicking on them and choosing \"Attack\". Alternatively you can use double click."), VISIT_SEMOS_DUNGEON_2( "Be careful. If you walk deeper and deeper, the creatures will get more powerful."), VISIT_SEMOS_TAVERN( @@ -34,7 +34,7 @@ public enum TutorialEventType { FIRST_DEATH( "Oh, you have just died. But fortunately death is not permanent in this world."), TIMED_HELP( - "There is a manual with many pictures on the first screen before you login."), + "Press F1 to read the manual with many pictures."), TIMED_NAKED( "Oh, aren't you feeling cold? Right click on yourself and choose \"Set Outfit\" to get dressed."), TIMED_PASSWORD( diff --git a/src/games/stendhal/server/core/pathfinder/Pathfinder.java b/src/games/stendhal/server/core/pathfinder/Pathfinder.java index 13263e63e8..a38218b489 100644 --- a/src/games/stendhal/server/core/pathfinder/Pathfinder.java +++ b/src/games/stendhal/server/core/pathfinder/Pathfinder.java @@ -24,7 +24,10 @@ package games.stendhal.server.core.pathfinder; import games.stendhal.common.CollisionDetection; import games.stendhal.server.core.engine.StendhalRPZone; import games.stendhal.server.entity.Entity; +import games.stendhal.server.entity.mapstuff.portal.Portal; +import games.stendhal.server.entity.player.Player; +import java.awt.Point; import java.awt.geom.Rectangle2D; import java.util.Comparator; import java.util.HashMap; @@ -264,6 +267,7 @@ class Pathfinder { * have stopped */ private void createEntityCollisionMap() { + Point targetPoint = new Point(nodeGoal.getX(), nodeGoal.getY()); collisionMap = new CollisionDetection(); collisionMap.init(zone.getWidth(), zone.getHeight()); for (final RPObject obj : zone) { @@ -275,6 +279,11 @@ class Pathfinder { final Rectangle2D area = otherEntity.getArea(otherEntity.getX(), otherEntity.getY()); + + // Hack: Allow players to move onto portals as destination + if ((entity instanceof Player) && (otherEntity instanceof Portal) && area.contains(targetPoint)) { + continue; + } collisionMap.setCollide(area, true); } } diff --git a/src/games/stendhal/server/entity/player/Player.java b/src/games/stendhal/server/entity/player/Player.java index dbf6ebc15c..9390fa645d 100644 --- a/src/games/stendhal/server/entity/player/Player.java +++ b/src/games/stendhal/server/entity/player/Player.java @@ -1817,7 +1817,15 @@ public class Player extends RPEntity { } @Override protected void handleObjectCollision() { - clearPath(); + if (hasPath()) { + /* + * Stop a player only if he is following a path. + * Otherwise running behind archers becomes almost + * impossible. + */ + stop(); + clearPath(); + } } diff --git a/src/games/stendhal/server/maps/quests/MeetBunny.java b/src/games/stendhal/server/maps/quests/MeetBunny.java index 2867d43a3e..c3cae843de 100644 --- a/src/games/stendhal/server/maps/quests/MeetBunny.java +++ b/src/games/stendhal/server/maps/quests/MeetBunny.java @@ -81,7 +81,6 @@ public class MeetBunny extends AbstractQuest { addGoodbye("Don't eat too much this Easter! Bye!"); } }; - npcs.add(bunny); bunny.setEntityClass("easterbunnynpc"); bunny.initHP(100); // times out twice as fast as normal NPCs diff --git a/src/games/stendhal/server/maps/quests/ThePiedPiper.java b/src/games/stendhal/server/maps/quests/ThePiedPiper.java index 45790ce0a2..09129acbea 100644 --- a/src/games/stendhal/server/maps/quests/ThePiedPiper.java +++ b/src/games/stendhal/server/maps/quests/ThePiedPiper.java @@ -469,7 +469,7 @@ import org.apache.log4j.Logger; */ private void tellAllAboutNoRatsInCity() { final String text = "Mayor Chalmers shouts: No #rats in Ados survived, "+ - "excluded those who always lived in the "+ + "only those who always lived in the "+ "haunted house. "+ "Rat hunters are welcome to get their #reward."; SingletonRepository.getRuleProcessor().tellAllPlayers(text); diff --git a/stendhal.jnlp b/stendhal.jnlp index 472a2e0291..4c93625fcf 100644 --- a/stendhal.jnlp +++ b/stendhal.jnlp @@ -22,7 +22,7 @@ Some of these people are NPC, they will give you tasks to accomplish and hints t - +