- Set version to 0.8
authorunc0rr
Thu, 26 Oct 2006 16:08:29 +0000
changeset 205 8d9aff55e6ab
parent 204 dcdf642459e0
child 206 32fa6282efe2
- Set version to 0.8 - Check protocol version to ensure clients compatibility in further versions
CMakeLists.txt
hedgewars/CCHandlers.inc
hedgewars/hwengine.dpr
hedgewars/uConsole.pas
--- 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")
--- 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
--- 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;
--- 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);