# HG changeset patch # User unc0rr # Date 1404330900 -14400 # Node ID a51de45dcc42b986d64a33972beaed21887086e1 # Parent 8a90df36bccbde66a1d263981cac2f0e3cc4c7a1 Fix some issues with rejoining (rejoining client still desyncs though) diff -r 8a90df36bccb -r a51de45dcc42 gameServer/HWProtoLobbyState.hs --- a/gameServer/HWProtoLobbyState.hs Wed Jul 02 11:40:57 2014 -0400 +++ b/gameServer/HWProtoLobbyState.hs Wed Jul 02 23:55:00 2014 +0400 @@ -83,7 +83,7 @@ else ( MoveToRoom jRI - : ModifyClient (\c -> c{isJoinedMidGame = isJust $ gameInfo jRoom}) + : ModifyClient (\c -> c{isJoinedMidGame = isJust $ gameInfo jRoom, teamsInGame = fromIntegral $ length clTeams}) : AnswerClients chans ["CLIENT_FLAGS", "-r", nick cl] : [(AnswerClients [sendChan cl] $ "JOINED" : nicks) | not $ null nicks] ) diff -r 8a90df36bccb -r a51de45dcc42 hedgewars/uIO.pas --- a/hedgewars/uIO.pas Wed Jul 02 11:40:57 2014 -0400 +++ b/hedgewars/uIO.pas Wed Jul 02 23:55:00 2014 +0400 @@ -76,7 +76,7 @@ FillChar(command^, sizeof(TCmd), 0); command^.loTime:= Time; command^.str:= str; -if command^.cmd <> 'F' then dec(command^.len, 2); // cut timestamp +if (command^.cmd <> 'F') and (command^.cmd <> 'G') then dec(command^.len, 2); // cut timestamp if headcmd = nil then begin headcmd:= command; @@ -369,8 +369,8 @@ end; 'F': ParseCommand('teamgone u' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true); 'G': ParseCommand('teamback u' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true); - 'f': ParseCommand('teamgone s' + copy(headcmd^.str, 2, headcmd^.len - 3), true); - 'g': ParseCommand('teamback s' + copy(headcmd^.str, 2, headcmd^.len - 3), true); + 'f': ParseCommand('teamgone s' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true); + 'g': ParseCommand('teamback s' + copy(headcmd^.str, 2, Pred(headcmd^.len)), true); 'N': begin tmpflag:= false; lastTurnChecksum:= SDLNet_Read32(@headcmd^.str[2]); diff -r 8a90df36bccb -r a51de45dcc42 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Wed Jul 02 11:40:57 2014 -0400 +++ b/hedgewars/uTeams.pas Wed Jul 02 23:55:00 2014 +0400 @@ -519,8 +519,13 @@ with Team do if skippedTurns < 3 then begin - inc(skippedTurns); - ParseCommand('/skip', true); + inc(skippedTurns); + for i:= 0 to cMaxHHIndex do + with Hedgehogs[i] do + if Gear <> nil then + Gear^.State:= Gear^.State and (not gstHHDriven); + + ParseCommand('/skip', true); end else for i:= 0 to cMaxHHIndex do