diff --git a/build.ant.properties b/build.ant.properties index 2823a54655..5120b4f9e4 100644 --- a/build.ant.properties +++ b/build.ant.properties @@ -72,8 +72,8 @@ updates_server = http://arianne.sourceforge.net/stendhal/updates version_server = http://arianne.sourceforge.net/stendhal.version # current version of stendhal -version.old = 0.89 -version = 0.89.5 +version.old = 0.90 +version = 0.90.1 # javac options javac.deprecation = true diff --git a/doc/CHANGES.txt b/doc/CHANGES.txt index f8eacf16d7..bb8a66d4ae 100644 --- a/doc/CHANGES.txt +++ b/doc/CHANGES.txt @@ -1,5 +1,9 @@ Changelog --------- + +0.90.1 +- fixed a bug which prevented logging in without at least one saved profile + 0.90 *world* diff --git a/libs/marauroa.jar b/libs/marauroa.jar index a15dbc2398..3f5f74ff9a 100644 Binary files a/libs/marauroa.jar and b/libs/marauroa.jar differ diff --git a/runserver.bat b/runserver.bat index 8b0512443d..2933d00c02 100644 --- a/runserver.bat +++ b/runserver.bat @@ -1,3 +1,3 @@ -set STENDHAL_VERSION=0.89.5 +set STENDHAL_VERSION=0.90.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 5fd7a7e608..4915e52b5a 100644 --- a/runserver.sh +++ b/runserver.sh @@ -1,5 +1,5 @@ #!/bin/sh -STENDHAL_VERSION="0.89.5" +STENDHAL_VERSION="0.90.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/gui/login/LoginDialog.java b/src/games/stendhal/client/gui/login/LoginDialog.java index 62a34b22cf..38cb87c5b2 100644 --- a/src/games/stendhal/client/gui/login/LoginDialog.java +++ b/src/games/stendhal/client/gui/login/LoginDialog.java @@ -321,7 +321,7 @@ public class LoginDialog extends JDialog { private void loginButton_actionPerformed(final ActionEvent e) { // If this window isn't enabled, we shouldn't act. - if (!isEnabled() || (profiles.profiles.size() == 0)) { + if (!isEnabled()) { return; } setEnabled(false); @@ -374,7 +374,7 @@ public class LoginDialog extends JDialog { private void removeButton_actionPerformed(final ActionEvent e) { // If this window isn't enabled, we shouldn't act. - if (!isEnabled()) { + if (!isEnabled() || (profiles.profiles.size() == 0)) { return; } setEnabled(false); diff --git a/src/games/stendhal/client/update/Version.java b/src/games/stendhal/client/update/Version.java index dfc3f651a4..51db3c910b 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. */ - private static final String VERSION = "0.89.5"; + private static final String VERSION = "0.90.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 74f174b144..693e5e7598 100644 --- a/src/games/stendhal/common/Debug.java +++ b/src/games/stendhal/common/Debug.java @@ -26,7 +26,7 @@ public class Debug { /** version. */ // Note: This line is updated by build.xml using a regexp so be sure to adjust it in case you modify this line. - public static final String VERSION = "0.89.5"; + public static final String VERSION = "0.90.1"; public static final String PRE_RELEASE_VERSION = null; diff --git a/src/games/stendhal/server/actions/CommandCenter.java b/src/games/stendhal/server/actions/CommandCenter.java index d0a2b2766b..68da4b14b9 100644 --- a/src/games/stendhal/server/actions/CommandCenter.java +++ b/src/games/stendhal/server/actions/CommandCenter.java @@ -95,7 +95,6 @@ public class CommandCenter { EquipAction.register(); FaceAction.register(); ForsakeAction.register(); - GroupManagementAction.register(); KnockAction.register(); ListProducersAction.register(); LookAction.register(); diff --git a/src/games/stendhal/server/actions/GroupManagementAction.java b/src/games/stendhal/server/actions/GroupManagementAction.java deleted file mode 100644 index 7caeac2c84..0000000000 --- a/src/games/stendhal/server/actions/GroupManagementAction.java +++ /dev/null @@ -1,286 +0,0 @@ -/* $Id$ */ -/*************************************************************************** - * (C) Copyright 2003-2010 - Stendhal * - *************************************************************************** - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ -package games.stendhal.server.actions; - -import games.stendhal.common.NotificationType; -import games.stendhal.server.core.engine.GameEvent; -import games.stendhal.server.core.engine.SingletonRepository; -import games.stendhal.server.core.rp.group.Group; -import games.stendhal.server.entity.player.GagManager; -import games.stendhal.server.entity.player.Player; -import marauroa.common.game.RPAction; - -import org.apache.log4j.Logger; - -/** - * handles the management of player groups. - * - * @author hendrik - */ -public class GroupManagementAction implements ActionListener { - private static Logger logger = Logger.getLogger(GroupManagementAction.class); - - /** - * registers the trade action - */ - public static void register() { - CommandCenter.register("group_management", new GroupManagementAction()); - } - - /** - * processes the requested action. - * - * @param player the caller of the action - * @param action the action to be performed - */ - public void onAction(final Player player, final RPAction action) { - - // vaidate parameters - String actionStr = action.get("action"); - String params = action.get("params"); - if ((actionStr == null) || (params == null)) { - logger.warn("missing action attribute in RPAction " + action); - return; - } - - new GameEvent(player.getName(), "group", params, actionStr).raise(); - - // get target player - Player targetPlayer = null; - if (!actionStr.equals("lootmode") && !actionStr.equals("part") && !actionStr.equals("status")) { - targetPlayer = SingletonRepository.getRuleProcessor().getPlayer(params); - if (targetPlayer == null) { - player.sendPrivateText(NotificationType.ERROR, "Player " + params + " is not online"); - return; - } - } - - // dispatch sub actions - if (actionStr.equals("invite")) { - invite(player, targetPlayer); - } else if (actionStr.equals("join")) { - join(player, targetPlayer); - } else if (actionStr.equals("leader")) { - leader(player, targetPlayer); - } else if (actionStr.equals("lootmode")) { - lootmode(player, params); - } else if (actionStr.equals("kick")) { - kick(player, targetPlayer); - } else if (actionStr.equals("part")) { - part(player); - } else if (actionStr.equals("status")) { - status(player); - } else { - unknown(player, actionStr, params); - } - } - - /** - * invited a player to join a group - * - * @param player Player who invites - * @param targetPlayer player who is invited - */ - private void invite(Player player, Player targetPlayer) { - - // TODO: make checks reusable, some of these checks are used at many places - - if (!player.getChatBucket().checkAndAdd()) { - return; - } - - if (GagManager.checkIsGaggedAndInformPlayer(player)) { - return; - } - - if (targetPlayer.getIgnore(player.getName()) != null) { - return; - } - - if (targetPlayer.getAwayMessage() != null) { - player.sendPrivateText("Sorry, " + targetPlayer.getName() + " is away."); - return; - } - - if (targetPlayer.getGrumpyMessage() != null) { - player.sendPrivateText(targetPlayer.getName() + " has a closed mind, and is seeking solitude from all but close friends"); - return; - } - - // check if the target player is already in a group - Group group = SingletonRepository.getGroupManager().getGroup(targetPlayer.getName()); - if (group != null) { - player.sendPrivateText(NotificationType.ERROR, targetPlayer.getName() + " is already in a group."); - return; - } - - // get group, create it, if it does not exist - SingletonRepository.getGroupManager().createGroup(player.getName()); - group = SingletonRepository.getGroupManager().getGroup(player.getName()); - - // check leader - if (!group.hasLeader(player.getName())) { - player.sendPrivateText(NotificationType.ERROR, "Only the group leader may invite people."); - return; - } - - // check if there is space left in the group - if (group.isFull()) { - player.sendPrivateText(NotificationType.ERROR, "Your group is already full."); - return; - } - - // invite - group.invite(player, targetPlayer); - player.sendPrivateText("You have invited " + targetPlayer.getName() + " to join your group."); - } - - /** - * joins a group - * - * @param player Player who wants to join a group - * @param targetPlayer leader of the group - */ - private void join(Player player, Player targetPlayer) { - - // check if the target player is already in a group - Group group = SingletonRepository.getGroupManager().getGroup(targetPlayer.getName()); - if ((group == null) || !group.hasBeenInvited(player.getName())) { - player.sendPrivateText(NotificationType.ERROR, "You have not been invited into this group or the invite expired."); - return; - } - - // check if there is space left in the group - if (group.isFull()) { - player.sendPrivateText(NotificationType.ERROR, "The group is already full."); - return; - } - - group.addMember(player.getName()); - } - - - /** - * changes the leadership of the group - * - * @param player Player who invites - * @param targetPlayer new leader - */ - private void leader(Player player, Player targetPlayer) { - - // check if the player is already in a group - Group group = SingletonRepository.getGroupManager().getGroup(player.getName()); - if (group == null) { - player.sendPrivateText(NotificationType.ERROR, "You are not a member of a group."); - return; - } - - // check leader - group = SingletonRepository.getGroupManager().getGroup(player.getName()); - if (!group.hasLeader(player.getName())) { - player.sendPrivateText(NotificationType.ERROR, "Only the group leader may define a new leader."); - return; - } - - // check if the target player is a member of this group - if (!group.hasMember(targetPlayer.getName())) { - player.sendPrivateText(NotificationType.ERROR, targetPlayer.getName() + " is not a member of your group."); - return; - } - - // set leader - group.setLeader(targetPlayer.getName()); - } - - - - /** - * changes the lootmode - * - * @param player leader - * @param lootmode new lootmode - */ - private void lootmode(Player player, String lootmode) { - - // check if the player is already in a group - Group group = SingletonRepository.getGroupManager().getGroup(player.getName()); - if (group == null) { - player.sendPrivateText(NotificationType.ERROR, "You are not a member of a group."); - return; - } - - // check leader - group = SingletonRepository.getGroupManager().getGroup(player.getName()); - if (!group.hasLeader(player.getName())) { - player.sendPrivateText(NotificationType.ERROR, "Only the group leader may change the lootmode."); - return; - } - - // check if the loot mode is valid - if ((lootmode == null) || (!lootmode.equals("single") && !lootmode.equals("shared"))) { - player.sendPrivateText(NotificationType.ERROR, "Valid loot modes are \"single\" and \"shared\"."); - return; - } - - // set leader - group.setLootmode(lootmode); - } - - /** - * leave the group - * - * @param player player who wants to leave - */ - private void part(Player player) { - Group group = SingletonRepository.getGroupManager().getGroup(player.getName()); - if (group == null) { - player.sendPrivateText(NotificationType.ERROR, "You are not a member of a group."); - return; - } - - group.removeMember(player.getName()); - } - - - /** - * status report about the group - * - * @param player player who wants a status report - */ - private void status(Player player) { - Group group = SingletonRepository.getGroupManager().getGroup(player.getName()); - if (group == null) { - player.sendPrivateText(NotificationType.ERROR, "You are not a member of a group."); - return; - } - - group.sendGroupChangeEvent(player); - } - - - private void kick(Player player, Player targetPlayer) { - // TODO Auto-generated method stub - - } - - /** - * sends an error messages on invalid an actions - * - * @param player Player who executed the action - * @param action name of action - * @param params params for the action - */ - private void unknown(Player player, String action, String params) { - player.sendPrivateText(NotificationType.ERROR, "Unknown group action: " + action + " with parameters " + params); - } -} diff --git a/src/games/stendhal/server/core/engine/GenerateINI.java b/src/games/stendhal/server/core/engine/GenerateINI.java index 188f99bbfc..6aa90d8a82 100644 --- a/src/games/stendhal/server/core/engine/GenerateINI.java +++ b/src/games/stendhal/server/core/engine/GenerateINI.java @@ -246,7 +246,7 @@ public class GenerateINI { out.println(); out.println("server_typeGame=" + gameName); out.println("server_name=" + gameName + " Marauroa server"); - out.println("server_version=0.89.5"); + out.println("server_version=0.90.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/entity/npc/parser/words.txt b/src/games/stendhal/server/entity/npc/parser/words.txt index 0f78999202..086f0c39ad 100644 --- a/src/games/stendhal/server/entity/npc/parser/words.txt +++ b/src/games/stendhal/server/entity/npc/parser/words.txt @@ -300,7 +300,7 @@ bronze OBJ bronzes buckler OBJ bucklers bug OBJ bugs building OBJ buildings -bulb OBJ-ANI bulbs +bulb OBJ bulbs bull OBJ-ANI bulls bureau OBJ bureaux bus OBJ bus @@ -425,6 +425,7 @@ ferry OBJ ferries figure OBJ figures finger OBJ fingers fire OBJ fires +fierywater OBJ fierywaters fish OBJ-FOO fishes flail OBJ flails flask OBJ flasks diff --git a/src/games/stendhal/server/maps/quests/ChocolateForElisabeth.java b/src/games/stendhal/server/maps/quests/ChocolateForElisabeth.java index d2da9e7f98..9db306a1db 100644 --- a/src/games/stendhal/server/maps/quests/ChocolateForElisabeth.java +++ b/src/games/stendhal/server/maps/quests/ChocolateForElisabeth.java @@ -12,13 +12,16 @@ ***************************************************************************/ package games.stendhal.server.maps.quests; +import games.stendhal.common.Rand; +import games.stendhal.server.core.engine.SingletonRepository; +import games.stendhal.server.entity.item.StackableItem; import games.stendhal.server.entity.npc.ChatAction; import games.stendhal.server.entity.npc.ConversationPhrases; import games.stendhal.server.entity.npc.ConversationStates; +import games.stendhal.server.entity.npc.EventRaiser; import games.stendhal.server.entity.npc.SpeakerNPC; import games.stendhal.server.entity.npc.action.DecreaseKarmaAction; import games.stendhal.server.entity.npc.action.DropItemAction; -import games.stendhal.server.entity.npc.action.EquipItemAction; import games.stendhal.server.entity.npc.action.IncreaseKarmaAction; import games.stendhal.server.entity.npc.action.IncreaseXPAction; import games.stendhal.server.entity.npc.action.MultipleActions; @@ -36,9 +39,11 @@ import games.stendhal.server.entity.npc.condition.QuestNotStartedCondition; import games.stendhal.server.entity.npc.condition.QuestStartedCondition; import games.stendhal.server.entity.npc.condition.QuestStateStartsWithCondition; import games.stendhal.server.entity.npc.condition.TimePassedCondition; +import games.stendhal.server.entity.npc.parser.Sentence; import games.stendhal.server.entity.player.Player; import java.util.ArrayList; +import java.util.Arrays; import java.util.LinkedList; import java.util.List; @@ -56,7 +61,7 @@ public class ChocolateForElisabeth extends AbstractQuest { private static final String QUEST_SLOT = "chocolate_for_elisabeth"; /** The delay between repeating quests. */ - private static final int REQUIRED_MINUTES = 30; + private static final int REQUIRED_MINUTES = 60; @Override public String getSlotName() { return QUEST_SLOT; @@ -81,7 +86,7 @@ public class ChocolateForElisabeth extends AbstractQuest { ConversationPhrases.GREETING_MESSAGES, new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new PlayerHasItemWithHimCondition("chocolate bar")), ConversationStates.IDLE, - "My mom said, I have to wait till I can taste that lovely smell again... She said, she waits for someone to help her!", + "My mum wants to know who I was asking for chocolate from now :(", null); // player didn't get chocolate, meanie @@ -183,9 +188,17 @@ public class ChocolateForElisabeth extends AbstractQuest { // Player has got chocolate bar and spoken to mummy final List reward = new LinkedList(); reward.add(new DropItemAction("chocolate bar")); - reward.add(new EquipItemAction("daisies", 2)); - reward.add(new EquipItemAction("zantedeschia", 2)); - reward.add(new EquipItemAction("pansy",2)); + reward.add(new ChatAction() { + public void fire(final Player player, final Sentence sentence, final EventRaiser npc) { + // pick a random flower + String rewardClass = Rand.rand(Arrays.asList("daisies","zantedeschia","pansy")); + + final StackableItem reward = (StackableItem) SingletonRepository.getEntityManager().getItem(rewardClass); + reward.setQuantity(1); + player.equipOrPutOnGround(reward); + player.notifyWorldAboutChanges(); + } + }); reward.add(new IncreaseXPAction(500)); reward.add(new SetQuestAction(QUEST_SLOT, "eating;")); reward.add(new SetQuestToTimeStampAction(QUEST_SLOT,1)); @@ -195,7 +208,7 @@ public class ChocolateForElisabeth extends AbstractQuest { ConversationPhrases.YES_MESSAGES, new PlayerHasItemWithHimCondition("chocolate bar"), ConversationStates.ATTENDING, - "Thank you EVER so much! You are very kind. Here, take these fresh flowers as a present.", + "Thank you EVER so much! You are very kind. Here, take a fresh flower as a present.", new MultipleActions(reward)); @@ -231,7 +244,7 @@ public class ChocolateForElisabeth extends AbstractQuest { ConversationPhrases.GREETING_MESSAGES, new QuestInStateCondition(QUEST_SLOT, "start"), ConversationStates.ATTENDING, - "Oh you met my daughter Elisabeth already. I hope she wasn't too demanding. You seem like a nice person so it would be really kind, if you can bring her a chocolate bar because I'm not #strong enough for that.", + "Oh you met my daughter Elisabeth already. You seem like a nice person so it would be really kind, if you can bring her a chocolate bar because I'm not #strong enough for that.", new SetQuestAction(QUEST_SLOT, "mummy")); mummyNPC.addReply("strong", "I tried to get some chocolate for Elisabeth a few times, but I couldn't make my way through the assassins and bandits running around #there."); diff --git a/src/games/stendhal/server/maps/quests/MeetSanta.java b/src/games/stendhal/server/maps/quests/MeetSanta.java index a166820b0b..44d72629dd 100644 --- a/src/games/stendhal/server/maps/quests/MeetSanta.java +++ b/src/games/stendhal/server/maps/quests/MeetSanta.java @@ -138,7 +138,7 @@ public class MeetSanta extends AbstractQuest implements LoginListener { final int hairnumber = outfit.getHair(); if ((hairnumber >= 50) && (hairnumber < 94)) { final Date now = new Date(); - final GregorianCalendar notXmas = new GregorianCalendar(2010, Calendar.JANUARY, 6); + final GregorianCalendar notXmas = new GregorianCalendar(2011, Calendar.JANUARY, 6); final Date dateNotXmas = notXmas.getTime(); if (now.after(dateNotXmas)) { final int newhair = hairnumber - 50; diff --git a/src/games/stendhal/server/maps/ratcity/bakery/RatChefNPC.java b/src/games/stendhal/server/maps/ratcity/bakery/RatChefNPC.java index 180f57b48c..c482fdcd5a 100644 --- a/src/games/stendhal/server/maps/ratcity/bakery/RatChefNPC.java +++ b/src/games/stendhal/server/maps/ratcity/bakery/RatChefNPC.java @@ -64,7 +64,11 @@ public class RatChefNPC implements ZoneConfigurator { addJob("I'm the best #crepes suzette au chocolate chef in town. Ask me to #bake one for you!"); addReply("crepes", "Ah le dessert for a prince... A taste of which, I really believe, would reform a cannibal into a civilized gentleman."); - addReply(Arrays.asList("chocolate"), + /** + * chocolate bar is the item, and the parser knows nothing about bar/bars. + * Handle all possibilities explicitly. + */ + addReply(Arrays.asList("chocolate", "chocolate bar", "chocolate bars"), "A rarity. It seems only very nasty and murderous folks carry some in their pockets."); addReply("flour", "I stea.. ahem.. get all my supplies of flour from the nearby Semos city."); diff --git a/stendhal.jnlp b/stendhal.jnlp index 4a4b5c49c5..c52a108738 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 - +