# HG changeset patch # User unc0rr # Date 1230906153 0 # Node ID e140bc57ff68d18bfbe8bad02063e561a41f6c5e # Parent 71e1f67dcfe75dc52f7ed7230d545157f1893779 Quick replay round to spectators until current move diff -r 71e1f67dcfe7 -r e140bc57ff68 QTfrontend/newnetclient.cpp --- a/QTfrontend/newnetclient.cpp Fri Jan 02 14:10:23 2009 +0000 +++ b/QTfrontend/newnetclient.cpp Fri Jan 02 14:22:33 2009 +0000 @@ -189,7 +189,7 @@ void HWNewNet::ParseCmd(const QStringList & lst) { - qDebug() << "Server: " << lst; +// qDebug() << "Server: " << lst; if(!lst.size()) { diff -r 71e1f67dcfe7 -r e140bc57ff68 hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Fri Jan 02 14:10:23 2009 +0000 +++ b/hedgewars/uConsole.pas Fri Jan 02 14:22:33 2009 +0000 @@ -228,6 +228,7 @@ initialization InitConsole; RegisterVariable('proto' , vtCommand, @chCheckProto , true ); +RegisterVariable('spectate', vtBoolean, @fastUntilLag , false); RegisterVariable('capture' , vtCommand, @chCapture , true ); RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); RegisterVariable('addteam' , vtCommand, @chAddTeam , false); diff -r 71e1f67dcfe7 -r e140bc57ff68 hedgewars/uGame.pas --- a/hedgewars/uGame.pas Fri Jan 02 14:10:23 2009 +0000 +++ b/hedgewars/uGame.pas Fri Jan 02 14:22:33 2009 +0000 @@ -47,7 +47,7 @@ end end; if Lag > 100 then Lag:= 100 -else if GameType = gmtSave then Lag:= 2500; +else if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then Lag:= 2500; if (GameType = gmtDemo) and isSpeed then Lag:= Lag * 10; i:= 1; diff -r 71e1f67dcfe7 -r e140bc57ff68 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Fri Jan 02 14:10:23 2009 +0000 +++ b/hedgewars/uGears.pas Fri Jan 02 14:22:33 2009 +0000 @@ -1078,7 +1078,7 @@ gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1); gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0); - gtFlame: DrawSprite(sprFlame, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy,(GameTicks div 128 + Gear^.Tag) mod 8); + gtFlame: DrawSprite(sprFlame, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, (GameTicks div 128 + LongWord(Gear^.Tag)) mod 8); gtParachute: DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0); gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 0) else DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 1); diff -r 71e1f67dcfe7 -r e140bc57ff68 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Fri Jan 02 14:10:23 2009 +0000 +++ b/hedgewars/uIO.pas Fri Jan 02 14:22:33 2009 +0000 @@ -273,7 +273,8 @@ inttostr(headcmd^.Time) + ')', true); -isInLag:= (headcmd = nil) and tmpflag and not CurrentTeam^.hasGone +isInLag:= (headcmd = nil) and tmpflag and not CurrentTeam^.hasGone; +if isInLag then fastUntilLag:= false end; end. diff -r 71e1f67dcfe7 -r e140bc57ff68 hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Fri Jan 02 14:10:23 2009 +0000 +++ b/hedgewars/uMisc.pas Fri Jan 02 14:22:33 2009 +0000 @@ -31,6 +31,8 @@ isInMultiShoot : boolean = false; isSpeed : boolean = false; + fastUntilLag : boolean = false; + GameState : TGameState = Low(TGameState); GameType : TGameType = gmtLocal; GameFlags : Longword = 0; diff -r 71e1f67dcfe7 -r e140bc57ff68 netserver/HWProto.hs --- a/netserver/HWProto.hs Fri Jan 02 14:10:23 2009 +0000 +++ b/netserver/HWProto.hs Fri Jan 02 14:22:33 2009 +0000 @@ -201,7 +201,8 @@ watchRound = if (roomProto clRoom < 20) || (not $ gameinprogress clRoom) then [] else - (answerClientOnly ["RUN_GAME"]) ++ answerClientOnly ("GAMEMSG" : roundMsgs clRoom) + (answerClientOnly ["RUN_GAME"]) ++ + answerClientOnly ("GAMEMSG" : "DGUkc3BlY3RhdGUgMQ==" : roundMsgs clRoom) handleCmd_noRoom client clients rooms ["JOIN", roomName] = handleCmd_noRoom client clients rooms ["JOIN", roomName, ""]