gameServer/HWProtoInRoomState.hs
changeset 3435 4e4f88a7bdf2
parent 2960 b467a681c5e0
child 3500 af8390d807d6
equal deleted inserted replaced
3434:6af73e7f2438 3435:4e4f88a7bdf2
     1 module HWProtoInRoomState where
     1 module HWProtoInRoomState where
     2 
     2 
     3 import qualified Data.Foldable as Foldable
     3 import qualified Data.Foldable as Foldable
     4 import qualified Data.IntMap as IntMap
       
     5 import qualified Data.Map as Map
     4 import qualified Data.Map as Map
     6 import Data.Sequence(Seq, (|>), (><), fromList, empty)
     5 import Data.Sequence(Seq, (|>), (><), fromList, empty)
     7 import Data.List
     6 import Data.List
     8 import Maybe
     7 import Maybe
     9 --------------------------------------
     8 --------------------------------------
    10 import CoreTypes
     9 import CoreTypes
    11 import Actions
    10 import Actions
    12 import Utils
    11 import Utils
       
    12 import HandlerUtils
    13 
    13 
    14 
    14 
    15 handleCmd_inRoom :: CmdHandler
    15 handleCmd_inRoom :: CmdHandler
    16 
    16 
    17 handleCmd_inRoom clID clients _ ["CHAT", msg] =
    17 handleCmd_inRoom ["CHAT", msg] = do
    18     [AnswerOthersInRoom ["CHAT", clientNick, msg]]
    18     n <- clientNick
    19     where
    19     s <- roomOthersChans
    20         clientNick = nick $ clients IntMap.! clID
    20     return [AnswerClients s ["CHAT", n, msg]]
    21 
    21 
       
    22 {-
    22 handleCmd_inRoom clID clients rooms ["PART"] =
    23 handleCmd_inRoom clID clients rooms ["PART"] =
    23     [RoomRemoveThisClient "part"]
    24     [RoomRemoveThisClient "part"]
    24     where
    25     where
    25         client = clients IntMap.! clID
    26         client = clients IntMap.! clID
    26 
    27 
   192     where
   193     where
   193         client = clients IntMap.! clID
   194         client = clients IntMap.! clID
   194         engineMsg = toEngineMsg $ 'b' : ((nick client) ++ "(team): " ++ msg ++ "\x20\x20")
   195         engineMsg = toEngineMsg $ 'b' : ((nick client) ++ "(team): " ++ msg ++ "\x20\x20")
   195 
   196 
   196 handleCmd_inRoom clID _ _ _ = [ProtocolError "Incorrect command (state: in room)"]
   197 handleCmd_inRoom clID _ _ _ = [ProtocolError "Incorrect command (state: in room)"]
       
   198 -}