Small stub web view that I'm hoping to use in conjunction with ~/.hedgewars/Data - I'd like to link to a page on hedgewars.org, intercept linkClicked, fetch zip files, then unpack the structure under Data. Just checking this in so it doesn't clutter up project. Also tidied up the .pro a bit, even though we aren't really using it for much anymore. Should in theory be able to do a build now.
{-# LANGUAGE ScopedTypeVariables #-}
module OfficialServer.GameReplayStore where
import CoreTypes
import Data.Time
import Control.Exception as E
import qualified Data.Map as Map
import Data.Sequence()
import System.Log.Logger
saveReplay :: RoomInfo -> IO ()
saveReplay r = do
time <- getCurrentTime
let fileName = "replays/" ++ show time
let replayInfo = (teamsAtStart r, Map.toList $ mapParams r, Map.toList $ params r, roundMsgs r)
E.catch
(writeFile fileName (show replayInfo))
(\(e :: IOException) -> warningM "REPLAYS" $ "Couldn't write to " ++ fileName ++ ": " ++ show e)