Search in sources :

Example 6 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-companion by dmorcellet.

the class MainTestShowCharacterLog method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile toon = utils.getToonByName("Glumlug");
    CharacterLog log = toon.getLastCharacterLog();
    if (log != null) {
        CharacterLogWindowController controller = new CharacterLogWindowController(toon);
        controller.show();
    }
}
Also used : LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) CharacterFile(delta.games.lotro.character.CharacterFile) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 7 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-companion by dmorcellet.

the class WarbandsTableController method loadToonStats.

private WarbandsStats loadToonStats(CharacterFile toon) {
    CharacterLog log = toon.getLastCharacterLog();
    WarbandsStats stats = new WarbandsStats(log);
    return stats;
}
Also used : WarbandsStats(delta.games.lotro.stats.warbands.WarbandsStats) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 8 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-tools by dmorcellet.

the class CharacterLogRepair method doIt.

/**
 * Do the job.
 * @param toon Targeted toon.
 * @return <code>true</code> if it succeeded, <code>false</code> otherwise.
 */
public boolean doIt(CharacterFile toon) {
    boolean ok = true;
    CharacterLog log = toon.getLastCharacterLog();
    List<Long> dates = getDatesToUpdate(log);
    if (dates.size() > 0) {
        Collections.sort(dates);
        Long oldest = dates.get(0);
        CharacterLogPageParser parser = new CharacterLogPageParser();
        MyLotroConfig cfg = MyLotroConfig.getInstance();
        String url = cfg.getCharacterURL(toon.getServerName(), toon.getName());
        CharacterLog newLog = parser.parseLogPages(url, oldest);
        if (newLog != null) {
            for (Long date : dates) {
                handleLogItemsReplacementForDate(date, log, newLog);
            }
            CharacterLogsManager logsManager = toon.getLogsManager();
            ok = logsManager.writeNewLog(log);
        } else {
            ok = false;
        }
    }
    return ok;
}
Also used : MyLotroConfig(delta.games.lotro.MyLotroConfig) CharacterLogsManager(delta.games.lotro.character.log.CharacterLogsManager) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 9 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-tools by dmorcellet.

the class MainTestCharacterActivityLogIO method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    List<CharacterFile> toons = new ArrayList<CharacterFile>();
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile glumlug = utils.getMainToon();
    toons.add(glumlug);
    MyLotroConfig cfg = MyLotroConfig.getInstance();
    CharacterLogPageParser parser = new CharacterLogPageParser();
    for (CharacterFile toon : toons) {
        String url = cfg.getCharacterURL(toon.getServerName(), toon.getName());
        CharacterLog log = parser.parseLogPages(url, null);
        if (log != null) {
            System.out.println(log);
            CharacterLogsManager manager = toon.getLogsManager();
            boolean ok = manager.writeNewLog(log);
            if (ok) {
                System.out.println("OK");
            }
        }
    }
}
Also used : LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) ArrayList(java.util.ArrayList) MyLotroConfig(delta.games.lotro.MyLotroConfig) CharacterFile(delta.games.lotro.character.CharacterFile) CharacterLogsManager(delta.games.lotro.character.log.CharacterLogsManager) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Aggregations

CharacterLog (delta.games.lotro.character.log.CharacterLog)9 CharacterFile (delta.games.lotro.character.CharacterFile)5 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)5 MyLotroConfig (delta.games.lotro.MyLotroConfig)2 CharacterLogsManager (delta.games.lotro.character.log.CharacterLogsManager)2 ArrayList (java.util.ArrayList)2 CharacterSummary (delta.games.lotro.character.CharacterSummary)1 Rewards (delta.games.lotro.common.Rewards)1 Virtue (delta.games.lotro.common.Virtue)1 VirtueId (delta.games.lotro.common.VirtueId)1 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)1 DeedsManager (delta.games.lotro.lore.deeds.DeedsManager)1 QuestsManager (delta.games.lotro.lore.quests.QuestsManager)1 QuestsIndex (delta.games.lotro.lore.quests.index.QuestsIndex)1 WarbandsStats (delta.games.lotro.stats.warbands.WarbandsStats)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 HashMap (java.util.HashMap)1 List (java.util.List)1