aboutsummaryrefslogtreecommitdiff
path: root/server/lib/Cafp
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/Cafp')
-rw-r--r--server/lib/Cafp/Game.hs6
-rw-r--r--server/lib/Cafp/Messages.hs6
2 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/Cafp/Game.hs b/server/lib/Cafp/Game.hs
index f3d500f..af958ae 100644
--- a/server/lib/Cafp/Game.hs
+++ b/server/lib/Cafp/Game.hs
@@ -48,7 +48,7 @@ leaveGame pid = over gamePlayers $ HMS.delete pid
processClientMessage :: PlayerId -> ClientMessage -> Game -> Game
processClientMessage pid msg game = case msg of
- ChangeName name ->
+ ChangeMyName name ->
game & gamePlayers . ix pid .~ name
gameViewForPlayer :: PlayerId -> Game -> GameView
@@ -56,6 +56,6 @@ gameViewForPlayer self game =
let opponents = map snd . HMS.toList . HMS.delete self $ game ^. gamePlayers
name = fromMaybe "" $ game ^. gamePlayers . at self in
GameView
- { gameViewOpponents = opponents
- , gameViewPlayerName = name
+ { gameViewOpponents = opponents
+ , gameViewMyName = name
}
diff --git a/server/lib/Cafp/Messages.hs b/server/lib/Cafp/Messages.hs
index d92ce80..29f5575 100644
--- a/server/lib/Cafp/Messages.hs
+++ b/server/lib/Cafp/Messages.hs
@@ -9,8 +9,8 @@ import Data.Text (Text)
import Elm.Derive
data GameView = GameView
- { gameViewOpponents :: [Text]
- , gameViewPlayerName :: Text
+ { gameViewOpponents :: [Text]
+ , gameViewMyName :: Text
} deriving (Show)
data ServerMessage
@@ -20,7 +20,7 @@ data ServerMessage
deriving (Show)
data ClientMessage
- = ChangeName Text
+ = ChangeMyName Text
deriving (Show)
deriveBoth (defaultOptionsDropLower 8) ''GameView