# HG changeset patch # User unc0rr # Date 1161878909 0 # Node ID 8d9aff55e6abcc2f9493ffbdca4d2abb2d40db73 # Parent dcdf642459e0f40d9e11632502d5f61743ab0e44 - Set version to 0.8 - Check protocol version to ensure clients compatibility in further versions diff -r dcdf642459e0 -r 8d9aff55e6ab CMakeLists.txt --- a/CMakeLists.txt Wed Oct 25 19:41:14 2006 +0000 +++ b/CMakeLists.txt Thu Oct 26 16:08:29 2006 +0000 @@ -15,7 +15,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hedgewars, a turn-based strategy") set(CPACK_PACKAGE_VENDOR "Hedgewars") set(CPACK_PACKAGE_VERSION_MAJOR "0") -set(CPACK_PACKAGE_VERSION_MINOR "2") +set(CPACK_PACKAGE_VERSION_MINOR "8") set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_FILE_NAME "hedgewars-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") set(CPACK_PACKAGE_EXECUTABLES "hedgewars" "hwengine") diff -r dcdf642459e0 -r 8d9aff55e6ab hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Wed Oct 25 19:41:14 2006 +0000 +++ b/hedgewars/CCHandlers.inc Thu Oct 26 16:08:29 2006 +0000 @@ -31,6 +31,18 @@ GameState:= gsExit end; +procedure chCheckProto(var s: shortstring); +var i, c: integer; +begin +if isDeveloperMode then + begin + val(s, i, c); + if (c <> 0) or (i = 0) then exit; + TryDo(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old', true); + TryDo(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new', true) + end +end; + procedure chAddTeam(var s: shortstring); const TeamsCount: Longword = 0; begin diff -r dcdf642459e0 -r 8d9aff55e6ab hedgewars/hwengine.dpr --- a/hedgewars/hwengine.dpr Wed Oct 25 19:41:14 2006 +0000 +++ b/hedgewars/hwengine.dpr Thu Oct 26 16:08:29 2006 +0000 @@ -199,6 +199,7 @@ /////////////// procedure Game; +var s: shortstring; begin WriteToConsole('Init SDL... '); SDLTry(SDL_Init(SDL_INIT_VIDEO) >= 0, true); @@ -217,6 +218,10 @@ LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); SendIPCAndWaitReply('C'); // ask for game config + +s:= 'eproto ' + inttostr(cNetProtoVersion); +SendIPCRaw(@s[0], Length(s) + 1); // send proto version + InitTeams; if isSoundEnabled then InitSound; @@ -254,7 +259,7 @@ //////////////////////////////////////////////////////////////////////////////// begin -WriteLnToConsole('-= HedgeWars 0.2 =-'); +WriteLnToConsole('-= HedgeWars 0.8 =-'); WriteLnToConsole(' -= by unC0Rr =- '); GetParams; Randomize; diff -r dcdf642459e0 -r 8d9aff55e6ab hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Wed Oct 25 19:41:14 2006 +0000 +++ b/hedgewars/uConsole.pas Thu Oct 26 16:08:29 2006 +0000 @@ -261,6 +261,7 @@ initialization InitConsole; RegisterVariable('quit' , vtCommand, @chQuit , true ); +RegisterVariable('proto' , vtCommand, @chCheckProto , true ); RegisterVariable('capture' , vtCommand, @chCapture , true ); RegisterVariable('addteam' , vtCommand, @chAddTeam , false); RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false);