     # Use timestamp as id
     # from oldest to newest
     @packetList = []
+    @packetFile = {}
     @packetListLastRefresh = 0
 
   # Packet Management

  loadPacketSync: (id) ->
    return unless id?
    try
      file = path.join(APPDATA, "#{id}.json")
      data = fs.readFileSync(file, FS_RW_OPTIONS)
      packet = JSON.parse(data)
      return packet
    catch error
      console.error error
      return null

  searchPacket: (start, end) ->
    return unless start? and end? and start <= end

fs = require 'fs-extra'
glob = require 'glob'
path = require 'path-extra'
zlib = require 'zlib'

# constant
window.APPDATA = path.join(window.APPDATA_PATH, 'battle-detail')
REFRESH_INTERVAL = 60000

# init
fs.ensureDir APPDATA, (error) ->
