--- a/gameServer/Utils.hs Fri Oct 02 18:56:54 2009 +0000
+++ b/gameServer/Utils.hs Sat Oct 03 09:35:14 2009 +0000
@@ -28,7 +28,9 @@
$ concatMap (\n -> (\(a, b) -> [showHex a, showHex b]) $ divMod n 65536) [a, b, c, d]) []
toEngineMsg :: String -> String
-toEngineMsg msg = Base64.encode (fromIntegral (length msg) : (UTF8.encode msg))
+toEngineMsg msg = Base64.encode (fromIntegral (length encodedMsg) : encodedMsg)
+ where
+ encodedMsg = UTF8.encode msg
fromEngineMsg :: String -> Maybe String
fromEngineMsg msg = liftM (map w2c) (Base64.decode msg >>= removeLength)