Lunar Convocation - fixed game error on usage (miss watcher);

This commit is contained in:
Oleg Agafonov 2024-09-09 06:43:24 +04:00
parent aa72c3a63d
commit 22c207bcd8
3 changed files with 4 additions and 3 deletions

View file

@ -68,13 +68,13 @@ public class HumanPlayer extends PlayerImpl {
private static final boolean ALLOW_USERS_TO_PUT_NON_PLAYABLE_SPELLS_ON_STACK_WORKAROUND = false; // warning, see workaround's info on usage
// TODO: all user feedback actions executed and waited in diff threads and can't catch exeptions, e.g. on wrong code usage
// TODO: all user feedback actions executed and waited in diff threads and can't catch exceptions, e.g. on wrong code usage
// must catch and log such errors
// Network and threads logic:
// * starting point: ThreadExecutorImpl.java
// * server executing a game's code by single game thread (named: "GAME xxx", one thread per game)
// * data transfering goes by inner jboss threads (named: "WorkerThread xxx", one thread per client connection)
// * data transferring goes by inner jboss threads (named: "WorkerThread xxx", one thread per client connection)
// - from server to client: sync mode, a single game thread uses jboss networking to send data to each player and viewer/watcher one by one
// - from client to server: async mode, each income command executes by shared call thread
//

View file

@ -45,6 +45,7 @@ public final class LunarConvocation extends CardImpl {
new DrawCardSourceControllerEffect(1), new ManaCostsImpl<>("{1}{B}")
);
ability.addCost(new PayLifeCost(2));
ability.addWatcher(new PlayerGainedLifeWatcher());
this.addAbility(ability);
}

View file

@ -47,7 +47,7 @@ public class Watchers extends HashMap<String, Watcher> {
if (containsKey(key)) {
return super.get(key);
}
// can't add game exeption here because it's an easy way to ruin any game with bugged card
// can't add game exception here because it's an easy way to ruin any game with bugged card
logger.error(key + " not found in watchers", new Throwable());
return null;
}