Author Topic: hak version control  (Read 326 times)

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
hak version control
« on: April 01, 2015, 12:37:35 pm »


               I devised a simple method for ensuring that players are using the right version of my haks.
 
Each hak contains a uniquely-named custom 2da file, containing one row with one field - the hak version number.
 
It's checked OnClientEnter:
 
 

float  fHakMain    = 0.01;
float  fHakTile    = 0.01;
string sHakMain    = Get2DAString("_main_version", "Version", 0);
string sHakTile    = Get2DAString("_tile_version", "Version", 0);
 
if ((StringToFloat(sHakMain)  < fHakMain)
  ||  (StringToFloat(sHakTile)  < fHakTile))
    PopUpDeathGUIPanel(oPC, FALSE, FALSE, 0,
      "Fatal error : dark_energy.hak version " + sHakMain
      + " dark_energy_tile.hak version " + sHakTile
      + " are out-of-date. Please download the latest versions from proleric.com");
 
It occurs to me that this would be a useful feature to have in CEP and other commonly-used systems, on a forward basis.
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
hak version control
« Reply #1 on: April 01, 2015, 02:11:21 pm »


               

I think that's a good idea. You might want to clean up the error message so that is lists specifically those which are out of date though. What you have will report that both are out of date even if only one is which will likely be frustrating for users, espcecially when there are more than just two haks involved...


               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
hak version control
« Reply #2 on: April 02, 2015, 12:24:33 am »


               

I am guessing that this works only for single player.   


               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
hak version control
« Reply #3 on: April 02, 2015, 01:42:05 am »


               


I am guessing that this works only for single player.   




What makes you say that?  Umm... nevermind.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
hak version control
« Reply #4 on: April 02, 2015, 06:49:25 am »


               I don't know much about MP, but why wouldn't it work?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
hak version control
« Reply #5 on: April 02, 2015, 07:00:39 am »


               

Get2DAString() would return the server's hak/tile version, not the client's.