- Some fixes to official server build
- Encode stored message, fixes bug of
r3f4c3fc146c2
--- a/gameServer/Actions.hs Sat Aug 17 23:38:53 2013 +0400
+++ b/gameServer/Actions.hs Sun Aug 18 17:29:17 2013 +0400
@@ -672,7 +672,8 @@
processAction (CheckSuccess info) = do
Just (CheckInfo fileName teams) <- client's checkInfo
- io $ writeChan (dbQueries si) $ StoreAchievement fileName (map toPair teams) info
+ si <- gets serverInfo
+ io $ writeChan (dbQueries si) $ StoreAchievements (B.pack fileName) (map toPair teams) info
io $ moveCheckedRecord fileName
where
toPair t = (teamname t, teamowner t)
--- a/gameServer/CoreTypes.hs Sat Aug 17 23:38:53 2013 +0400
+++ b/gameServer/CoreTypes.hs Sun Aug 18 17:29:17 2013 +0400
@@ -263,7 +263,7 @@
CheckAccount ClientIndex Int B.ByteString B.ByteString
| ClearCache
| SendStats Int Int
- | StoreAchievement [(B.ByteString, B.ByteString)] [B.ByteString]
+ | StoreAchievements B.ByteString [(B.ByteString, B.ByteString)] [B.ByteString]
deriving (Show, Read)
data CoreMessage =
--- a/gameServer/EngineInteraction.hs Sat Aug 17 23:38:53 2013 +0400
+++ b/gameServer/EngineInteraction.hs Sun Aug 18 17:29:17 2013 +0400
@@ -43,7 +43,7 @@
lft = foldr l Nothing
l m n = let m' = B.head $ B.tail m; tst = flip Set.member in
if not $ tst timedMessages m' then n
- else if '+' /= m' then Just Nothing else Just $ Just m
+ else if '+' /= m' then Just Nothing else Just . Just . B.pack . Base64.encode . BW.unpack $ m
isNonEmpty = (/=) '+' . B.head . B.tail
legalMessages = Set.fromList $ "M#+LlRrUuDdZzAaSjJ,sNpPwtghbc12345" ++ slotMessages
slotMessages = "\128\129\130\131\132\133\134\135\136\137\138"
--- a/gameServer/OfficialServer/extdbinterface.hs Sat Aug 17 23:38:53 2013 +0400
+++ b/gameServer/OfficialServer/extdbinterface.hs Sun Aug 18 17:29:17 2013 +0400
@@ -46,7 +46,7 @@
SendStats clients rooms ->
run dbConn dbQueryStats [SqlInt32 $ fromIntegral clients, SqlInt32 $ fromIntegral rooms] >> return ()
- StoreAchievements -> return ()
+ StoreAchievements {} -> return ()
dbConnectionLoop mySQLConnectionInfo =