mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
Merge branch 'testing' into clang-profile-build
This commit is contained in:
@@ -35,10 +35,8 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/CommoditiesServer.profdata)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shared
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shared
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedCompression/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedDebug/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedFile/include/public
|
||||
|
||||
@@ -36,15 +36,13 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/ConnectionServer.profdata)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shared
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shared
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedCompression/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedDebug/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedDebug/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedFile/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedFoundation/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedFoundationTypes/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedFoundation/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedFoundationTypes/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedGame/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedLog/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedMath/include/public
|
||||
@@ -60,7 +58,7 @@ include_directories(
|
||||
${SWG_ENGINE_SOURCE_DIR}/server/library/serverMetrics/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/server/library/serverNetworkMessages/include/public
|
||||
${SWG_ENGINE_SOURCE_DIR}/server/library/serverUtility/include/public
|
||||
${SWG_EXTERNALS_SOURCE_DIR}/ours/library/archive/include
|
||||
${SWG_EXTERNALS_SOURCE_DIR}/ours/library/archive/include
|
||||
${SWG_EXTERNALS_SOURCE_DIR}/ours/library/localization/include
|
||||
${SWG_EXTERNALS_SOURCE_DIR}/ours/library/localizationArchive/include/public
|
||||
${SWG_EXTERNALS_SOURCE_DIR}/ours/library/singleton/include
|
||||
|
||||
@@ -88,7 +88,7 @@ void ConfigConnectionServer::install(void)
|
||||
KEY_INT (lagReportThreshold, 10000);
|
||||
KEY_INT (defaultGameFeatures, 0xFFFFFFFF);
|
||||
KEY_INT (defaultSubscriptionFeatures, 0xFFFFFFFF);
|
||||
KEY_INT (maxConnectionsPerIP, 0);
|
||||
KEY_INT (maxConnectionsPerIP, 6);
|
||||
|
||||
KEY_BOOL (validateStationKey, false);
|
||||
KEY_STRING (sessionServers, "");
|
||||
|
||||
@@ -78,8 +78,6 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/LoginServer.profdata)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shared
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedCommandParser/include/public
|
||||
|
||||
@@ -116,7 +116,7 @@ void ConfigLoginServer::install(void)
|
||||
KEY_BOOL(requireSecureLoginForCsTool, true);
|
||||
KEY_BOOL(useExternalAuth, false);
|
||||
KEY_STRING(externalAuthURL, "");
|
||||
KEY_INT(maxConnectionsPerIP, 0); // assuming 2 people playing in the same household
|
||||
KEY_INT(maxConnectionsPerIP, 4); // assuming 2 people playing in the same household
|
||||
|
||||
int index = 0;
|
||||
char const * result = 0;
|
||||
|
||||
@@ -1076,25 +1076,7 @@ void LoginServer::validateAccount(const StationId& stationId, uint32 clusterId,
|
||||
// Check cluster npe user limit
|
||||
if (cle->m_numTutorialPlayers > cle->m_onlineTutorialLimit)
|
||||
{
|
||||
canCreateRegular = false;
|
||||
canCreateJedi = false;
|
||||
}
|
||||
|
||||
// limit login/character creation based on subscription feature bits
|
||||
if (((subscriptionBits & ClientSubscriptionFeature::FreeTrial) != 0)
|
||||
&& ((subscriptionBits & ClientSubscriptionFeature::Base) == 0))
|
||||
{
|
||||
// Check cluster free trial user limit
|
||||
if (cle->m_numFreeTrialPlayers > cle->m_onlineFreeTrialLimit)
|
||||
{
|
||||
canLogin = false;
|
||||
}
|
||||
// Check cluster free trial character creation
|
||||
if (!cle->m_freeTrialCanCreateChar)
|
||||
{
|
||||
canCreateRegular = false;
|
||||
canCreateJedi = false;
|
||||
}
|
||||
canLogin = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,6 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
add_compile_options(-fprofile-instr-use=${PROJECT_SOURCE_DIR}/src/linux/PlanetServer.profdata)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shared
|
||||
${SWG_ENGINE_SOURCE_DIR}/shared/library/sharedCommandParser/include/public
|
||||
|
||||
@@ -34,14 +34,14 @@ void ConfigServerDatabase::install(void)
|
||||
ConfigServerUtility::install();
|
||||
data = &staticData;
|
||||
|
||||
KEY_INT (objvarNameCleanupTime, 0);
|
||||
KEY_INT (orphanedObjectCleanupTime, 0);
|
||||
KEY_INT (marketAttributesCleanupTime, 0);
|
||||
KEY_INT (messagesCleanupTime, 0);
|
||||
KEY_INT (brokenObjectCleanupTime, 0);
|
||||
KEY_INT (vendorObjectCleanupTime, 0);
|
||||
KEY_INT (objvarNameCleanupTime, 10);
|
||||
KEY_INT (orphanedObjectCleanupTime, 10);
|
||||
KEY_INT (marketAttributesCleanupTime, 10);
|
||||
KEY_INT (messagesCleanupTime, 10);
|
||||
KEY_INT (brokenObjectCleanupTime, 10);
|
||||
KEY_INT (vendorObjectCleanupTime, 10);
|
||||
KEY_STRING (customSQLFilename,"");
|
||||
KEY_BOOL (enableFixBadCells, false);
|
||||
KEY_BOOL (enableFixBadCells, true);
|
||||
KEY_STRING (objectTemplateListUpdateFilename,"");
|
||||
|
||||
KEY_STRING (DSN,"gameserver");
|
||||
@@ -56,7 +56,7 @@ void ConfigServerDatabase::install(void)
|
||||
KEY_INT (taskManagerPort, 60001);
|
||||
KEY_INT (expectedDBVersion, 270);
|
||||
KEY_BOOL (correctDBVersionRequired,true);
|
||||
KEY_INT (saveFrequencyLimit,10);
|
||||
KEY_INT (saveFrequencyLimit,5);
|
||||
KEY_STRING (schemaOwner, "");
|
||||
KEY_STRING (goldSchemaOwner, "");
|
||||
KEY_FLOAT (uniqueMessageCacheTimeSec, 30.0f);
|
||||
@@ -72,10 +72,10 @@ void ConfigServerDatabase::install(void)
|
||||
KEY_BOOL (reportSaveTimes, false);
|
||||
KEY_BOOL (shouldSleep, true);
|
||||
KEY_BOOL (enableLoadLocks, true);
|
||||
KEY_INT (databaseReconnectTime, 0);
|
||||
KEY_INT (databaseReconnectTime, 1);
|
||||
KEY_BOOL (logChunkLoading,false);
|
||||
KEY_BOOL (useMemoryManagerForOCI,false);
|
||||
KEY_INT (maxCharactersPerLoadRequest,10);
|
||||
KEY_INT (maxCharactersPerLoadRequest,20);
|
||||
KEY_INT (maxChunksPerLoadRequest,200);
|
||||
KEY_FLOAT (maxLoadStartDelay,300.0f);
|
||||
KEY_INT (maxErrorCountBeforeDisconnect,5);
|
||||
@@ -106,11 +106,11 @@ void ConfigServerDatabase::install(void)
|
||||
KEY_INT (maxLoaderFinishedTasks, 100);
|
||||
KEY_FLOAT (reportLongFrameTime, 1.0f);
|
||||
KEY_BOOL (enableVerboseMessageLogging, false);
|
||||
KEY_BOOL (profilerExpandAll, true);
|
||||
KEY_BOOL (profilerExpandAll, false);
|
||||
KEY_INT (profilerDisplayPercentageMinimum, 0);
|
||||
KEY_BOOL (fatalOnDataError, false);
|
||||
KEY_INT (maxUnackedLoadCount, 1000000000); // by default, set to an "unlimited" number, and use maxUnackedLoadCountPerServer as the cap
|
||||
KEY_INT (maxUnackedLoadCountPerServer, 2);
|
||||
KEY_INT (maxUnackedLoadCountPerServer, 5);
|
||||
KEY_INT (auctionLocationLoadBatchSize, 100);
|
||||
KEY_INT (auctionLoadBatchSize, 100);
|
||||
KEY_INT (auctionAttributeLoadBatchSize, 100);
|
||||
|
||||
@@ -91,13 +91,13 @@ m_queryFetchCount(0)
|
||||
|
||||
centralServerConnection = new CentralServerConnection(ConfigServerDatabase::getCentralServerAddress(), ConfigServerDatabase::getCentralServerPort());
|
||||
NetworkSetupData setup;
|
||||
setup.maxConnections = 100;
|
||||
setup.maxConnections = 300;
|
||||
setup.port = 0;
|
||||
setup.bindInterface = ConfigServerDatabase::getGameServiceBindInterface();
|
||||
gameService = new Service(ConnectionAllocator<GameServerConnection>(), setup);
|
||||
|
||||
NetworkSetupData cmSetup;
|
||||
cmSetup.maxConnections = 100;
|
||||
cmSetup.maxConnections = 300;
|
||||
cmSetup.port = ConfigServerDatabase::getCommoditiesServerPort();
|
||||
cmSetup.bindInterface = ConfigServerDatabase::getCommoditiesServerAddress();
|
||||
commoditiesService = new Service(ConnectionAllocator<CommoditiesServerConnection>(), cmSetup);
|
||||
@@ -128,7 +128,7 @@ m_queryFetchCount(0)
|
||||
DB::Server::setDisconnectSleepTime(ConfigServerDatabase::getDisconnectSleepTime());
|
||||
DB::Server::setFatalOnDataError(ConfigServerDatabase::getFatalOnDataError());
|
||||
|
||||
// the DatabaseProcess singleton will want to know when major, connection
|
||||
// the DatabaseProcess singleton will want to know when major, connection
|
||||
// oriented events occur. These events are defined in Game, Task and Central
|
||||
// connection classes.
|
||||
connectToMessage("CentralConnectionOpened");
|
||||
@@ -252,7 +252,7 @@ void DatabaseProcess::run(void)
|
||||
// TODO: sleep longer if idle
|
||||
if (shouldSleep)
|
||||
{
|
||||
Os::sleep(1);
|
||||
Os::sleep(3);
|
||||
}
|
||||
|
||||
NetworkHandler::dispatch();
|
||||
|
||||
@@ -174,43 +174,32 @@ Persister::~Persister()
|
||||
{
|
||||
DEBUG_FATAL(taskQueue,("Call shutdown() before deleting Persister.\n"));
|
||||
|
||||
for (auto i = m_currentSnapshots.begin(); i!=m_currentSnapshots.end(); ++i) {
|
||||
for (auto i=m_currentSnapshots.begin(); i!=m_currentSnapshots.end(); ++i) {
|
||||
delete i->second;
|
||||
i->second = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_newObjectSnapshots.begin(); i!=m_newObjectSnapshots.end(); ++i) {
|
||||
for (auto i=m_newObjectSnapshots.begin(); i!=m_newObjectSnapshots.end(); ++i) {
|
||||
delete i->second;
|
||||
i->second = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_newCharacterSnapshots.begin(); i!=m_newCharacterSnapshots.end(); ++i) {
|
||||
delete i->second;
|
||||
i->second = nullptr;
|
||||
for (auto i=m_savingCharacterSnapshots.begin(); i!=m_savingCharacterSnapshots.end(); ++i) {
|
||||
delete *i;
|
||||
*i = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_objectSnapshotMap.begin(); i!=m_objectSnapshotMap.end(); ++i) {
|
||||
delete i->second;
|
||||
i->second = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_savingSnapshots.begin(); i!=m_savingSnapshots.end(); ++i) {
|
||||
delete *i;
|
||||
*i = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_savingCharacterSnapshots.begin(); i!=m_savingCharacterSnapshots.end(); ++i) {
|
||||
delete *i;
|
||||
*i = nullptr;
|
||||
}
|
||||
for (auto i=m_savingSnapshots.begin(); i!=m_savingSnapshots.end(); ++i) {
|
||||
delete *i;
|
||||
*i = nullptr;
|
||||
}
|
||||
|
||||
m_currentSnapshots.clear();
|
||||
m_newObjectSnapshots.clear();
|
||||
m_objectSnapshotMap.clear();
|
||||
|
||||
delete m_messageSnapshot;
|
||||
delete m_commoditiesSnapshot;
|
||||
delete m_arbitraryGameDataSnapshot;
|
||||
m_savingCharacterSnapshots.clear();
|
||||
m_savingSnapshots.clear();
|
||||
|
||||
|
||||
m_messageSnapshot = nullptr;
|
||||
m_commoditiesSnapshot = nullptr;
|
||||
@@ -628,10 +617,23 @@ void Persister::endBaselines(const NetworkId &objectId, uint32 serverId)
|
||||
|
||||
void Persister::saveCompleted(Snapshot *completedSnapshot)
|
||||
{
|
||||
SnapshotListType::iterator i=std::remove(m_savingSnapshots.begin(),m_savingSnapshots.end(),completedSnapshot);
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(m_savingDeleting_mtx);
|
||||
|
||||
delete completedSnapshot;
|
||||
completedSnapshot = nullptr;
|
||||
}
|
||||
auto i=std::remove(m_savingSnapshots.begin(),m_savingSnapshots.end(),completedSnapshot);
|
||||
|
||||
if (i!=m_savingSnapshots.end())
|
||||
{
|
||||
m_savingSnapshots.erase(i, m_savingSnapshots.end());
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(m_savingDeleting_mtx);
|
||||
WARNING(true, ("m_SavingSnapshots is not empty and we're nuking everything for some reason. Is this a leak?"));
|
||||
m_savingSnapshots.erase(i, m_savingSnapshots.end());
|
||||
}
|
||||
|
||||
if (m_savingSnapshots.empty() && ConfigServerDatabase::getReportSaveTimes())
|
||||
{
|
||||
int saveTime = Clock::timeMs() - m_saveStartTime;
|
||||
@@ -639,7 +641,7 @@ void Persister::saveCompleted(Snapshot *completedSnapshot)
|
||||
m_totalSaveTime += saveTime;
|
||||
if (saveTime > m_maxSaveTime)
|
||||
m_maxSaveTime = saveTime;
|
||||
|
||||
|
||||
DEBUG_REPORT_LOG(true,("Save completed in %i. (Average %i, max %i)\n", saveTime, m_totalSaveTime/m_saveCount, m_maxSaveTime));
|
||||
LOG("SaveTimes",("Save completed in %i. (Average %i, max %i)", saveTime, m_totalSaveTime/m_saveCount, m_maxSaveTime));
|
||||
m_lastSaveTime = saveTime;
|
||||
@@ -652,7 +654,7 @@ void Persister::saveCompleted(Snapshot *completedSnapshot)
|
||||
DatabaseProcess::getInstance().sendToCentralServer(saveCompleteMessage, true);
|
||||
LOG("Database",("Sending DatabaseSaveComplete network message to Central."));
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
// set the last save completion time (for the monitoring program)
|
||||
time_t theTime = time(0);
|
||||
@@ -661,10 +663,13 @@ void Persister::saveCompleted(Snapshot *completedSnapshot)
|
||||
}
|
||||
else
|
||||
{
|
||||
SnapshotListType::iterator j=std::remove(m_savingCharacterSnapshots.begin(),m_savingCharacterSnapshots.end(),completedSnapshot);
|
||||
DEBUG_FATAL(i==m_savingCharacterSnapshots.end(),("Programmer bug: SaveCompleted() called with a snapshot that wasn't in m_savingSnapshots or m_savingCharacterSnapshots."));
|
||||
m_savingCharacterSnapshots.erase(j, m_savingCharacterSnapshots.end());
|
||||
DEBUG_REPORT_LOG(ConfigServerDatabase::getReportSaveTimes(),("New character save completed\n"));
|
||||
std::lock_guard<std::mutex> lck(m_savingDeleting_mtx);
|
||||
|
||||
auto j=std::remove(m_savingCharacterSnapshots.begin(),m_savingCharacterSnapshots.end(),completedSnapshot);
|
||||
|
||||
WARNING(j==m_savingCharacterSnapshots.end(),("saveCompleted() called w/o snap in m_savingSnapshots or m_savingCharacterSnapshots."));
|
||||
|
||||
m_savingCharacterSnapshots.erase(j, m_savingCharacterSnapshots.end());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include <vector>
|
||||
#include <set> //TODO: remove when we clean up newCharacterLock hack
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include "Unicode.h"
|
||||
#include "serverNetworkMessages/MessageToPayload.h"
|
||||
#include "sharedDatabaseInterface/DbModeQuery.h"
|
||||
@@ -116,8 +118,12 @@ class Persister : public MessageDispatch::Receiver
|
||||
ServerSnapshotMap m_newCharacterSnapshots;
|
||||
ObjectSnapshotMap m_objectSnapshotMap;
|
||||
PendingCharactersType m_pendingCharacters;
|
||||
|
||||
SnapshotListType m_savingSnapshots;
|
||||
SnapshotListType m_savingCharacterSnapshots;
|
||||
|
||||
std::mutex m_savingDeleting_mtx;
|
||||
|
||||
NewCharacterLockType m_newCharacterLock;
|
||||
CharactersToDeleteType * m_charactersToDeleteThisSaveCycle;
|
||||
CharactersToDeleteType * m_charactersToDeleteNextSaveCycle;
|
||||
|
||||
@@ -71,7 +71,7 @@ void ConfigServerGame::install(void)
|
||||
KEY_INT (scriptWatcherInterruptTime, 5000);
|
||||
KEY_INT (scriptStackErrorLimit, 35);
|
||||
KEY_INT (scriptStackErrorLevel, 0);
|
||||
KEY_BOOL (disableObjvarNullCheck, false);
|
||||
KEY_BOOL (disableObjvarNullCheck, true);
|
||||
KEY_INT (maxGameServerToSendUniverseData, 1000000);
|
||||
KEY_INT (timeoutToAckUniverseDataReceived, 0);
|
||||
KEY_BOOL (disableCombat, false);
|
||||
|
||||
Reference in New Issue
Block a user