# HG changeset patch # User antonc27 # Date 1447039529 -3600 # Node ID 62af5c67662df185c8ceb352965c28f83598ca56 # Parent d98070707214976eb8b37417593a95a2d8786ca5# Parent c32b5d5181dd87a3ce915a2442f50a6d3e103538 Merge from default diff -r d98070707214 -r 62af5c67662d ChangeLog.txt --- a/ChangeLog.txt Mon Nov 09 04:24:08 2015 +0100 +++ b/ChangeLog.txt Mon Nov 09 04:25:29 2015 +0100 @@ -3,6 +3,8 @@ 0.9.22 -> 0.9.23 * Hammer damage is now rounded down. This means it will cause NO DAMAGE to a hedgehog with less than 3 hp. + * Fixed bee not being affected by wrap world edge while still being thrown + * Fixed turn not ending when sticky mine was trapped on rubberband 0.9.21 -> 0.9.22 + New Weapon / Map object: AirMine (floating mine that will follow nearby hedgehogs) diff -r d98070707214 -r 62af5c67662d README --- a/README Mon Nov 09 04:24:08 2015 +0100 +++ b/README Mon Nov 09 04:25:29 2015 +0100 @@ -1,46 +1,1 @@ -Hedgewars - a turn based strategy game. -======================================= - -Copyright 2004-2015 Andrey Korotaev and others. -See QTfrontend/res/html/about.html and CREDITS for a complete list of authors. - -Licence: --------- -Source code is distributed under the terms of the GNU General Public Licence -version 2; images and sounds are distributed under the terms of the GNU Free -Documentation Licence version 1.2. See the COPYING file for the full text of -the licenses. - -Instructions: -------------- -See our wiki at: https://code.google.com/p/hedgewars/wiki/BuildingHedgewars - -You can find an outline of the necessary dependencies in the INSTALL file. - -Source code: ------------- -Our main repository is located at http://hedgewars.googlecode.com using -Mercurial as DVCS. A Git repository is also available (mirrored daily) -at https://github.com/hedgewars/hw - -Contribute: ------------ -If you see a bug or have any suggestion please use the official bug tracker at -http://code.google.com/p/hedgewars/issues/list or the integrated feedback -button. - -If you want to help or get to know the sources better you can do that with some -easy tasks from http://code.google.com/p/hedgewars/wiki/TODO. We also have an -extended API in LUA to customize your adventures in our wiki at -http://code.google.com/p/hedgewars/wiki/LuaAPI. - -If you know your way through the code feel free to send a patch or open a pull -request. The best LUA scripts get released in the official DLC page and later -integrated in the next version. - -Contact: --------- -* IRC channel - irc://irc.freenode.net/hedgewars -* community forum - http://www.hedgewars.org/forum -* mailing list - https://mail.gna.org/listinfo/hedgewars-dev - +README.md \ No newline at end of file diff -r d98070707214 -r 62af5c67662d README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Mon Nov 09 04:25:29 2015 +0100 @@ -0,0 +1,46 @@ +Hedgewars - a turn based strategy game. +======================================= + +Copyright 2004-2015 Andrey Korotaev and others. +See QTfrontend/res/html/about.html and CREDITS for a complete list of authors. + +Licence: +-------- +Source code is distributed under the terms of the GNU General Public Licence +version 2; images and sounds are distributed under the terms of the GNU Free +Documentation Licence version 1.2. See the COPYING file for the full text of +the licenses. + +Instructions: +------------- +See our wiki at: http://hedgewars.org/kb/BuildingHedgewars + +You can find an outline of the necessary dependencies in the INSTALL file. + +Source code: +------------ +Our main repository is located at http://hg.hedgewars.org/hedgewars/ using +Mercurial as DVCS. A Git repository is also available (mirrored daily) +at https://github.com/hedgewars/hw + +Contribute: +----------- +If you see a bug or have any suggestion please use the official bug tracker at +http://code.google.com/p/hedgewars/issues/list or the integrated feedback +button. + +If you want to help or get to know the sources better you can do that with some +easy tasks from http://hedgewars.org/kb/TODO. We also have an +extended API in LUA to customize your adventures in our wiki at +http://hedgewars.org/kb/LuaAPI. + +If you know your way through the code feel free to send a patch or open a pull +request. The best LUA scripts get released in the official DLC page and later +integrated in the next version. + +Contact: +-------- +* IRC channel - irc://irc.freenode.net/hedgewars +* community forum - http://www.hedgewars.org/forum +* mailing list - https://mail.gna.org/listinfo/hedgewars-dev + diff -r d98070707214 -r 62af5c67662d gameServer/Actions.hs --- a/gameServer/Actions.hs Mon Nov 09 04:24:08 2015 +0100 +++ b/gameServer/Actions.hs Mon Nov 09 04:25:29 2015 +0100 @@ -762,10 +762,11 @@ processAction (CheckSuccess info) = do - Just (CheckInfo fileName teams script) <- client's checkInfo + Just (CheckInfo fileName teams gameDetails) <- client's checkInfo p <- client's clientProto si <- gets serverInfo - io $ writeChan (dbQueries si) $ StoreAchievements p (B.pack fileName) (map toPair teams) script info + when (isJust gameDetails) + $ io $ writeChan (dbQueries si) $ StoreAchievements p (B.pack fileName) (map toPair teams) (fromJust gameDetails) info io $ moveCheckedRecord fileName where toPair t = (teamname t, teamowner t) diff -r d98070707214 -r 62af5c67662d gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Mon Nov 09 04:24:08 2015 +0100 +++ b/gameServer/CoreTypes.hs Mon Nov 09 04:25:29 2015 +0100 @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \-} -{-# LANGUAGE CPP, OverloadedStrings, DeriveDataTypeable #-} +{-# LANGUAGE CPP, OverloadedStrings, DeriveDataTypeable, GeneralizedNewtypeDeriving #-} module CoreTypes where import Control.Concurrent @@ -120,7 +120,7 @@ { recordFileName :: String, recordTeams :: [TeamInfo], - recordScript :: B.ByteString + details :: Maybe GameDetails } data ClientInfo = @@ -346,10 +346,21 @@ CheckAccount ClientIndex Int B.ByteString B.ByteString | ClearCache | SendStats Int Int - | StoreAchievements Word16 B.ByteString [(B.ByteString, B.ByteString)] B.ByteString [B.ByteString] + | StoreAchievements Word16 B.ByteString [(B.ByteString, B.ByteString)] GameDetails [B.ByteString] | GetReplayName ClientIndex Int B.ByteString deriving (Show, Read) +data GameDetails = + GameDetails { + gameScript :: B.ByteString + , infRope + , isVamp + , infAttacks :: Bool + } deriving (Show, Read) + +instance NFData GameDetails where + rnf (GameDetails a b c d) = a `deepseq` b `deepseq` c `deepseq` d `deepseq` () + data CoreMessage = Accept ClientInfo | ClientMessage (ClientIndex, [B.ByteString]) diff -r d98070707214 -r 62af5c67662d gameServer/EngineInteraction.hs --- a/gameServer/EngineInteraction.hs Mon Nov 09 04:24:08 2015 +0100 +++ b/gameServer/EngineInteraction.hs Mon Nov 09 04:25:29 2015 +0100 @@ -100,8 +100,8 @@ -> Map.Map B.ByteString B.ByteString -> Map.Map B.ByteString [B.ByteString] -> [B.ByteString] - -> ([B.ByteString], [B.ByteString]) -replayToDemo ti mParams prms msgs = if not sane then ([], []) else ([scriptName], concat [ + -> (Maybe GameDetails, [B.ByteString]) +replayToDemo ti mParams prms msgs = if not sane then (Nothing, []) else (Just $ GameDetails scriptName infRopes vamp infattacks, concat [ [em "TD"] , maybeScript , maybeMap @@ -126,6 +126,7 @@ && Set.null (keys2 Set.\\ Map.keysSet prms) && (not . null . drop 41 $ scheme) && (not . null . tail $ prms Map.! "AMMO") + && ((B.length . head $ prms Map.! "AMMO") > 200) mapGenTypes = ["+rnd+", "+maze+", "+drawn+", "+perlin+"] scriptName = head . fromMaybe ["Normal"] $ Map.lookup "SCRIPT" prms maybeScript = let s = scriptName in if s == "Normal" then [] else [eml ["escript Scripts/Multiplayer/", s, ".lua"]] @@ -162,6 +163,9 @@ ]) $ hedgehogs t ) + infRopes = ammoStr `B.index` 7 == '9' + vamp = gameFlags .&. 0x00000200 /= 0 + infattacks = gameFlags .&. 0x00100000 /= 0 drawnMapData :: B.ByteString -> [B.ByteString] drawnMapData = diff -r d98070707214 -r 62af5c67662d gameServer/OfficialServer/GameReplayStore.hs --- a/gameServer/OfficialServer/GameReplayStore.hs Mon Nov 09 04:24:08 2015 +0100 +++ b/gameServer/OfficialServer/GameReplayStore.hs Mon Nov 09 04:25:29 2015 +0100 @@ -70,11 +70,11 @@ where loadFile :: String -> IO (Maybe CheckInfo, [B.ByteString]) loadFile fileName = E.handle (\(e :: SomeException) -> - warningM "REPLAYS" ("Problems reading " ++ fileName ++ ": " ++ show e) >> return (Just $ CheckInfo fileName [] "", [])) $ do + warningM "REPLAYS" ("Problems reading " ++ fileName ++ ": " ++ show e) >> return (Just $ CheckInfo fileName [] Nothing, [])) $ do (teams, params1, params2, roundMsgs) <- liftM read $ readFile fileName let d = replayToDemo teams (Map.fromList params1) (Map.fromList params2) (reverse roundMsgs) d `deepseq` return $ ( - Just (CheckInfo fileName teams (head $ fst d)) + Just (CheckInfo fileName teams (fst d)) , snd d ) diff -r d98070707214 -r 62af5c67662d gameServer/OfficialServer/extdbinterface.hs --- a/gameServer/OfficialServer/extdbinterface.hs Mon Nov 09 04:24:08 2015 +0100 +++ b/gameServer/OfficialServer/extdbinterface.hs Mon Nov 09 04:25:29 2015 +0100 @@ -52,8 +52,8 @@ \ ?, ?, ?, ?)" dbQueryGamesHistory = - "INSERT INTO rating_games (script, protocol, filename, time) \ - \ VALUES (?, ?, ?, ?)" + "INSERT INTO rating_games (script, protocol, filename, time, vamp, ropes, infattacks) \ + \ VALUES (?, ?, ?, ?, ?, ?, ?)" dbQueryGameId = "SELECT LAST_INSERT_ID()" @@ -93,8 +93,8 @@ SendStats clients rooms -> void $ execute dbConn dbQueryStats (clients, rooms) - StoreAchievements p fileName teams script info -> - sequence_ $ parseStats dbConn p fileName teams script info + StoreAchievements p fileName teams g info -> + sequence_ $ parseStats dbConn p fileName teams g info --readTime = read . B.unpack . B.take 19 . B.drop 8 @@ -105,18 +105,18 @@ -> Word16 -> B.ByteString -> [(B.ByteString, B.ByteString)] - -> B.ByteString + -> GameDetails -> [B.ByteString] -> [IO Int64] -parseStats dbConn p fileName teams script = ps +parseStats dbConn p fileName teams (GameDetails script infRopes vamp infAttacks) = ps where time = readTime fileName ps :: [B.ByteString] -> [IO Int64] ps [] = [] - ps ("DRAW" : bs) = execute dbConn dbQueryGamesHistory (script, (fromIntegral p) :: Int, fileName, time) + ps ("DRAW" : bs) = execute dbConn dbQueryGamesHistory (script, (fromIntegral p) :: Int, fileName, time, vamp, infRopes, infAttacks) : places (map drawParams teams) : ps bs - ps ("WINNERS" : n : bs) = let winNum = readInt_ n in execute dbConn dbQueryGamesHistory (script, (fromIntegral p) :: Int, fileName, time) + ps ("WINNERS" : n : bs) = let winNum = readInt_ n in execute dbConn dbQueryGamesHistory (script, (fromIntegral p) :: Int, fileName, time, vamp, infRopes, infAttacks) : places (map (placeParams (take winNum bs)) teams) : ps (drop winNum bs) ps ("ACHIEVEMENT" : typ : teamname : location : value : bs) = execute dbConn dbQueryAchievement diff -r d98070707214 -r 62af5c67662d hedgewars/avwrapper/avwrapper.c --- a/hedgewars/avwrapper/avwrapper.c Mon Nov 09 04:24:08 2015 +0100 +++ b/hedgewars/avwrapper/avwrapper.c Mon Nov 09 04:25:29 2015 +0100 @@ -302,13 +302,7 @@ #endif // open the codec -#if LIBAVCODEC_VERSION_MAJOR >= 53 - AVDictionary* pDict = NULL; - if (strcmp(g_pVCodec->name, "libx264") == 0) - av_dict_set(&pDict, "preset", "medium", 0); -#endif - - if (avcodec_open2(g_pVideo, g_pVCodec, &pDict) < 0) + if (avcodec_open2(g_pVideo, g_pVCodec, NULL) < 0) return FatalError("Could not open video codec %s", g_pVCodec->long_name); g_pVFrame = av_frame_alloc(); diff -r d98070707214 -r 62af5c67662d hedgewars/hwengine.pas diff -r d98070707214 -r 62af5c67662d hedgewars/options.inc diff -r d98070707214 -r 62af5c67662d hedgewars/uChat.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uGearsRender.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uLandTexture.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uMatrix.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uRender.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uRenderUtils.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uScript.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uStore.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uTextures.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uTypes.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uVariables.pas diff -r d98070707214 -r 62af5c67662d hedgewars/uWorld.pas diff -r d98070707214 -r 62af5c67662d share/hedgewars/Data/CMakeLists.txt diff -r d98070707214 -r 62af5c67662d share/hedgewars/Data/Shaders/CMakeLists.txt diff -r d98070707214 -r 62af5c67662d share/hedgewars/Data/Shaders/default.fs diff -r d98070707214 -r 62af5c67662d share/hedgewars/Data/Shaders/default.vs diff -r d98070707214 -r 62af5c67662d share/hedgewars/Data/Shaders/water.fs diff -r d98070707214 -r 62af5c67662d share/hedgewars/Data/Shaders/water.vs