Merge remote-tracking branch 'origin/semver' into 88-semantic-versioning

This commit is contained in:
/dev/urandom
2016-09-03 19:12:32 +02:00
10 changed files with 90 additions and 71 deletions

View File

@ -77,14 +77,14 @@ namespace Components
}
else if(IsWindow(*reinterpret_cast<HWND*>(0x64A3288)) != FALSE)
{
SetWindowTextA(*reinterpret_cast<HWND*>(0x64A3288), Utils::String::VA("IW4x(r" REVISION_STR REVISION_SUFFIX ") : %s", hostname.data()));
SetWindowTextA(*reinterpret_cast<HWND*>(0x64A3288), Utils::String::VA("IW4x(" VERSION ") : %s", hostname.data()));
}
}
void Console::ShowPrompt()
{
wattron(Console::InputWindow, COLOR_PAIR(10) | A_BOLD);
wprintw(Console::InputWindow, "%s> ", VERSION_STR);
wprintw(Console::InputWindow, "%s> ", VERSION);
}
void Console::RefreshOutput()
@ -486,7 +486,7 @@ namespace Components
Console::Console()
{
// Console '%s: %s> ' string
Utils::Hook::Set<char*>(0x5A44B4, "IW4x: r" REVISION_STR "> ");
Utils::Hook::Set<char*>(0x5A44B4, "IW4x: " VERSION "> ");
// Internal console
Utils::Hook(0x4F690C, Console::ToggleConsole, HOOK_CALL).Install()->Quick();

View File

@ -204,7 +204,7 @@ namespace Components
// Combine with queuedMinidumpsFolder
char filename[MAX_PATH];
PathCombineA(filename, MinidumpUpload::queuedMinidumpsFolder.data(), Utils::String::VA("%s-" VERSION_STR "-%s.dmp", exeFileName, filenameFriendlyTime));
PathCombineA(filename, MinidumpUpload::queuedMinidumpsFolder.data(), Utils::String::VA("%s-" VERSION "-%s.dmp", exeFileName, filenameFriendlyTime));
// Generate the dump
return Minidump::Create(filename, exceptionInfo, minidumpType);
@ -372,7 +372,7 @@ namespace Components
if (extraHeaders.find("Encoding") == extraHeaders.end())
extraHeaders["Encoding"] = "raw";
extraHeaders["Version"] = VERSION_STR;
extraHeaders["Version"] = VERSION;
output << "-----BEGIN " << marker << "-----\n";

View File

@ -309,7 +309,7 @@ namespace Components
info.Set("clients", fmt::sprintf("%i", clientCount));
info.Set("sv_maxclients", fmt::sprintf("%i", maxclientCount));
info.Set("protocol", fmt::sprintf("%i", PROTOCOL));
info.Set("shortversion", VERSION_STR);
info.Set("shortversion", SHORTVERSION);
info.Set("checksum", fmt::sprintf("%d", Game::Sys_Milliseconds()));
info.Set("mapname", Dvar::Var("mapname").Get<const char*>());
info.Set("isPrivate", (Dvar::Var("g_password").Get<std::string>().size() ? "1" : "0"));

View File

@ -173,26 +173,26 @@ namespace Components
Utils::Hook::Set<char*>(0x6431D1, BASEGAME);
// UI version string
Utils::Hook::Set<char*>(0x43F73B, "IW4x: r" REVISION_STR REVISION_SUFFIX "-" MILESTONE);
Utils::Hook::Set<char*>(0x43F73B, "IW4x: " VERSION);
// console version string
Utils::Hook::Set<char*>(0x4B12BB, "IW4x r" REVISION_STR REVISION_SUFFIX "-" MILESTONE " (built " __DATE__ " " __TIME__ ")");
Utils::Hook::Set<char*>(0x4B12BB, "IW4x " VERSION " (built " __DATE__ " " __TIME__ ")");
// version string
Utils::Hook::Set<char*>(0x60BD56, "IW4x (r" REVISION_STR REVISION_SUFFIX ")");
Utils::Hook::Set<char*>(0x60BD56, "IW4x (" VERSION ")");
// console title
if (ZoneBuilder::IsEnabled())
{
Utils::Hook::Set<char*>(0x4289E8, "IW4x (r" REVISION_STR REVISION_SUFFIX "): ZoneBuilder");
Utils::Hook::Set<char*>(0x4289E8, "IW4x (" VERSION "): ZoneBuilder");
}
else if (Dedicated::IsEnabled())
{
Utils::Hook::Set<char*>(0x4289E8, "IW4x (r" REVISION_STR REVISION_SUFFIX "): Dedicated");
Utils::Hook::Set<char*>(0x4289E8, "IW4x (r" VERSION "): Dedicated");
}
else
{
Utils::Hook::Set<char*>(0x4289E8, "IW4x (r" REVISION_STR REVISION_SUFFIX "): Console");
Utils::Hook::Set<char*>(0x4289E8, "IW4x (r" VERSION "): Console");
}
// window title
@ -202,7 +202,7 @@ namespace Components
Utils::Hook::Set<char*>(0x4D378B, "IW4Host");
// shortversion
Utils::Hook::Set<char*>(0x60BD91, VERSION_STR);
Utils::Hook::Set<char*>(0x60BD91, SHORTVERSION);
// console logo
Utils::Hook::Set<char*>(0x428A66, BASEGAME "/images/logo.bmp");

View File

@ -115,7 +115,7 @@ namespace Components
info.Set("gamename", "IW4");
info.Set("sv_maxclients", fmt::sprintf("%i", maxclientCount));
info.Set("protocol", fmt::sprintf("%i", PROTOCOL));
info.Set("shortversion", VERSION_STR);
info.Set("shortversion", SHORTVERSION);
info.Set("mapname", Dvar::Var("mapname").Get<const char*>());
info.Set("isPrivate", (Dvar::Var("g_password").Get<std::string>().empty() ? "0" : "1"));
info.Set("checksum", fmt::sprintf("%X", Utils::Cryptography::JenkinsOneAtATime::Compute(fmt::sprintf("%u", Game::Sys_Milliseconds()))));

View File

@ -449,7 +449,7 @@ namespace Components
if (info.Get("gamename") == "IW4"
&& server.MatchType
#ifndef DEBUG
&& server.Shortversion == VERSION_STR
&& server.Shortversion == SHORTVERSION
#endif
)
{

View File

@ -13,7 +13,7 @@ namespace Components
{
if (Flags::HasFlag("version"))
{
printf("IW4x r" REVISION_STR "-" MILESTONE " (built " __DATE__ " " __TIME__ ")\n");
printf("IW4x " VERSION " (built " __DATE__ " " __TIME__ ")\n");
ExitProcess(0);
}

View File

@ -2,7 +2,6 @@
//
#pragma code_page(65001)
#define RESOURCE_DATA
#include "STDInclude.hpp"
#define APSTUDIO_READONLY_SYMBOLS
@ -47,8 +46,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION
PRODUCTVERSION VERSION
FILEVERSION VERSION_RC
PRODUCTVERSION VERSION_RC
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +68,12 @@ BEGIN
#else
VALUE "FileDescription", "IW4 client modification"
#endif
VALUE "FileVersion", VERSION_STR
VALUE "FileVersion", SHORTVERSION
VALUE "InternalName", "iw4x"
VALUE "LegalCopyright", "No rights reserved."
VALUE "OriginalFilename", "iw4x.dll"
VALUE "ProductName", "IW4x"
VALUE "ProductVersion", VERSION_STR
VALUE "ProductVersion", SHORTVERSION
END
END
BLOCK "VarFileInfo"

View File

@ -1,9 +1,9 @@
#pragma once
// Version number
#include <version.hpp>
#include "version.h"
#ifndef RESOURCE_DATA
#ifndef RC_INVOKED
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN
@ -120,22 +120,12 @@ using namespace std::literals;
#endif
// Revision number
#define STRINGIZE_(x) #x
#define STRINGIZE(x) STRINGIZE_(x)
#define BASEGAME "iw4x"
#define CLIENT_CONFIG "iw4x_config.cfg"
#define REVISION_STR STRINGIZE(REVISION)
#if !REVISION_CLEAN
#define REVISION_SUFFIX "*"
#else
#define REVISION_SUFFIX ""
#endif
#define VERSION 4,2,REVISION
#define VERSION_STR "4.2." REVISION_STR
#define Assert_Size(x, size) static_assert(sizeof(x) == size, STRINGIZE(x) " structure has an invalid size.")
// Resource stuff