prev = c.getGamesPlayed();
}
} catch (EOFException e) {
// do nothing
} catch (IOException e) {
throw new PluginException(e);
} catch (ClassNotFoundException e) {
throw new PluginException(e);
} finally {
if (ois != null) try { ois.close(); } catch (Exception e) {}
}
try {
synchronized (this) {
oos = new ObjectOutputStream(new FileOutputStream(data));
CounterBean c = new CounterBean();
c.setGamesPlayed(prev+1);
oos.writeObject(c);
oos.close();
}
} catch (IOException e) {
throw new PluginException(e);
} finally {
if (oos != null) try { oos.close(); } catch (Exception e) {}
}
} else {
log.error("Counter plugin: data file doesn't exist, please restart plugin.");