Display custom node in ConstModule

Also wrote a short introductory node explaining node permissions.
This commit is contained in:
Joscha 2020-02-11 11:43:25 +00:00
parent 29e19ec1b2
commit 4c24430c07
5 changed files with 66 additions and 66 deletions

View file

@ -18,11 +18,11 @@ import Forest.Util
sendUpdatesThread :: WS.Connection -> Chan Node -> Node -> IO ()
sendUpdatesThread conn nodeChan _ = do
newNode <- readChan nodeChan
node' <- readChan nodeChan
-- TODO Don't send the whole node every time
putStrLn $ "Sending full node update with " ++ show newNode
sendPacket conn $ ServerUpdate (Path []) newNode
sendUpdatesThread conn nodeChan newNode
putStrLn $ "Sending full node update with " ++ show node'
sendPacket conn $ ServerUpdate (Path []) node'
sendUpdatesThread conn nodeChan node'
{- Main server application that receives and processes client packets -}
@ -58,4 +58,4 @@ serverApp pingDelay constructor pendingConnection = do
constructor (writeChan chan) $ receivePackets conn
_ -> closeWithErrorMessage conn "Invalid packet: Expected a hello packet"
where
initialNode = emptyNode "Loading ..." False False False False
initialNode = emptyNode "" "Loading ..."