aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/lib/Uplcg/CookieSocket.hs (renamed from server/lib/Cafp/CookieSocket.hs)2
-rw-r--r--server/lib/Uplcg/Game.hs (renamed from server/lib/Cafp/Game.hs)4
-rw-r--r--server/lib/Uplcg/Main/GenerateElmTypes.hs (renamed from server/lib/Cafp/Main/GenerateElmTypes.hs)4
-rw-r--r--server/lib/Uplcg/Main/Server.hs (renamed from server/lib/Cafp/Main/Server.hs)16
-rw-r--r--server/lib/Uplcg/Messages.hs (renamed from server/lib/Cafp/Messages.hs)2
-rw-r--r--server/src/GenerateElmTypes.hs4
-rw-r--r--server/src/Server.hs4
-rw-r--r--server/uplcg.cabal (renamed from server/cafp.cabal)22
8 files changed, 29 insertions, 29 deletions
diff --git a/server/lib/Cafp/CookieSocket.hs b/server/lib/Uplcg/CookieSocket.hs
index 5770a3b..7efb8b2 100644
--- a/server/lib/Cafp/CookieSocket.hs
+++ b/server/lib/Uplcg/CookieSocket.hs
@@ -2,7 +2,7 @@
-- side.
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
-module Cafp.CookieSocket
+module Uplcg.CookieSocket
( Handle
, withHandle
, CookieName
diff --git a/server/lib/Cafp/Game.hs b/server/lib/Uplcg/Game.hs
index 9ed3cc1..02e40cb 100644
--- a/server/lib/Cafp/Game.hs
+++ b/server/lib/Uplcg/Game.hs
@@ -3,7 +3,7 @@
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
-module Cafp.Game
+module Uplcg.Game
( PlayerId
, Table (..)
, Player (..)
@@ -19,7 +19,7 @@ module Cafp.Game
, gameViewForPlayer
) where
-import Cafp.Messages
+import Uplcg.Messages
import Control.Lens (Lens', at, iall, ifor_, imap, ix,
orOf, to, (%%=), (%=), (%~), (&),
(+=), (.=), (.~), (^.), (^..),
diff --git a/server/lib/Cafp/Main/GenerateElmTypes.hs b/server/lib/Uplcg/Main/GenerateElmTypes.hs
index ccf19e8..bc2481c 100644
--- a/server/lib/Cafp/Main/GenerateElmTypes.hs
+++ b/server/lib/Uplcg/Main/GenerateElmTypes.hs
@@ -1,10 +1,10 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE TemplateHaskell #-}
-module Cafp.Main.GenerateElmTypes
+module Uplcg.Main.GenerateElmTypes
( main
) where
-import Cafp.Messages
+import Uplcg.Messages
import Data.Proxy
import Elm.Module
diff --git a/server/lib/Cafp/Main/Server.hs b/server/lib/Uplcg/Main/Server.hs
index ba2425d..a2914ab 100644
--- a/server/lib/Cafp/Main/Server.hs
+++ b/server/lib/Uplcg/Main/Server.hs
@@ -1,17 +1,14 @@
{-# LANGUAGE OverloadedStrings #-}
-module Cafp.Main.Server
+module Uplcg.Main.Server
( main
) where
-import qualified Cafp.CookieSocket as CookieSocket
-import Cafp.Game
-import Cafp.Messages
import Control.Concurrent.MVar (MVar)
import qualified Control.Concurrent.MVar as MVar
import Control.Concurrent.STM (STM, TVar, atomically)
import qualified Control.Concurrent.STM as STM
import Control.Exception (bracket)
-import Control.Lens ((^.), (&), (.~))
+import Control.Lens ((&), (.~), (^.))
import Control.Monad (forever, when)
import qualified Data.Aeson as Aeson
import qualified Data.ByteString as B
@@ -33,6 +30,9 @@ import qualified Network.WebSockets as WS
import System.Environment (getEnv)
import qualified System.Log.FastLogger as FL
import System.Random (StdGen, newStdGen)
+import qualified Uplcg.CookieSocket as CookieSocket
+import Uplcg.Game
+import Uplcg.Messages
import qualified Web.Scotty as Scotty
type RoomId = T.Text
@@ -200,9 +200,9 @@ baseUrl prefix application = \req ->
main :: IO ()
main = do
- host <- fromString <$> getEnv "CAFP_HOSTNAME"
- port <- read <$> getEnv "CAFP_PORT"
- base <- splitPath . T.pack <$> getEnv "CAFP_BASE"
+ host <- fromString <$> getEnv "UPLCG_HOSTNAME"
+ port <- read <$> getEnv "UPLCG_PORT"
+ base <- splitPath . T.pack <$> getEnv "UPLCG_BASE"
let settings = Warp.setPort port . Warp.setHost host $ Warp.defaultSettings
timeCache <- FL.newTimeCache FL.simpleTimeFormat
FL.withTimedFastLogger timeCache
diff --git a/server/lib/Cafp/Messages.hs b/server/lib/Uplcg/Messages.hs
index 5066447..b1627e9 100644
--- a/server/lib/Cafp/Messages.hs
+++ b/server/lib/Uplcg/Messages.hs
@@ -1,6 +1,6 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE TemplateHaskell #-}
-module Cafp.Messages
+module Uplcg.Messages
( BlackCard (..)
, WhiteCard (..)
, Cards (..)
diff --git a/server/src/GenerateElmTypes.hs b/server/src/GenerateElmTypes.hs
index c85aaf3..7fbca10 100644
--- a/server/src/GenerateElmTypes.hs
+++ b/server/src/GenerateElmTypes.hs
@@ -1,4 +1,4 @@
-import qualified Cafp.Main.GenerateElmTypes
+import qualified Uplcg.Main.GenerateElmTypes
main :: IO ()
-main = Cafp.Main.GenerateElmTypes.main
+main = Uplcg.Main.GenerateElmTypes.main
diff --git a/server/src/Server.hs b/server/src/Server.hs
index fba65ef..95ef75c 100644
--- a/server/src/Server.hs
+++ b/server/src/Server.hs
@@ -1,4 +1,4 @@
-import qualified Cafp.Main.Server
+import qualified Uplcg.Main.Server
main :: IO ()
-main = Cafp.Main.Server.main
+main = Uplcg.Main.Server.main
diff --git a/server/cafp.cabal b/server/uplcg.cabal
index a0eded7..830c01a 100644
--- a/server/cafp.cabal
+++ b/server/uplcg.cabal
@@ -1,6 +1,6 @@
-Name: cafp
+Name: uplcg
Version: 0.1.0
-Synopsis: Cards Against Functional Programming
+Synopsis: Untitled PL Card Game
License: BSD3
License-file: LICENSE
Author: Jasper Van der Jeugt <m@jaspervdj.be>
@@ -16,11 +16,11 @@ Library
Hs-source-dirs: lib
Exposed-modules:
- Cafp.CookieSocket
- Cafp.Game
- Cafp.Messages
- Cafp.Main.GenerateElmTypes
- Cafp.Main.Server
+ Uplcg.CookieSocket
+ Uplcg.Game
+ Uplcg.Messages
+ Uplcg.Main.GenerateElmTypes
+ Uplcg.Main.Server
Build-depends:
aeson >= 1.4 && < 1.5,
@@ -48,16 +48,16 @@ Library
warp >= 3.3 && < 3.4,
websockets >= 0.12 && < 0.13
-Executable cafp-generate-elm-types
+Executable uplcg-generate-elm-types
Hs-source-dirs: src
Main-is: GenerateElmTypes.hs
Default-language: Haskell2010
Ghc-options: -Wall
- Build-depends: base, cafp
+ Build-depends: base, uplcg
-Executable cafp-server
+Executable uplcg-server
Hs-source-dirs: src
Main-is: Server.hs
Default-language: Haskell2010
Ghc-options: -Wall -O2 -threaded -rtsopts "-with-rtsopts=-N"
- Build-depends: base, cafp
+ Build-depends: base, uplcg