removed code for experimental achievements
This commit is contained in:
parent
855a566739
commit
7a6dc30010
7 changed files with 6 additions and 96 deletions
|
|
@ -2,7 +2,6 @@ package games.stendhal.server.core.engine;
|
|||
|
||||
import games.stendhal.server.core.events.LoginNotifier;
|
||||
import games.stendhal.server.core.events.TurnNotifier;
|
||||
import games.stendhal.server.core.events.achievements.AchievementNotifier;
|
||||
import games.stendhal.server.core.rp.StendhalQuestSystem;
|
||||
import games.stendhal.server.core.rp.guilds.GuildList;
|
||||
import games.stendhal.server.core.rp.guilds.GuildPermissionList;
|
||||
|
|
@ -147,13 +146,6 @@ public class SingletonRepository {
|
|||
return AthorFerry.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the AchievementNotifier instance
|
||||
*/
|
||||
public static AchievementNotifier getAchievementNotifier() {
|
||||
return AchievementNotifier.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the actual EntityManager instance
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package games.stendhal.server.core.engine;
|
||||
|
||||
import games.stendhal.server.core.engine.db.AchievementDAO;
|
||||
import games.stendhal.server.core.engine.db.CidDAO;
|
||||
import games.stendhal.server.core.engine.db.PostmanDAO;
|
||||
import games.stendhal.server.core.engine.db.StendhalBuddyDAO;
|
||||
|
|
@ -59,6 +58,5 @@ public class StendhalPlayerDatabase {
|
|||
DAORegister.get().register(StendhalKillLogDAO.class, new StendhalKillLogDAO ());
|
||||
DAORegister.get().register(StendhalNPCDAO.class, new StendhalNPCDAO());
|
||||
DAORegister.get().register(StendhalWebsiteDAO.class, new StendhalWebsiteDAO());
|
||||
DAORegister.get().register(AchievementDAO.class, new AchievementDAO());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@ public class StendhalRPWorld extends RPWorld {
|
|||
loader.load();
|
||||
|
||||
validatePortals();
|
||||
SingletonRepository.getAchievementNotifier().initialize();
|
||||
SingletonRepository.getGagManager();
|
||||
SingletonRepository.getJail();
|
||||
} catch (final Exception e) {
|
||||
|
|
|
|||
|
|
@ -1134,7 +1134,6 @@ public abstract class RPEntity extends GuidedEntity {
|
|||
}
|
||||
|
||||
killer.addXP(reward);
|
||||
SingletonRepository.getAchievementNotifier().onKill(killer);
|
||||
// For some quests etc., it is required that the player kills a
|
||||
// certain creature without the help of others.
|
||||
// Find out if the player killed this RPEntity on his own, but
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
package games.stendhal.server.entity.npc.action;
|
||||
|
||||
import games.stendhal.server.core.engine.SingletonRepository;
|
||||
import games.stendhal.server.entity.npc.ChatAction;
|
||||
import games.stendhal.server.entity.npc.EventRaiser;
|
||||
import games.stendhal.server.entity.npc.parser.Sentence;
|
||||
import games.stendhal.server.entity.player.Player;
|
||||
|
||||
public class CheckForReachedQuestAchievements implements ChatAction {
|
||||
|
||||
public void fire(Player player, Sentence sentence, EventRaiser npc) {
|
||||
SingletonRepository.getAchievementNotifier().onFinishQuest(player);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -12,6 +12,12 @@
|
|||
***************************************************************************/
|
||||
package games.stendhal.server.entity.player;
|
||||
|
||||
import static games.stendhal.common.constants.Actions.ADMINLEVEL;
|
||||
import static games.stendhal.common.constants.Actions.AWAY;
|
||||
import static games.stendhal.common.constants.Actions.GHOSTMODE;
|
||||
import static games.stendhal.common.constants.Actions.GRUMPY;
|
||||
import static games.stendhal.common.constants.Actions.INVISIBLE;
|
||||
import static games.stendhal.common.constants.Actions.TELECLICKMODE;
|
||||
import games.stendhal.common.Constants;
|
||||
import games.stendhal.common.Direction;
|
||||
import games.stendhal.common.FeatureList;
|
||||
|
|
@ -23,7 +29,6 @@ import games.stendhal.common.constants.Nature;
|
|||
import games.stendhal.server.core.engine.SingletonRepository;
|
||||
import games.stendhal.server.core.engine.StendhalRPZone;
|
||||
import games.stendhal.server.core.events.TutorialNotifier;
|
||||
import games.stendhal.server.core.events.achievements.AchievementNotifier;
|
||||
import games.stendhal.server.core.rp.StendhalRPAction;
|
||||
import games.stendhal.server.entity.Entity;
|
||||
import games.stendhal.server.entity.Outfit;
|
||||
|
|
@ -42,7 +47,6 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
|
@ -54,13 +58,6 @@ import marauroa.common.game.SyntaxException;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import static games.stendhal.common.constants.Actions.ADMINLEVEL;
|
||||
import static games.stendhal.common.constants.Actions.AWAY;
|
||||
import static games.stendhal.common.constants.Actions.GHOSTMODE;
|
||||
import static games.stendhal.common.constants.Actions.GRUMPY;
|
||||
import static games.stendhal.common.constants.Actions.INVISIBLE;
|
||||
import static games.stendhal.common.constants.Actions.TELECLICKMODE;
|
||||
|
||||
public class Player extends RPEntity {
|
||||
|
||||
private static final String LAST_PLAYER_KILL_TIME = "last_player_kill_time";
|
||||
|
|
@ -135,11 +132,6 @@ public class Player extends RPEntity {
|
|||
private String lastPrivateChatterName;
|
||||
|
||||
private final PlayerChatBucket chatBucket;
|
||||
|
||||
/**
|
||||
* all identifiers of reached achievements, filled on login of player
|
||||
*/
|
||||
private Set<String> reachedAchievements = new HashSet<String>();
|
||||
|
||||
public static void generateRPClass() {
|
||||
try {
|
||||
|
|
@ -2060,22 +2052,4 @@ public class Player extends RPEntity {
|
|||
remove("buddies", name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLevel(int level) {
|
||||
super.setLevel(level);
|
||||
AchievementNotifier.get().onLevelChange(this);
|
||||
}
|
||||
|
||||
public void addReachedAchievement(String identifier) {
|
||||
getAchievements().add(identifier);
|
||||
}
|
||||
|
||||
private Set<String> getAchievements() {
|
||||
return reachedAchievements;
|
||||
}
|
||||
|
||||
public boolean hasReachedAchievement(String identifier) {
|
||||
return getAchievements().contains(identifier);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
package games.stendhal.server.entity.player;
|
||||
|
||||
import games.stendhal.server.core.engine.dbcommand.ReadAchievementsForPlayerCommand;
|
||||
import games.stendhal.server.core.events.LoginListener;
|
||||
import games.stendhal.server.core.events.TurnListener;
|
||||
import games.stendhal.server.core.events.TurnNotifier;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import marauroa.server.db.command.DBCommand;
|
||||
import marauroa.server.db.command.DBCommandQueue;
|
||||
import marauroa.server.db.command.ResultHandle;
|
||||
|
||||
public class ReadAchievementsOnLogin implements LoginListener, TurnListener {
|
||||
|
||||
private ResultHandle handle = new ResultHandle();
|
||||
|
||||
public void onLoggedIn(Player player) {
|
||||
DBCommand command = new ReadAchievementsForPlayerCommand(player);
|
||||
DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
|
||||
TurnNotifier.get().notifyInTurns(1, this);
|
||||
}
|
||||
|
||||
public void onTurnReached(int currentTurn) {
|
||||
ReadAchievementsForPlayerCommand command = DBCommandQueue.get().getOneResult(ReadAchievementsForPlayerCommand.class, handle);
|
||||
if (command == null) {
|
||||
TurnNotifier.get().notifyInTurns(0, this);
|
||||
return;
|
||||
}
|
||||
Player p = command.getPlayer();
|
||||
Set<String> identifiers = command.getIdentifiers();
|
||||
for (String identifier : identifiers) {
|
||||
p.addReachedAchievement(identifier);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue