[General]: New versioning system (#944)

This commit is contained in:
Edo 2023-04-19 19:53:29 +02:00 committed by GitHub
parent 70be263918
commit a39febed66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 51 additions and 39 deletions

View File

@ -4,14 +4,36 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.3.0/) and this project adheres to [Semantic Versioning](http://semver.org/). The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.3.0/) and this project adheres to [Semantic Versioning](http://semver.org/).
## r4190 - 2023-04-19
### Added
- Add `LogString` GSC function (#895)
- Add `LogString` GSC method (#895)
- Add `sv_replaceTestClients` Dvar (#930)
### Changed
- `sv_mapRotationCurrent` supports `exec` directive for executing cfg scripts from the `game_settings` folder
### Fixed
- `sv_privatePassword` will work as intended (#908)
### Known issues
- Sound issue fix is experimental as the bug is not fully understood.
## [0.7.9] - 2023-03-31 ## [0.7.9] - 2023-03-31
### Added ### Added
- Game scripts can be loaded from the `scripts/mp`, `scripts/mp/<map name>` and `scripts/mp/<game type>` folders (#859) - Game scripts can be loaded from the `scripts/mp`, `scripts/mp/<map name>` and `scripts/mp/<game type>` folders (#859)
- Add `ReadStream` GSC function (#862) - Add `ReadStream` GSC function (#862)
- Add `IString` GSC function (#877) - Add `IString` GSC function (#877)
### Changed ### Changed
- Test Clients will no longer receive names from the Xlabs Patreon website. The old behaviour was restored (#852) - Test Clients will no longer receive names from the Xlabs Patreon website. The old behaviour was restored (#852)
- Enabled `OpenFile` GSC function (#862) - Enabled `OpenFile` GSC function (#862)
- Enabled `CloseFile` GSC function (#862) - Enabled `CloseFile` GSC function (#862)
@ -20,6 +42,7 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
- `CastFloat` GSC function was renamed to `Float` (#880) - `CastFloat` GSC function was renamed to `Float` (#880)
### Fixed ### Fixed
- Fix bug where knife lounges would not work with a gamepad (#848) - Fix bug where knife lounges would not work with a gamepad (#848)
- Fix rare RCon crash (#861) - Fix rare RCon crash (#861)
- Fix bug where `sv_RandomBotNames` stopped working (#876) - Fix bug where `sv_RandomBotNames` stopped working (#876)
@ -32,6 +55,7 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
## [0.7.8] - 2023-03-17 ## [0.7.8] - 2023-03-17
### Added ### Added
- Clients can unprotect "saved" Dvars using the command line argument `-unprotect-dvars` (#694) - Clients can unprotect "saved" Dvars using the command line argument `-unprotect-dvars` (#694)
- Clients can protect all Dvars from being modified by the server using the command line argument `-protect-dvars` (#823) - Clients can protect all Dvars from being modified by the server using the command line argument `-protect-dvars` (#823)
- Add helpful information to script-related errors (#721) - Add helpful information to script-related errors (#721)
@ -54,6 +78,7 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
- Add new map porting utility tool that makes the map porting process between CoD8 to CoD6 easy - Add new map porting utility tool that makes the map porting process between CoD8 to CoD6 easy
### Changed ### Changed
- Servers can no longer modify client Dvars that are saved in the client's config (#694) - Servers can no longer modify client Dvars that are saved in the client's config (#694)
- `banClient` and `muteClient` server commands do not apply to bots anymore (#730) - `banClient` and `muteClient` server commands do not apply to bots anymore (#730)
- Remove `zb_prefer_disk_assets` Dvar (#772) - Remove `zb_prefer_disk_assets` Dvar (#772)
@ -61,6 +86,7 @@ The format is based on [Keep a Changelog v0.3.0](http://keepachangelog.com/en/0.
- Test Clients will receive names from the Xlabs Patreon website in addition to the names from the bots.txt file (#771) - Test Clients will receive names from the Xlabs Patreon website in addition to the names from the bots.txt file (#771)
### Fixed ### Fixed
- Fix bug where`reloadmenus` command would not free resources used by custom menus (#740) - Fix bug where`reloadmenus` command would not free resources used by custom menus (#740)
- Fix bug where demo playback would stop when opening a laptop based killstreak (#699) - Fix bug where demo playback would stop when opening a laptop based killstreak (#699)
- Fix bug where mod download speed was inexplicably slow (#707) - Fix bug where mod download speed was inexplicably slow (#707)

View File

@ -158,15 +158,11 @@ newaction {
versionHeader:write("#define GIT_DIRTY " .. revDirty .. "\n") versionHeader:write("#define GIT_DIRTY " .. revDirty .. "\n")
versionHeader:write("#define GIT_TAG " .. cstrquote(tagName) .. "\n") versionHeader:write("#define GIT_TAG " .. cstrquote(tagName) .. "\n")
versionHeader:write("\n") versionHeader:write("\n")
versionHeader:write("// Legacy definitions (needed for update check)\n") versionHeader:write("// New revision definition. Will be used from now on\n")
versionHeader:write("#define REVISION " .. revNumber .. "\n") versionHeader:write("#define REVISION " .. revNumber .. "\n")
versionHeader:write("\n") versionHeader:write("\n")
versionHeader:write("// Version transformed for RC files\n")
versionHeader:write("#define VERSION_RC " .. table.concat(vertonumarr(tagName, revNumber), ",") .. "\n")
versionHeader:write("\n")
versionHeader:write("// Alias definitions\n") versionHeader:write("// Alias definitions\n")
versionHeader:write("#define VERSION GIT_DESCRIBE\n") versionHeader:write("#define VERSION GIT_DESCRIBE\n")
versionHeader:write("#define SHORTVERSION " .. cstrquote(table.concat(vertonumarr(tagName, revNumber), ".")) .. "\n")
versionHeader:close() versionHeader:close()
local versionHeader = assert(io.open(wks.location .. "/src/version.hpp", "w")) local versionHeader = assert(io.open(wks.location .. "/src/version.hpp", "w"))
versionHeader:write("/*\n") versionHeader:write("/*\n")

View File

@ -48,16 +48,14 @@ namespace Components
const char* Branding::GetBuildNumber() const char* Branding::GetBuildNumber()
{ {
return SHORTVERSION " latest " __DATE__ " " __TIME__; return VERSION " latest " __DATE__ " " __TIME__;
} }
const char* Branding::GetVersionString() const char* Branding::GetVersionString()
{ {
// IW4x is technically a beta // IW4x is technically a beta
const auto* result = Utils::String::VA("%s %s build %s %s", return Utils::String::VA("%s %s build %s %s",
BUILD_TYPE, "(Beta)", Branding::GetBuildNumber(), reinterpret_cast<const char*>(0x7170A0)); BUILD_TYPE, "(Beta)", Branding::GetBuildNumber(), reinterpret_cast<const char*>(0x7170A0));
return result;
} }
void Branding::Dvar_SetVersionString(const Game::dvar_t* dvar, [[maybe_unused]] const char* value) void Branding::Dvar_SetVersionString(const Game::dvar_t* dvar, [[maybe_unused]] const char* value)
@ -100,14 +98,14 @@ namespace Components
Branding::RegisterBrandingDvars(); Branding::RegisterBrandingDvars();
// UI version string // UI version string
Utils::Hook::Set<const char*>(0x43F73B, "IW4x: " VERSION); Utils::Hook::Set<const char*>(0x43F73B, "IW4x - " GIT_TAG);
// Short version dvar // Short version dvar
Utils::Hook::Set<const char*>(0x60BD91, SHORTVERSION); Utils::Hook::Set<const char*>(0x60BD91, GIT_TAG);
// Com_Init_Try_Block_Function // Com_Init_Try_Block_Function
Utils::Hook::Set<const char*>(0x60BAF4, BUILD_TYPE); Utils::Hook::Set<const char*>(0x60BAF4, BUILD_TYPE);
Utils::Hook::Set<const char*>(0x60BAEf, SHORTVERSION); Utils::Hook::Set<const char*>(0x60BAEf, GIT_TAG);
Utils::Hook::Set<const char*>(0x60BAE5, __DATE__); Utils::Hook::Set<const char*>(0x60BAE5, __DATE__);
// G_InitGame // G_InitGame
@ -132,15 +130,15 @@ namespace Components
// Console title // Console title
if (ZoneBuilder::IsEnabled()) if (ZoneBuilder::IsEnabled())
{ {
Utils::Hook::Set<const char*>(0x4289E8, "IW4x (" VERSION "): ZoneBuilder"); Utils::Hook::Set<const char*>(0x4289E8, "IW4x (" GIT_TAG "): ZoneBuilder");
} }
else if (Dedicated::IsEnabled()) else if (Dedicated::IsEnabled())
{ {
Utils::Hook::Set<const char*>(0x4289E8, "IW4x (" VERSION "): Dedicated"); Utils::Hook::Set<const char*>(0x4289E8, "IW4x (" GIT_TAG "): Dedicated");
} }
else else
{ {
Utils::Hook::Set<const char*>(0x4289E8, "IW4x (" VERSION "): Console"); Utils::Hook::Set<const char*>(0x4289E8, "IW4x (" GIT_TAG "): Console");
} }
} }
} }

View File

@ -96,14 +96,14 @@ namespace Components
} }
else if (IsWindow(GetWindow()) != FALSE) else if (IsWindow(GetWindow()) != FALSE)
{ {
SetWindowTextA(GetWindow(), Utils::String::VA("IW4x(" VERSION ") : %s", hostname.data())); SetWindowTextA(GetWindow(), Utils::String::VA("IW4x(" GIT_TAG ") : %s", hostname.data()));
} }
} }
void Console::ShowPrompt() void Console::ShowPrompt()
{ {
wattron(InputWindow, COLOR_PAIR(10) | A_BOLD); wattron(InputWindow, COLOR_PAIR(10) | A_BOLD);
wprintw(InputWindow, "%s> ", VERSION); wprintw(InputWindow, "%s> ", GIT_TAG);
} }
void Console::RefreshOutput() void Console::RefreshOutput()
@ -860,7 +860,7 @@ namespace Components
AssertOffset(Game::clientUIActive_t, keyCatchers, 0x9B0); AssertOffset(Game::clientUIActive_t, keyCatchers, 0x9B0);
// Console '%s: %s> ' string // Console '%s: %s> ' string
Utils::Hook::Set<const char*>(0x5A44B4, "IW4x MP: " VERSION "> "); Utils::Hook::Set<const char*>(0x5A44B4, "IW4x_MP: " GIT_TAG "> ");
// Patch console color // Patch console color
static float consoleColor[] = { 0.70f, 1.00f, 0.00f, 1.00f }; static float consoleColor[] = { 0.70f, 1.00f, 0.00f, 1.00f };

View File

@ -2,8 +2,6 @@
#include "Changelog.hpp" #include "Changelog.hpp"
#include "News.hpp" #include "News.hpp"
#include <version.hpp>
#define NEWS_MOTD_DEFAULT "Welcome to IW4x Multiplayer!" #define NEWS_MOTD_DEFAULT "Welcome to IW4x Multiplayer!"
namespace Components namespace Components

View File

@ -386,7 +386,7 @@ namespace Components
info.set("bots", std::to_string(botCount)); info.set("bots", std::to_string(botCount));
info.set("sv_maxclients", std::to_string(maxClientCount)); info.set("sv_maxclients", std::to_string(maxClientCount));
info.set("protocol", std::to_string(PROTOCOL)); info.set("protocol", std::to_string(PROTOCOL));
info.set("shortversion", SHORTVERSION); info.set("version", GIT_TAG);
info.set("checksum", std::to_string(Game::Sys_Milliseconds())); info.set("checksum", std::to_string(Game::Sys_Milliseconds()));
info.set("mapname", Dvar::Var("mapname").get<std::string>()); info.set("mapname", Dvar::Var("mapname").get<std::string>());
info.set("isPrivate", *password ? "1" : "0"); info.set("isPrivate", *password ? "1" : "0");

View File

@ -149,7 +149,7 @@ namespace Components
info.set("gamename", "IW4"); info.set("gamename", "IW4");
info.set("sv_maxclients", std::to_string(maxClientCount)); info.set("sv_maxclients", std::to_string(maxClientCount));
info.set("protocol", std::to_string(PROTOCOL)); info.set("protocol", std::to_string(PROTOCOL));
info.set("shortversion", SHORTVERSION); info.set("version", GIT_TAG);
info.set("version", (*Game::version)->current.string); info.set("version", (*Game::version)->current.string);
info.set("mapname", (*Game::sv_mapname)->current.string); info.set("mapname", (*Game::sv_mapname)->current.string);
info.set("isPrivate", *password ? "1" : "0"); info.set("isPrivate", *password ? "1" : "0");

View File

@ -9,8 +9,6 @@
#include "Toast.hpp" #include "Toast.hpp"
#include "UIFeeder.hpp" #include "UIFeeder.hpp"
#include <version.hpp>
namespace Components namespace Components
{ {
bool ServerList::SortAsc = true; bool ServerList::SortAsc = true;
@ -587,11 +585,7 @@ namespace Components
} }
} }
if (info.get("gamename") == "IW4"s && server.matchType if (info.get("gamename") == "IW4"s && server.matchType)
#if !defined(DEBUG) && defined(VERSION_FILTER)
&& CompareVersion(server.shortversion, SHORTVERSION)
#endif
)
{ {
auto* lList = GetList(); auto* lList = GetList();
if (lList) if (lList)

View File

@ -18,7 +18,7 @@ namespace Components
if (Flags::HasFlag("version")) if (Flags::HasFlag("version"))
{ {
printf("%s", "IW4x " VERSION " (built " __DATE__ " " __TIME__ ")\n"); printf("%s", "IW4x " VERSION " (built " __DATE__ " " __TIME__ ")\n");
printf("%d\n", REVISION); printf("Revision: %i\n", REVISION);
ExitProcess(EXIT_SUCCESS); ExitProcess(EXIT_SUCCESS);
} }

View File

@ -978,7 +978,7 @@ namespace Components
} }
Logger::Print(" --------------------------------------------------------------------------------\n"); Logger::Print(" --------------------------------------------------------------------------------\n");
Logger::Print(" IW4x ZoneBuilder ({})\n", VERSION); Logger::Print(" IW4x ZoneBuilder - {}\n", VERSION);
Logger::Print(" Commands:\n"); Logger::Print(" Commands:\n");
Logger::Print("\t-buildzone [zone]: builds a zone from a csv located in zone_source\n"); Logger::Print("\t-buildzone [zone]: builds a zone from a csv located in zone_source\n");
Logger::Print("\t-buildall: builds all zones in zone_source\n"); Logger::Print("\t-buildall: builds all zones in zone_source\n");

View File

@ -10,7 +10,7 @@
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "windows.h" #include "Windows.h"
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
@ -29,7 +29,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
1 TEXTINCLUDE 1 TEXTINCLUDE
BEGIN BEGIN
"#include ""windows.h""\r\n" "#include ""Windows.h""\r\n"
"\0" "\0"
END END
@ -47,8 +47,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_RC FILEVERSION 1,0,0,0
PRODUCTVERSION VERSION_RC PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -63,18 +63,18 @@ BEGIN
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", "IW4x" VALUE "CompanyName", "XLabsProject"
#ifdef _DEBUG #ifdef _DEBUG
VALUE "FileDescription", "IW4 client modification (DEBUG)" VALUE "FileDescription", "IW4 client modification (DEBUG)"
#else #else
VALUE "FileDescription", "IW4 client modification" VALUE "FileDescription", "IW4 client modification"
#endif #endif
VALUE "FileVersion", SHORTVERSION VALUE "FileVersion", GIT_TAG
VALUE "InternalName", "iw4x" VALUE "InternalName", "iw4x"
VALUE "LegalCopyright", "Copyright 2022 The IW4x Team. All rights reserved." VALUE "LegalCopyright", "Copyright 2023 The XLabsProject Team. All rights reserved."
VALUE "OriginalFilename", "iw4x.dll" VALUE "OriginalFilename", "iw4x.dll"
VALUE "ProductName", "IW4x" VALUE "ProductName", "IW4x"
VALUE "ProductVersion", SHORTVERSION VALUE "ProductVersion", GIT_TAG
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"