handleStatus  :: Config -> Logger -> Conduit SBStatus (StateT ProtocolState IO) CBStatus
handleStatus config logger = awaitForever $ \status ->
      case status of
        SBRequest -> sendAndLog $
          CBResponse
            snapshotVersion
            (toEnum protocolVersion)
            0
            (toEnum . fromEnum . srvMaxPlayers $ config)
            (srvMotd config)
        SBPing payload -> sendAndLog $ CBPong payload
  where
    sendAndLog :: MonadIO m => CBStatus -> Conduit SBStatus m CBStatus
    sendAndLog packet = do
      liftIO $ logMsg logger LvlDebug $ "Sending: " ++ show packet
      yield packet
handleStatus  :: Config -> Logger -> Conduit SBStatus (StateT ProtocolState IO) CBStatus
handleStatus config logger = awaitForever $ \status ->
      case status of
        SBRequest -> sendAndLog $
          CBResponse
            snapshotVersion
            (toEnum protocolVersion)
            0
            (toEnum . fromEnum . srvMaxPlayers $ config)
            (srvMotd config)
        SBPing payload -> sendAndLog $ CBPong payload
  where
    sendAndLog :: MonadIO m => CBStatus -> Conduit SBStatus m CBStatus
    sendAndLog packet = do
      liftIO $ logMsg logger LvlDebug $ "Sending: " ++ show packet
      yield packet
handleStatus config logger = awaitForever $ \status ->
      case status of
        SBRequest -> sendAndLog $
          CBResponse
            snapshotVersion
            (toEnum protocolVersion)
            0
            (toEnum . fromEnum . srvMaxPlayers $ config)
            (srvMotd config)
        SBPing payload -> sendAndLog $ CBPong payload
  where
    sendAndLog :: MonadIO m => CBStatus -> Conduit SBStatus m CBStatus
    sendAndLog packet = do
      liftIO $ logMsg logger LvlDebug $ "Sending: " ++ show packet
      yield packet