Connect to a certain game instead of index.
This commit is contained in:
@@ -2,6 +2,9 @@ module Go.Ws exposing (..)
|
||||
import Go.Types exposing (..)
|
||||
import WebSocket
|
||||
|
||||
wsUrl : Model -> String
|
||||
wsUrl m = (m.sessionUrl ++ "/game/" ++ (toString m.sessionId))
|
||||
|
||||
encodeCell : Cell -> String
|
||||
encodeCell ((x, y), c) = "place "
|
||||
++ (toString x) ++ " "
|
||||
@@ -9,4 +12,4 @@ encodeCell ((x, y), c) = "place "
|
||||
++ (toString c)
|
||||
|
||||
sendMove : Model -> Cell -> Cmd Msg
|
||||
sendMove m c = WebSocket.send m.sessionUrl (encodeCell c)
|
||||
sendMove m c = WebSocket.send (wsUrl m) (encodeCell c)
|
||||
|
||||
Reference in New Issue
Block a user