Advertisement
Guest User

Build ID

a guest
Aug 7th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.00 KB | None | 0 0
  1. /*==LICENSE==*
  2.  
  3. CyanWorlds.com Engine - MMOG client, server and tools
  4. Copyright (C) 2011  Cyan Worlds, Inc.
  5.  
  6. This program is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. Additional permissions under GNU GPL version 3 section 7
  20.  
  21. If you modify this Program, or any covered work, by linking or
  22. combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
  23. NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
  24. JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
  25. (or a modified version of those libraries),
  26. containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
  27. PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
  28. JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
  29. licensors of this Program grant you additional
  30. permission to convey the resulting work. Corresponding Source for a
  31. non-source form of such a combination shall include the source code for
  32. the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
  33. work.
  34.  
  35. You can contact Cyan Worlds, Inc. by email legal@cyan.com
  36.  or by snail mail at:
  37.       Cyan Worlds, Inc.
  38.       14617 N Newport Hwy
  39.       Mead, WA   99021
  40.  
  41. *==LICENSE==*/
  42. /*****************************************************************************
  43. *
  44. *   $/Plasma20/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrBuildId.cpp
  45. *  
  46. ***/
  47.  
  48. #include "../Pch.h"
  49. #pragma hdrstop
  50.  
  51.  
  52. /*****************************************************************************
  53. *
  54. *   Private definitions
  55. *
  56. ***/
  57.  
  58. #include <iostream>
  59. #include <fstream>
  60.  
  61. // This line must NEVER be modified manually; it is automatically updated
  62. // by the build server.
  63. #define BUILD_ID 1
  64. COMPILER_ASSERT(BUILD_ID != 0);
  65.  
  66.  
  67. /*****************************************************************************
  68. *
  69. *   Private data
  70. *
  71. ***/
  72.  
  73. static unsigned s_buildIdOverride;
  74.  
  75.  
  76. /*****************************************************************************
  77. *
  78. *   Exports
  79. *
  80. ***/
  81.  
  82. //============================================================================
  83. unsigned BuildId () {
  84.     using namespace std;
  85.     double id;
  86.     ifstream file("id.txt");
  87.     while (file.eof() == false)
  88.     {
  89.         file >> id;
  90.     }
  91.     file.close();
  92.     return s_buildIdOverride ? s_buildIdOverride : id;
  93. }
  94.  
  95. //============================================================================
  96. void OverrideBuildId (unsigned buildId) {
  97.     s_buildIdOverride = buildId;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement