Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class EmergencyServiceListener implements IMessageReceiveListener, INaviS
private static final Pattern SERVICE_DELETED_PATTERN = compile("^Der Notruf von (?:\\[UC])?(?<senderName>[a-zA-Z0-9_]+) wurde von (?:\\[UC])?(?<playerName>[a-zA-Z0-9_]+) gelöscht\\.$");
private static final Pattern SERVICE_COUNT_PATTERN = compile("^Offene Notrufe \\((?<count>\\d+)\\):");
private static final Pattern SERVICE_NONE_PATTERN = compile("^Fehler: Es ist kein Service offen\\.$");
private static final Pattern SERVICE_NONE_FOR_PLAYER_PATTERN = compile("^Fehler: Es wurde kein Service von dir akzeptiert\\.$");

private boolean activeService = false;

Expand Down Expand Up @@ -99,6 +100,12 @@ public boolean onMessageReceive(Text text, String message) {
return true;
}

Matcher serviceNoneForPlayerMatcher = SERVICE_NONE_FOR_PLAYER_PATTERN.matcher(message);
if (serviceNoneForPlayerMatcher.find()) {
this.activeService = false;
return true;
}

return true;
}

Expand Down