netserver/Miscutils.hs
changeset 1742 cf97d1eecb12
parent 1683 af34da5726aa
child 1748 27dd2967fc65
--- a/netserver/Miscutils.hs	Thu Jan 22 20:34:26 2009 +0000
+++ b/netserver/Miscutils.hs	Sat Jan 24 12:40:30 2009 +0000
@@ -10,6 +10,8 @@
 import Data.Time
 import Data.Sequence(Seq, empty)
 import Network
+import qualified Codec.Binary.Base64 as Base64
+import qualified Codec.Binary.UTF8.String as UTF8
 
 data ClientInfo =
  ClientInfo
@@ -62,6 +64,7 @@
 		isRestrictedJoins :: Bool,
 		isRestrictedTeams :: Bool,
 		roundMsgs :: Seq String,
+		leftTeams :: [String],
 		params :: Map.Map String [String]
 	}
 createRoom = (
@@ -77,6 +80,7 @@
 		False
 		False
 		Data.Sequence.empty
+		[]
 		Map.empty
 	)
 
@@ -200,3 +204,6 @@
 proto2ver 23 = "0.9.9"
 proto2ver 24 = "0.9.10-dev"
 proto2ver _ = "Unknown"
+
+toEngineMsg :: String -> String
+toEngineMsg msg = Base64.encode (fromIntegral (length msg) : (UTF8.encode msg))