# HG changeset patch # User koda # Date 1388317025 -3600 # Node ID 141c0d6c217987c6388000ce19e57a866e07b804 # Parent acf1ccf06b2de5f0a9bfd7126b5dc1226d7f10be# Parent 1639442827101b9c3b03fa68e7eba02f5fec0d15 merge diff -r acf1ccf06b2d -r 141c0d6c2179 gameServer/Actions.hs --- a/gameServer/Actions.hs Sun Dec 29 12:36:16 2013 +0100 +++ b/gameServer/Actions.hs Sun Dec 29 12:37:05 2013 +0100 @@ -717,8 +717,9 @@ processAction (CheckSuccess info) = do Just (CheckInfo fileName teams) <- client's checkInfo + p <- client's clientProto si <- gets serverInfo - io $ writeChan (dbQueries si) $ StoreAchievements (B.pack fileName) (map toPair teams) info + io $ writeChan (dbQueries si) $ StoreAchievements p (B.pack fileName) (map toPair teams) info io $ moveCheckedRecord fileName where toPair t = (teamname t, teamowner t) diff -r acf1ccf06b2d -r 141c0d6c2179 gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Sun Dec 29 12:36:16 2013 +0100 +++ b/gameServer/CoreTypes.hs Sun Dec 29 12:37:05 2013 +0100 @@ -275,7 +275,7 @@ CheckAccount ClientIndex Int B.ByteString B.ByteString | ClearCache | SendStats Int Int - | StoreAchievements B.ByteString [(B.ByteString, B.ByteString)] [B.ByteString] + | StoreAchievements Word16 B.ByteString [(B.ByteString, B.ByteString)] [B.ByteString] | GetReplayName ClientIndex Int B.ByteString deriving (Show, Read) diff -r acf1ccf06b2d -r 141c0d6c2179 gameServer/OfficialServer/checker.hs --- a/gameServer/OfficialServer/checker.hs Sun Dec 29 12:36:16 2013 +0100 +++ b/gameServer/OfficialServer/checker.hs Sun Dec 29 12:37:05 2013 +0100 @@ -36,7 +36,7 @@ deriving Show serverAddress = "netserver.hedgewars.org" -protocolNumber = "45" +protocolNumber = "47" getLines :: Handle -> IO [B.ByteString] getLines h = g @@ -77,10 +77,10 @@ hFlush h hClose h - (_, _, Just hOut, _) <- createProcess (proc "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.19/bin/hwengine" + (_, _, Just hOut, _) <- createProcess (proc "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.20/bin/hwengine" [fileName , "--user-prefix", "/usr/home/unC0Rr/.hedgewars" - , "--prefix", "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.19/share/hedgewars/Data" + , "--prefix", "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.20/share/hedgewars/Data" , "--nomusic" , "--nosound" , "--stats-only" diff -r acf1ccf06b2d -r 141c0d6c2179 gameServer/OfficialServer/extdbinterface.hs --- a/gameServer/OfficialServer/extdbinterface.hs Sun Dec 29 12:36:16 2013 +0100 +++ b/gameServer/OfficialServer/extdbinterface.hs Sun Dec 29 12:37:05 2013 +0100 @@ -26,9 +26,9 @@ "INSERT INTO gameserver_stats (players, rooms, last_update) VALUES (?, ?, UNIX_TIMESTAMP())" dbQueryAchievement = - "INSERT INTO achievements (time, typeid, userid, value, filename, location) \ + "INSERT INTO achievements (time, typeid, userid, value, filename, location, protocol) \ \ VALUES (?, (SELECT id FROM achievement_types WHERE name = ?), (SELECT uid FROM users WHERE name = ?), \ - \ ?, ?, ?)" + \ ?, ?, ?, ?)" dbQueryReplayFilename = "SELECT filename FROM achievements WHERE id = ?" @@ -70,15 +70,15 @@ SendStats clients rooms -> run dbConn dbQueryStats [SqlInt32 $ fromIntegral clients, SqlInt32 $ fromIntegral rooms] >> return () --StoreAchievements (B.pack fileName) (map toPair teams) info - StoreAchievements fileName teams info -> - mapM_ (run dbConn dbQueryAchievement) $ (parseStats fileName teams) info + StoreAchievements p fileName teams info -> + mapM_ (run dbConn dbQueryAchievement) $ (parseStats p fileName teams) info readTime = read . B.unpack . B.take 19 . B.drop 8 -parseStats :: B.ByteString -> [(B.ByteString, B.ByteString)] -> [B.ByteString] -> [[SqlValue]] -parseStats fileName teams = ps +parseStats :: Word16 -> B.ByteString -> [(B.ByteString, B.ByteString)] -> [B.ByteString] -> [[SqlValue]] +parseStats p fileName teams = ps where time = readTime fileName ps [] = [] @@ -91,6 +91,7 @@ , SqlInt32 (readInt_ value) , SqlByteString fileName , SqlByteString location + , SqlInt32 p ] : ps bs ps (b:bs) = ps bs diff -r acf1ccf06b2d -r 141c0d6c2179 hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Sun Dec 29 12:36:16 2013 +0100 +++ b/hedgewars/uGearsHandlersMess.pas Sun Dec 29 12:37:05 2013 +0100 @@ -3192,7 +3192,7 @@ procedure doStepDrill(Gear: PGear); var t: PGearArray; - oldDx, oldDy: hwFloat; + oldX, oldY, oldDx, oldDy: hwFloat; t2: hwFloat; begin AllInactive := false; @@ -3202,6 +3202,8 @@ oldDx := Gear^.dX; oldDy := Gear^.dY; + oldX := Gear^.X; + oldY := Gear^.Y; doStepFallingGear(Gear); @@ -3217,6 +3219,8 @@ //hit Gear^.dX := oldDx; Gear^.dY := oldDy; + Gear^.X := oldX; + Gear^.Y := oldY; if GameTicks > Gear^.FlightTime then t := CheckGearsCollision(Gear) @@ -3241,6 +3245,8 @@ exit; end; + Gear^.X:= Gear^.X+Gear^.dX*4; + Gear^.Y:= Gear^.Y+Gear^.dY*4; Gear^.SoundChannel := LoopSound(sndDrillRocket); Gear^.doStep := @doStepDrillDrilling; @@ -5483,7 +5489,7 @@ if (Timer = iceCollideWithGround) and ((GameTicks - Power) > groundFreezingTime) then begin - FillRoundInLand(target.x, target.y, iceRadius, icePixel); + FillRoundInLandFT(target.x, target.y, iceRadius, icePixel); landRect.x := min(max(target.x - iceRadius, 0), LAND_WIDTH - 1); landRect.y := min(max(target.y - iceRadius, 0), LAND_HEIGHT - 1); landRect.w := min(2*iceRadius, LAND_WIDTH - landRect.x - 1); diff -r acf1ccf06b2d -r 141c0d6c2179 hedgewars/uLand.pas --- a/hedgewars/uLand.pas Sun Dec 29 12:36:16 2013 +0100 +++ b/hedgewars/uLand.pas Sun Dec 29 12:37:05 2013 +0100 @@ -123,7 +123,7 @@ for x:= 0 to LAND_WIDTH - 1 do for y:= 0 to LAND_HEIGHT - 1 do - if LandPixels[y, x] = 0 then + if Land[y, x] = 0 then if s < y then begin for i:= max(s, y - 8) to y - 1 do @@ -157,7 +157,7 @@ for y:= 0 to LAND_HEIGHT - 1 do for x:= 0 to LAND_WIDTH - 1 do - if LandPixels[y, x] = 0 then + if Land[y, x] = 0 then if s < x then begin for i:= max(s, x - 8) to x - 1 do diff -r acf1ccf06b2d -r 141c0d6c2179 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Sun Dec 29 12:36:16 2013 +0100 +++ b/hedgewars/uLandGraphics.pas Sun Dec 29 12:37:05 2013 +0100 @@ -40,7 +40,7 @@ procedure DrawHLinesExplosions(ar: PRangeArray; Radius: LongInt; y, dY: LongInt; Count: Byte); procedure DrawTunnel(X, Y, dX, dY: hwFloat; ticks, HalfWidth: LongInt); procedure FillRoundInLand(X, Y, Radius: LongInt; Value: Longword); -function FillRoundInLand(X, Y, Radius: LongInt; fill: fillType): LongWord; +function FillRoundInLandFT(X, Y, Radius: LongInt; fill: fillType): Longword; procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); function LandBackPixel(x, y: LongInt): LongWord; procedure DrawLine(X1, Y1, X2, Y2: LongInt; Color: Longword); @@ -171,44 +171,44 @@ end; -function FillLandCircleLine(y, fromPix, toPix: LongInt; fill : fillType): Longword; +function FillLandCircleLineFT(y, fromPix, toPix: LongInt; fill : fillType): Longword; var px, py, i: LongInt; begin //get rid of compiler warning px := 0; py := 0; - FillLandCircleLine := 0; + FillLandCircleLineFT := 0; case fill of backgroundPixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - inc(FillLandCircleLine, drawPixelBG(i, y, px, py)); - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + inc(FillLandCircleLineFT, drawPixelBG(i, y, px, py)); + end; ebcPixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - drawPixelEBC(i, y, px, py); - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + drawPixelEBC(i, y, px, py); + end; nullPixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - if ((Land[y, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[y, i] > 255)) then - LandPixels[py, px]:= 0 - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + if ((Land[y, i] and lfIndestructible) = 0) and (not disableLandBack or (Land[y, i] > 255)) then + LandPixels[py, px]:= 0 + end; icePixel: - for i:= fromPix to toPix do - begin - calculatePixelsCoordinates(i, y, px, py); - DrawPixelIce(i, y, px, py); - end; + for i:= fromPix to toPix do + begin + calculatePixelsCoordinates(i, y, px, py); + DrawPixelIce(i, y, px, py); + end; setNotCurrentMask: - for i:= fromPix to toPix do - begin - Land[y, i]:= Land[y, i] and lfNotCurrentMask; - end; + for i:= fromPix to toPix do + begin + Land[y, i]:= Land[y, i] and lfNotCurrentMask; + end; changePixelSetNotCurrent: for i:= fromPix to toPix do begin @@ -216,10 +216,10 @@ Land[y, i]:= Land[y, i] - 1; end; setCurrentHog: - for i:= fromPix to toPix do - begin - Land[y, i]:= Land[y, i] or lfCurrentHog - end; + for i:= fromPix to toPix do + begin + Land[y, i]:= Land[y, i] or lfCurrentHog + end; changePixelNotSetNotCurrent: for i:= fromPix to toPix do begin @@ -229,29 +229,29 @@ end; end; -function FillLandCircleSegment(x, y, dx, dy: LongInt; fill : fillType): Longword; inline; +function FillLandCircleSegmentFT(x, y, dx, dy: LongInt; fill : fillType): Longword; inline; begin - FillLandCircleSegment := 0; + FillLandCircleSegmentFT := 0; if ((y + dy) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y + dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y + dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); if ((y - dy) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y - dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y - dy, Max(x - dx, 0), Min(x + dx, LAND_WIDTH - 1), fill)); if ((y + dx) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y + dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y + dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); if ((y - dx) and LAND_HEIGHT_MASK) = 0 then - inc(FillLandCircleSegment, FillLandCircleLine(y - dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); + inc(FillLandCircleSegmentFT, FillLandCircleLineFT(y - dx, Max(x - dy, 0), Min(x + dy, LAND_WIDTH - 1), fill)); end; -function FillRoundInLand(X, Y, Radius: LongInt; fill: fillType): Longword; inline; +function FillRoundInLandFT(X, Y, Radius: LongInt; fill: fillType): Longword; inline; var dx, dy, d: LongInt; begin dx:= 0; dy:= Radius; d:= 3 - 2 * Radius; -FillRoundInLand := 0; +FillRoundInLandFT := 0; while (dx < dy) do begin - inc(FillRoundInLand, FillLandCircleSegment(x, y, dx, dy, fill)); + inc(FillRoundInLandFT, FillLandCircleSegmentFT(x, y, dx, dy, fill)); if (d < 0) then d:= d + 4 * dx + 6 else @@ -262,7 +262,7 @@ inc(dx) end; if (dx = dy) then - inc (FillRoundInLand, FillLandCircleSegment(x, y, dx, dy, fill)); + inc (FillRoundInLandFT, FillLandCircleSegmentFT(x, y, dx, dy, fill)); end; @@ -343,13 +343,13 @@ procedure ChangeRoundInLand(X, Y, Radius: LongInt; doSet, isCurrent: boolean); begin if not doSet and isCurrent then - FillRoundInLand(X, Y, Radius, setNotCurrentMask) + FillRoundInLandFT(X, Y, Radius, setNotCurrentMask) else if not doSet and not IsCurrent then - FillRoundInLand(X, Y, Radius, changePixelSetNotCurrent) + FillRoundInLandFT(X, Y, Radius, changePixelSetNotCurrent) else if doSet and IsCurrent then - FillRoundInLand(X, Y, Radius, setCurrentHog) + FillRoundInLandFT(X, Y, Radius, setCurrentHog) else if doSet and not IsCurrent then - FillRoundInLand(X, Y, Radius, changePixelNotSetNotCurrent); + FillRoundInLandFT(X, Y, Radius, changePixelNotSetNotCurrent); end; procedure DrawIceBreak(x, y, iceRadius, iceHeight: Longint); @@ -379,11 +379,11 @@ var tx, ty, dx, dy: Longint; begin - DrawExplosion := FillRoundInLand(x, y, Radius, backgroundPixel); + DrawExplosion := FillRoundInLandFT(x, y, Radius, backgroundPixel); if Radius > 20 then - FillRoundInLand(x, y, Radius - 15, nullPixel); + FillRoundInLandFT(x, y, Radius - 15, nullPixel); FillRoundInLand(X, Y, Radius, 0); - FillRoundInLand(x, y, Radius + 4, ebcPixel); + FillRoundInLandFT(x, y, Radius + 4, ebcPixel); tx:= Max(X - Radius - 5, 0); dx:= Min(X + Radius + 5, LAND_WIDTH) - tx; ty:= Max(Y - Radius - 5, 0); diff -r acf1ccf06b2d -r 141c0d6c2179 share/hedgewars/Data/Graphics/amRubber.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/share/hedgewars/Data/Graphics/amRubber.svg Sun Dec 29 12:37:05 2013 +0100 @@ -0,0 +1,657 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +