Merge pull request #2371 from HarbourMasters/develop-bradley

brad -> dev
This commit is contained in:
briaguya 2023-01-19 04:31:34 -05:00 committed by GitHub
commit 52b182d4dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
project(Ship LANGUAGES C CXX
VERSION 5.1.3)
set(PROJECT_BUILD_NAME "BRADLEY DELTA" CACHE STRING "")
VERSION 5.1.4)
set(PROJECT_BUILD_NAME "BRADLEY ECHO" CACHE STRING "")
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)

View File

@ -101,7 +101,7 @@ void CrowdControl::Disable() {
void CrowdControl::ListenToServer() {
while (isEnabled) {
while (!connected) {
while (!connected && isEnabled) {
SPDLOG_TRACE("[CrowdControl] Attempting to make connection to server...");
tcpsock = SDLNet_TCP_Open(&ip);
@ -112,8 +112,10 @@ void CrowdControl::ListenToServer() {
}
}
auto socketSet = SDLNet_AllocSocketSet(1);
SDLNet_TCP_AddSocket(socketSet, tcpsock);
SDLNet_SocketSet socketSet = SDLNet_AllocSocketSet(1);
if (tcpsock) {
SDLNet_TCP_AddSocket(socketSet, tcpsock);
}
// Listen to socket messages
while (connected && tcpsock && isEnabled) {

View File

@ -498,6 +498,11 @@ extern "C" void InitOTR() {
#ifdef ENABLE_CROWD_CONTROL
CrowdControl::Instance = new CrowdControl();
CrowdControl::Instance->Init();
if (CVar_GetS32("gCrowdControl", 0)) {
CrowdControl::Instance->Enable();
} else {
CrowdControl::Instance->Disable();
}
#endif
}