Skip to content

Commit e5ec4fd

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/clothing-cache-time
2 parents 4c8e92b + 4ce24be commit e5ec4fd

File tree

1,127 files changed

+113356
-107646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,127 files changed

+113356
-107646
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
macOS:
5454
name: macOS
55-
runs-on: macOS-13
55+
runs-on: macOS-15
5656
steps:
5757
- uses: actions/checkout@v4
5858

@@ -64,7 +64,7 @@ jobs:
6464
run: brew link --overwrite mysql
6565

6666
- name: Run Build
67-
run: ./linux-build.sh --os=macosx
67+
run: ./linux-build.sh
6868

6969
linux:
7070
strategy:
@@ -78,4 +78,4 @@ jobs:
7878
- uses: actions/checkout@v4
7979

8080
- name: Run Build
81-
run: ./linux-build.sh --arch=${{ matrix.architecture }}
81+
run: /docker-entrypoint.sh --arch=${{ matrix.architecture }}

Client/cefweb/CWebCore.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,15 @@ void CWebCore::OnPostScreenshot()
479479
}
480480
}
481481

482+
void CWebCore::OnFPSLimitChange(std::uint16_t fps)
483+
{
484+
dassert(g_pCore->GetNetwork() != nullptr); // Ensure network module is loaded
485+
for (auto& webView : m_WebViews)
486+
{
487+
webView->GetCefBrowser()->GetHost()->SetWindowlessFrameRate(fps);
488+
}
489+
}
490+
482491
void CWebCore::ProcessInputMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
483492
{
484493
if (!m_pFocusedWebView ||
@@ -502,7 +511,7 @@ void CWebCore::ProcessInputMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
502511
if ((keyEvent.type == KEYEVENT_CHAR) && isKeyDown(VK_RMENU))
503512
{
504513
HKL current_layout = ::GetKeyboardLayout(0);
505-
SHORT scan_res = ::VkKeyScanExW(wParam, current_layout);
514+
SHORT scan_res = ::VkKeyScanExW(static_cast<WCHAR>(wParam), current_layout);
506515
if ((HIBYTE(scan_res) & (2 | 4)) == (2 | 4))
507516
{
508517
keyEvent.modifiers &= ~(EVENTFLAG_CONTROL_DOWN | EVENTFLAG_ALT_DOWN);

Client/cefweb/CWebCore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ class CWebCore : public CWebCoreInterface
9696
void OnPreScreenshot();
9797
void OnPostScreenshot();
9898

99+
void OnFPSLimitChange(std::uint16_t fps) override;
100+
99101
bool SetGlobalAudioVolume(float fVolume);
100102

101103
bool UpdateListsFromMaster();

Client/cefweb/CWebView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void CWebView::Initialise()
5454
{
5555
// Initialise the web session (which holds the actual settings) in in-memory mode
5656
CefBrowserSettings browserSettings;
57-
browserSettings.windowless_frame_rate = g_pCore->GetFrameRateLimit();
57+
browserSettings.windowless_frame_rate = g_pCore->GetFPSLimiter()->GetFPSTarget();
5858
browserSettings.javascript_access_clipboard = cef_state_t::STATE_DISABLED;
5959
browserSettings.javascript_dom_paste = cef_state_t::STATE_DISABLED;
6060
browserSettings.webgl = cef_state_t::STATE_ENABLED;

Client/cefweb/premake5.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ project "Client Webbrowser"
66

77
filter "system:windows"
88
includedirs { "../../vendor/sparsehash/src/windows" }
9-
linkoptions { "/SAFESEH:NO" }
109
buildoptions { "-Zm130" }
1110

1211
filter {}

Client/core/CAdditionalVertexStreamManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,13 @@ SAdditionalStreamInfo* CAdditionalVertexStreamManager::CreateAdditionalStreamInf
466466
declNew->Usage = D3DDECLUSAGE_NORMAL;
467467
declNew->UsageIndex = 0;
468468
if (FAILED(m_pDevice->CreateVertexDeclaration(elements, &info.pVertexDeclaration)))
469-
return false;
469+
return nullptr;
470470

471471
// Create new stream
472472
info.Stride = sizeof(float) * 3;
473473
UINT Size2 = ConvertPTSize(state.decl.VertexBufferDesc1.Size);
474474
if (FAILED(m_pDevice->CreateVertexBuffer(Size2, D3DUSAGE_WRITEONLY, 0, D3DPOOL_MANAGED, &info.pStreamData, NULL)))
475-
return false;
475+
return nullptr;
476476

477477
// Save info
478478
MapSet(m_AdditionalStreamInfoMap, state.stream1.pStreamData, info);

Client/core/CChat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ bool CChat::CharacterKeyHandler(CGUIKeyEventArgs KeyboardArgs)
737737
{
738738
// Check size if it's ok, then output
739739
SString strOutput = strCurrentInput.replace(iFound, std::string::npos, strPlayerName);
740-
if (MbUTF8ToUTF16(strOutput).size() < m_iCharacterLimit)
740+
if (MbUTF8ToUTF16(strOutput).size() < static_cast<size_t>(m_iCharacterLimit))
741741
{
742742
bSuccess = true;
743743
m_strLastPlayerNamePart = strPlayerNamePart;
@@ -802,7 +802,7 @@ bool CChat::CharacterKeyHandler(CGUIKeyEventArgs KeyboardArgs)
802802
}
803803

804804
// If we haven't exceeded the maximum number of characters per chat message, append the char to the message and update the input control
805-
if (MbUTF8ToUTF16(m_strInputText).size() < m_iCharacterLimit)
805+
if (MbUTF8ToUTF16(m_strInputText).size() < static_cast<size_t>(m_iCharacterLimit))
806806
{
807807
if (KeyboardArgs.codepoint >= 32)
808808
{

Client/core/CClientVariables.cpp

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ bool CClientVariables::Get(const std::string& strVariable, CColor& val)
106106
try
107107
{
108108
ss >> iR >> iG >> iB >> iA;
109-
val.R = iR;
110-
val.G = iG;
111-
val.B = iB;
112-
val.A = iA;
109+
val.R = static_cast<unsigned char>(iR);
110+
val.G = static_cast<unsigned char>(iG);
111+
val.B = static_cast<unsigned char>(iB);
112+
val.A = static_cast<unsigned char>(iA);
113113
}
114114
catch (...)
115115
{
@@ -234,7 +234,15 @@ void CClientVariables::ValidateValues()
234234

235235
ClampValue("console_pos", CVector2D(0, 0), CVector2D(uiViewportWidth - 32, uiViewportHeight - 32));
236236
ClampValue("console_size", CVector2D(50, 50), CVector2D(uiViewportWidth - 32, uiViewportHeight - 32));
237-
ClampValue("fps_limit", 0, std::numeric_limits<short>::max());
237+
238+
// CVars need a better API for this (Issue #4427)
239+
int temp;
240+
CVARS_GET("fps_limit", temp);
241+
std::uint16_t fps = static_cast<std::uint16_t>(temp);
242+
FPSLimits::IsValidAndSetValid(fps, fps);
243+
CVARS_SET("fps_limit", fps);
244+
245+
238246
ClampValue("chat_font", 0, 3);
239247
ClampValue("chat_lines", 3, 62);
240248
ClampValue("chat_color", CColor(0, 0, 0, 0), CColor(255, 255, 255, 255));
@@ -261,9 +269,10 @@ void CClientVariables::ValidateValues()
261269

262270
void CClientVariables::LoadDefaults()
263271
{
264-
#define DEFAULT(__x,__y) if(!Exists(__x)) \
265-
Set(__x,__y)
266-
#define _S(__x) std::string(__x)
272+
#define DEFAULT(__x, __y) \
273+
if (!Exists(__x)) \
274+
Set(__x, __y)
275+
#define _S(__x) std::string(__x)
267276

268277
if (!Exists("nick"))
269278
{
@@ -279,6 +288,7 @@ void CClientVariables::LoadDefaults()
279288
DEFAULT("console_size", CVector2D(200, 200)); // console size
280289
DEFAULT("serverbrowser_size", CVector2D(720.0f, 495.0f)); // serverbrowser size
281290
DEFAULT("fps_limit", 100); // frame limiter
291+
DEFAULT("vsync", true); // vsync
282292
DEFAULT("chat_font", 2); // chatbox font type
283293
DEFAULT("chat_lines", 10); // chatbox lines
284294
DEFAULT("chat_color", CColor(0, 0, 0, 0)); // chatbox background color
@@ -379,4 +389,8 @@ void CClientVariables::LoadDefaults()
379389
#if 0
380390
DEFAULT ( "streaming_memory", 50 ); // Streaming memory
381391
#endif
392+
393+
#undef DEFAULT
394+
#undef _S
395+
382396
}

Client/core/CCommandFuncs.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ void CCommandFuncs::Reconnect(const char* szParameters)
318318
// Start the connect
319319
if (CCore::GetSingleton().GetConnectManager()->Reconnect(strHost.c_str(), usPort, strPassword.c_str(), false))
320320
{
321+
if (CCore::GetSingleton().GetConnectManager()->WasQuickConnect())
322+
{
323+
CCore::GetSingleton().GetConnectManager()->SetQuickConnect(false);
324+
}
321325
CCore::GetSingleton().GetConsole()->Printf(_("reconnect: Reconnecting to %s:%u..."), strHost.c_str(), usPort);
322326
}
323327
else
@@ -476,7 +480,8 @@ void CCommandFuncs::FakeLag(const char* szCmdLine)
476480
if (parts.size() > 3)
477481
iKBPSLimit = atoi(parts[3]);
478482

479-
g_pCore->GetNetwork()->SetFakeLag(iPacketLoss, iExtraPing, iExtraPingVary, iKBPSLimit);
483+
g_pCore->GetNetwork()->SetFakeLag(static_cast<unsigned short>(iPacketLoss), static_cast<unsigned short>(iExtraPing),
484+
static_cast<unsigned short>(iExtraPingVary), iKBPSLimit);
480485
g_pCore->GetConsole()->Print(SString("Client send lag is now: %d%% packet loss and %d extra ping with %d extra ping variance and %d KBPS limit",
481486
iPacketLoss, iExtraPing, iExtraPingVary, iKBPSLimit));
482487
}

Client/core/CCommands.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
8585
{
8686
// Copy szParametersIn so the contents can be changed
8787
char* szParameters = NULL;
88+
char empyParameters[1] = {0};
8889
if (szParametersIn)
8990
{
9091
size_t sizeParameters = strlen(szParametersIn) + 1;
@@ -115,7 +116,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
115116
}
116117
if (szParameters == NULL)
117118
{
118-
szParameters = "";
119+
szParameters = empyParameters;
119120
}
120121
}
121122
}
@@ -171,10 +172,19 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
171172
CVARS_SET(key, val);
172173

173174
// HACK: recalculate frame rate limit on cvar change
174-
if (key == "fps_limit" && m_FpsLimitTimer.Get() >= 500 && CCore::GetSingleton().IsConnected())
175+
if (key == "fps_limit")
175176
{
176-
CCore::GetSingleton().RecalculateFrameRateLimit(-1, true);
177-
m_FpsLimitTimer.Reset();
177+
int fpsVal = 0;
178+
CVARS_GET("fps_limit", fpsVal);
179+
CCore::GetSingleton().GetFPSLimiter()->SetUserDefinedFPS(fpsVal);
180+
}
181+
182+
// HACK: Foul dirty hack to force vsync (Rework on #4427)
183+
if (key == "vsync")
184+
{
185+
bool vSync;
186+
CVARS_GET("vsync", vSync);
187+
CCore::GetSingleton().GetFPSLimiter()->SetDisplayVSync(vSync);
178188
}
179189
}
180190
else

0 commit comments

Comments
 (0)