mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-09 09:48:20 +00:00
feat: Bump standard to 20 (#1376)
* Bump to 20 * fix warnings and errors * thanks RakNet
This commit is contained in:
parent
85672e060a
commit
1941679d27
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.18)
|
|||||||
project(Darkflame)
|
project(Darkflame)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
set (CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
|
||||||
# Read variables from file
|
# Read variables from file
|
||||||
FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables)
|
FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables)
|
||||||
|
@ -263,7 +263,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Now that the name is ok, we can get an objectID from Master:
|
//Now that the name is ok, we can get an objectID from Master:
|
||||||
ObjectIDManager::Instance()->RequestPersistentID([=](uint32_t objectID) {
|
ObjectIDManager::Instance()->RequestPersistentID([=, this](uint32_t objectID) {
|
||||||
if (Database::Get()->GetCharacterInfo(objectID)) {
|
if (Database::Get()->GetCharacterInfo(objectID)) {
|
||||||
LOG("Character object id unavailable, check object_id_tracker!");
|
LOG("Character object id unavailable, check object_id_tracker!");
|
||||||
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::OBJECT_ID_UNAVAILABLE);
|
WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::OBJECT_ID_UNAVAILABLE);
|
||||||
|
@ -33,7 +33,7 @@ ActivityComponent::ActivityComponent(Entity* parent, int32_t activityID) : Compo
|
|||||||
if (activityID > 0) m_ActivityID = activityID;
|
if (activityID > 0) m_ActivityID = activityID;
|
||||||
else m_ActivityID = parent->GetVar<int32_t>(u"activityID");
|
else m_ActivityID = parent->GetVar<int32_t>(u"activityID");
|
||||||
CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable<CDActivitiesTable>();
|
CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable<CDActivitiesTable>();
|
||||||
std::vector<CDActivities> activities = activitiesTable->Query([=](CDActivities entry) {return (entry.ActivityID == m_ActivityID); });
|
std::vector<CDActivities> activities = activitiesTable->Query([this](CDActivities entry) {return (entry.ActivityID == m_ActivityID); });
|
||||||
|
|
||||||
for (CDActivities activity : activities) {
|
for (CDActivities activity : activities) {
|
||||||
m_ActivityInfo = activity;
|
m_ActivityInfo = activity;
|
||||||
@ -93,7 +93,7 @@ void ActivityComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsIniti
|
|||||||
|
|
||||||
void ActivityComponent::ReloadConfig() {
|
void ActivityComponent::ReloadConfig() {
|
||||||
CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable<CDActivitiesTable>();
|
CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable<CDActivitiesTable>();
|
||||||
std::vector<CDActivities> activities = activitiesTable->Query([=](CDActivities entry) {return (entry.ActivityID == m_ActivityID); });
|
std::vector<CDActivities> activities = activitiesTable->Query([this](CDActivities entry) {return (entry.ActivityID == m_ActivityID); });
|
||||||
for (auto activity : activities) {
|
for (auto activity : activities) {
|
||||||
auto mapID = m_ActivityInfo.instanceMapID;
|
auto mapID = m_ActivityInfo.instanceMapID;
|
||||||
if (static_cast<Leaderboard::Type>(activity.leaderboardType) == Leaderboard::Type::Racing && Game::config->GetValue("solo_racing") == "1") {
|
if (static_cast<Leaderboard::Type>(activity.leaderboardType) == Leaderboard::Type::Racing && Game::config->GetValue("solo_racing") == "1") {
|
||||||
@ -532,7 +532,7 @@ void ActivityInstance::RewardParticipant(Entity* participant) {
|
|||||||
|
|
||||||
// First, get the activity data
|
// First, get the activity data
|
||||||
auto* activityRewardsTable = CDClientManager::Instance().GetTable<CDActivityRewardsTable>();
|
auto* activityRewardsTable = CDClientManager::Instance().GetTable<CDActivityRewardsTable>();
|
||||||
std::vector<CDActivityRewards> activityRewards = activityRewardsTable->Query([=](CDActivityRewards entry) { return (entry.objectTemplate == m_ActivityInfo.ActivityID); });
|
std::vector<CDActivityRewards> activityRewards = activityRewardsTable->Query([this](CDActivityRewards entry) { return (entry.objectTemplate == m_ActivityInfo.ActivityID); });
|
||||||
|
|
||||||
if (!activityRewards.empty()) {
|
if (!activityRewards.empty()) {
|
||||||
uint32_t minCoins = 0;
|
uint32_t minCoins = 0;
|
||||||
|
@ -312,7 +312,7 @@ void RacingControlComponent::OnRequestDie(Entity* player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Respawn the player in 2 seconds, as was done in live. Not sure if this value is in a setting somewhere else...
|
// Respawn the player in 2 seconds, as was done in live. Not sure if this value is in a setting somewhere else...
|
||||||
vehicle->AddCallbackTimer(2.0f, [=]() {
|
vehicle->AddCallbackTimer(2.0f, [=, this]() {
|
||||||
if (!vehicle || !this->m_Parent) return;
|
if (!vehicle || !this->m_Parent) return;
|
||||||
GameMessages::SendRacingResetPlayerToLastReset(
|
GameMessages::SendRacingResetPlayerToLastReset(
|
||||||
m_Parent->GetObjectID(), racingPlayer.playerID,
|
m_Parent->GetObjectID(), racingPlayer.playerID,
|
||||||
|
@ -249,7 +249,7 @@ bool Item::IsEquipped() const {
|
|||||||
bool Item::Consume() {
|
bool Item::Consume() {
|
||||||
auto* skillsTable = CDClientManager::Instance().GetTable<CDObjectSkillsTable>();
|
auto* skillsTable = CDClientManager::Instance().GetTable<CDObjectSkillsTable>();
|
||||||
|
|
||||||
auto skills = skillsTable->Query([=](const CDObjectSkills entry) {
|
auto skills = skillsTable->Query([this](const CDObjectSkills entry) {
|
||||||
return entry.objectTemplate == static_cast<uint32_t>(lot);
|
return entry.objectTemplate == static_cast<uint32_t>(lot);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -51,20 +51,20 @@ Spawner::Spawner(const SpawnerInfo info) {
|
|||||||
std::vector<Spawner*> spawnSmashSpawnersN = Game::zoneManager->GetSpawnersByName(m_Info.spawnOnSmashGroupName);
|
std::vector<Spawner*> spawnSmashSpawnersN = Game::zoneManager->GetSpawnersByName(m_Info.spawnOnSmashGroupName);
|
||||||
for (Entity* ssEntity : spawnSmashEntities) {
|
for (Entity* ssEntity : spawnSmashEntities) {
|
||||||
m_SpawnSmashFoundGroup = true;
|
m_SpawnSmashFoundGroup = true;
|
||||||
ssEntity->AddDieCallback([=]() {
|
ssEntity->AddDieCallback([=, this]() {
|
||||||
Spawn();
|
Spawn();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (Spawner* ssSpawner : spawnSmashSpawners) {
|
for (Spawner* ssSpawner : spawnSmashSpawners) {
|
||||||
m_SpawnSmashFoundGroup = true;
|
m_SpawnSmashFoundGroup = true;
|
||||||
ssSpawner->AddSpawnedEntityDieCallback([=]() {
|
ssSpawner->AddSpawnedEntityDieCallback([=, this]() {
|
||||||
Spawn();
|
Spawn();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
for (Spawner* ssSpawner : spawnSmashSpawnersN) {
|
for (Spawner* ssSpawner : spawnSmashSpawnersN) {
|
||||||
m_SpawnSmashFoundGroup = true;
|
m_SpawnSmashFoundGroup = true;
|
||||||
m_SpawnOnSmash = ssSpawner;
|
m_SpawnOnSmash = ssSpawner;
|
||||||
ssSpawner->AddSpawnedEntityDieCallback([=]() {
|
ssSpawner->AddSpawnedEntityDieCallback([=, this]() {
|
||||||
Spawn();
|
Spawn();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ TEST_F(EncodingTest, TestEncodingHello) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(EncodingTest, TestEncodingUmlaut) {
|
TEST_F(EncodingTest, TestEncodingUmlaut) {
|
||||||
originalWord = u8"Frühling";
|
originalWord = reinterpret_cast<const char*>(u8"Frühling");
|
||||||
originalWordSv = originalWord;
|
originalWordSv = originalWord;
|
||||||
|
|
||||||
GeneralUtils::_NextUTF8Char(originalWordSv, out); EXPECT_EQ(out, U'F');
|
GeneralUtils::_NextUTF8Char(originalWordSv, out); EXPECT_EQ(out, U'F');
|
||||||
|
2
thirdparty/raknet/CMakeLists.txt
vendored
2
thirdparty/raknet/CMakeLists.txt
vendored
@ -80,6 +80,8 @@ target_compile_options(raknet PRIVATE
|
|||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
/w>)
|
/w>)
|
||||||
|
|
||||||
|
set_property(TARGET raknet PROPERTY CXX_STANDARD 17)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# Link Win Sockets 2 to RakNet
|
# Link Win Sockets 2 to RakNet
|
||||||
target_link_libraries(raknet ws2_32)
|
target_link_libraries(raknet ws2_32)
|
||||||
|
Loading…
Reference in New Issue
Block a user