mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 11:41:17 +02:00
Revert 0b46c53df1
This commit is contained in:
parent
b3ab7e05d3
commit
0dadb100b1
7 changed files with 88 additions and 108 deletions
78
cmake/externals/polyvox/CMakeLists.txt
vendored
Normal file
78
cmake/externals/polyvox/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
set(EXTERNAL_NAME polyvox)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
ExternalProject_Add(
|
||||||
|
${EXTERNAL_NAME}
|
||||||
|
URL https://public.highfidelity.com/dependencies/polyvox-master-2015-7-15.zip
|
||||||
|
URL_MD5 9ec6323b87e849ae36e562ae1c7494a9
|
||||||
|
CMAKE_ARGS -DENABLE_EXAMPLES=OFF -DENABLE_BINDINGS=OFF -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||||
|
BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build
|
||||||
|
LOG_DOWNLOAD 1
|
||||||
|
LOG_CONFIGURE 1
|
||||||
|
LOG_BUILD 1
|
||||||
|
)
|
||||||
|
|
||||||
|
# Hide this external target (for ide users)
|
||||||
|
set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||||
|
|
||||||
|
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(INSTALL_NAME_LIBRARY_DIR ${INSTALL_DIR}/lib)
|
||||||
|
|
||||||
|
ExternalProject_Add_Step(
|
||||||
|
${EXTERNAL_NAME}
|
||||||
|
change-install-name-debug
|
||||||
|
COMMENT "Calling install_name_tool on libraries to fix install name for dylib linking"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DINSTALL_NAME_LIBRARY_DIR=${INSTALL_NAME_LIBRARY_DIR}/Debug -P ${EXTERNAL_PROJECT_DIR}/OSXInstallNameChange.cmake
|
||||||
|
DEPENDEES install
|
||||||
|
WORKING_DIRECTORY <SOURCE_DIR>
|
||||||
|
LOG 1
|
||||||
|
)
|
||||||
|
|
||||||
|
ExternalProject_Add_Step(
|
||||||
|
${EXTERNAL_NAME}
|
||||||
|
change-install-name-release
|
||||||
|
COMMENT "Calling install_name_tool on libraries to fix install name for dylib linking"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DINSTALL_NAME_LIBRARY_DIR=${INSTALL_NAME_LIBRARY_DIR}/Release -P ${EXTERNAL_PROJECT_DIR}/OSXInstallNameChange.cmake
|
||||||
|
DEPENDEES install
|
||||||
|
WORKING_DIRECTORY <SOURCE_DIR>
|
||||||
|
LOG 1
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_INCLUDE_DIRS ${INSTALL_DIR}/PolyVoxCore/include CACHE FILEPATH
|
||||||
|
"Path to polyvox core include directory")
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_UTIL_INCLUDE_DIRS ${INSTALL_DIR}/PolyVoxUtil/include CACHE FILEPATH
|
||||||
|
"Path to polyvox util include directory")
|
||||||
|
else ()
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_INCLUDE_DIRS ${INSTALL_DIR}/include/PolyVoxCore CACHE FILEPATH
|
||||||
|
"Path to polyvox core include directory")
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_UTIL_INCLUDE_DIRS ${INSTALL_DIR}/include/PolyVoxUtil CACHE FILEPATH
|
||||||
|
"Path to polyvox util include directory")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_LIBRARY_DEBUG ${INSTALL_DIR}/PolyVoxCore/lib/Debug/PolyVoxCore.lib CACHE FILEPATH "polyvox core library")
|
||||||
|
|
||||||
|
# use generator expression to ensure the correct library is found when building different configurations in VS
|
||||||
|
set(_LIB_FOLDER "$<$<CONFIG:RelWithDebInfo>:PolyVoxCore/lib/RelWithDebInfo>")
|
||||||
|
set(_LIB_FOLDER "${_LIB_FOLDER}$<$<CONFIG:MinSizeRel>:build/library/PolyVoxCore/MinSizeRel>")
|
||||||
|
set(_LIB_FOLDER "${_LIB_FOLDER}$<$<OR:$<CONFIG:Release>,$<CONFIG:Debug>>:PolyVoxCore/lib/Release>")
|
||||||
|
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_LIBRARY_RELEASE "${INSTALL_DIR}/${_LIB_FOLDER}/PolyVoxCore.lib" CACHE FILEPATH "polyvox core library")
|
||||||
|
# set(${EXTERNAL_NAME_UPPER}_UTIL_LIBRARY ${INSTALL_DIR}/PolyVoxUtil/lib/PolyVoxUtil.lib CACHE FILEPATH "polyvox util library")
|
||||||
|
elseif (APPLE)
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_LIBRARY_DEBUG ${INSTALL_DIR}/lib/Debug/libPolyVoxCore.dylib CACHE FILEPATH "polyvox core library")
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_LIBRARY_RELEASE ${INSTALL_DIR}/lib/Release/libPolyVoxCore.dylib CACHE FILEPATH "polyvox core library")
|
||||||
|
# set(${EXTERNAL_NAME_UPPER}_UTIL_LIBRARY ${INSTALL_DIR}/lib/libPolyVoxUtil.dylib CACHE FILEPATH "polyvox util library")
|
||||||
|
else ()
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_LIBRARY_DEBUG ${INSTALL_DIR}/lib/Debug/libPolyVoxCore.so CACHE FILEPATH "polyvox core library")
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_CORE_LIBRARY_RELEASE ${INSTALL_DIR}/lib/Release/libPolyVoxCore.so CACHE FILEPATH "polyvox core library")
|
||||||
|
# set(${EXTERNAL_NAME_UPPER}_UTIL_LIBRARY ${INSTALL_DIR}/lib/libPolyVoxUtil.so CACHE FILEPATH "polyvox util library")
|
||||||
|
endif ()
|
|
@ -165,8 +165,6 @@ elseif (WIN32)
|
||||||
|
|
||||||
# add an executable that also has the icon itself and the configured rc file as resources
|
# add an executable that also has the icon itself and the configured rc file as resources
|
||||||
add_executable(${TARGET_NAME} WIN32 ${INTERFACE_SRCS} ${QM} ${CONFIGURE_ICON_RC_OUTPUT} ${CONFIGURE_VERSION_INFO_RC_OUTPUT})
|
add_executable(${TARGET_NAME} WIN32 ${INTERFACE_SRCS} ${QM} ${CONFIGURE_ICON_RC_OUTPUT} ${CONFIGURE_VERSION_INFO_RC_OUTPUT})
|
||||||
##^^^^^ creates native Win32 app w/o cmd console vvvvvv forces cmd console for logging
|
|
||||||
# add_executable(${TARGET_NAME} ${INTERFACE_SRCS} ${QM} ${CONFIGURE_ICON_RC_OUTPUT} ${CONFIGURE_VERSION_INFO_RC_OUTPUT})
|
|
||||||
|
|
||||||
if (NOT DEV_BUILD)
|
if (NOT DEV_BUILD)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
@ -190,10 +188,6 @@ if (BUILD_TOOLS AND NPM_EXECUTABLE)
|
||||||
add_dependencies(resources jsdoc)
|
add_dependencies(resources jsdoc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32 OR APPLE)
|
|
||||||
add_dependencies(${TARGET_NAME} resources screenshare)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# These are external plugins, but we need to do the 'add dependency' here so that their
|
# These are external plugins, but we need to do the 'add dependency' here so that their
|
||||||
|
|
|
@ -7164,7 +7164,7 @@ void Application::updateWindowTitle() const {
|
||||||
bool isDomainLoggedIn = domainAccountManager->isLoggedIn();
|
bool isDomainLoggedIn = domainAccountManager->isLoggedIn();
|
||||||
QString authedDomainName = domainAccountManager->getAuthedDomainName();
|
QString authedDomainName = domainAccountManager->getAuthedDomainName();
|
||||||
|
|
||||||
QString buildVersion = " - Vircadia - "
|
QString buildVersion = " - "
|
||||||
+ (BuildInfo::BUILD_TYPE == BuildInfo::BuildType::Stable ? QString("Version") : QString("Build"))
|
+ (BuildInfo::BUILD_TYPE == BuildInfo::BuildType::Stable ? QString("Version") : QString("Build"))
|
||||||
+ " " + applicationVersion();
|
+ " " + applicationVersion();
|
||||||
|
|
||||||
|
|
|
@ -2163,7 +2163,7 @@ bool AudioClient::switchOutputToAudioDevice(const HifiAudioDeviceInfo outputDevi
|
||||||
int deviceChannelCount = _outputFormat.channelCount();
|
int deviceChannelCount = _outputFormat.channelCount();
|
||||||
int frameSize = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL * deviceChannelCount * _outputFormat.sampleRate()) / _desiredOutputFormat.sampleRate();
|
int frameSize = (AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL * deviceChannelCount * _outputFormat.sampleRate()) / _desiredOutputFormat.sampleRate();
|
||||||
int requestedSize = _sessionOutputBufferSizeFrames * frameSize * AudioConstants::SAMPLE_SIZE;
|
int requestedSize = _sessionOutputBufferSizeFrames * frameSize * AudioConstants::SAMPLE_SIZE;
|
||||||
_audioOutput->setBufferSize(requestedSize * 16);
|
_audioOutput->setBufferSize(requestedSize);
|
||||||
|
|
||||||
connect(_audioOutput, &QAudioOutput::notify, this, &AudioClient::outputNotify);
|
connect(_audioOutput, &QAudioOutput::notify, this, &AudioClient::outputNotify);
|
||||||
|
|
||||||
|
|
|
@ -39,9 +39,6 @@ void UserActivityLogger::crashMonitorDisable(bool disable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserActivityLogger::logAction(QString action, QJsonObject details, JSONCallbackParameters params) {
|
void UserActivityLogger::logAction(QString action, QJsonObject details, JSONCallbackParameters params) {
|
||||||
// qCDebug(networking).nospace() << ">>> UserActivityLogger::logAction(" << action << "," << QJsonDocument(details).toJson();
|
|
||||||
// This logs what the UserActivityLogger would normally send to centralized servers.
|
|
||||||
return;
|
|
||||||
if (_disabled.get()) {
|
if (_disabled.get()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -875,11 +875,6 @@ void ScriptEngine::init() {
|
||||||
#if DEV_BUILD || PR_BUILD
|
#if DEV_BUILD || PR_BUILD
|
||||||
registerGlobalObject("StackTest", new StackTestScriptingInterface(this));
|
registerGlobalObject("StackTest", new StackTestScriptingInterface(this));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
globalObject().setProperty("KALILA", "isWaifu");
|
|
||||||
globalObject().setProperty("Kute", newFunction([](QScriptContext* context, QScriptEngine* engine) -> QScriptValue {
|
|
||||||
return context->argument(0).toString().toLower() == "kalila" ? true : false;
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptEngine::registerEnum(const QString& enumName, QMetaEnum newEnum) {
|
void ScriptEngine::registerEnum(const QString& enumName, QMetaEnum newEnum) {
|
||||||
|
@ -2444,7 +2439,6 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
||||||
BaseScriptEngine sandbox;
|
BaseScriptEngine sandbox;
|
||||||
sandbox.setProcessEventsInterval(SANDBOX_TIMEOUT);
|
sandbox.setProcessEventsInterval(SANDBOX_TIMEOUT);
|
||||||
QScriptValue testConstructor, exception;
|
QScriptValue testConstructor, exception;
|
||||||
if (atoi(getenv("UNSAFE_ENTITY_SCRIPTS") ? getenv("UNSAFE_ENTITY_SCRIPTS") : "0"))
|
|
||||||
{
|
{
|
||||||
QTimer timeout;
|
QTimer timeout;
|
||||||
timeout.setSingleShot(true);
|
timeout.setSingleShot(true);
|
||||||
|
@ -2466,86 +2460,6 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
|
||||||
} else if (testConstructor.isError()) {
|
} else if (testConstructor.isError()) {
|
||||||
exception = testConstructor;
|
exception = testConstructor;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// ENTITY SCRIPT WHITELIST STARTS HERE
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
|
||||||
bool passList = false; // assume unsafe
|
|
||||||
QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]";
|
|
||||||
QList<QString> safeURLPrefixes = { "file:///", "atp:", "cache:" };
|
|
||||||
safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts);
|
|
||||||
|
|
||||||
// Entity Script Whitelist toggle check.
|
|
||||||
Setting::Handle<bool> whitelistEnabled {"private/whitelistEnabled", false };
|
|
||||||
|
|
||||||
if (!whitelistEnabled.get()) {
|
|
||||||
passList = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pull SAFEURLS from the Interface.JSON settings.
|
|
||||||
QVariant raw = Setting::Handle<QVariant>("private/settingsSafeURLS").get();
|
|
||||||
QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts);
|
|
||||||
safeURLPrefixes += settingsSafeURLS;
|
|
||||||
// END Pull SAFEURLS from the Interface.JSON settings.
|
|
||||||
|
|
||||||
// Get current domain whitelist bypass, in case an entire domain is whitelisted.
|
|
||||||
QString currentDomain = DependencyManager::get<AddressManager>()->getDomainURL().host();
|
|
||||||
|
|
||||||
QString domainSafeIP = nodeList->getDomainHandler().getHostname();
|
|
||||||
QString domainSafeURL = URL_SCHEME_HIFI + "://" + currentDomain;
|
|
||||||
for (const auto& str : safeURLPrefixes) {
|
|
||||||
if (domainSafeURL.startsWith(str) || domainSafeIP.startsWith(str)) {
|
|
||||||
qCDebug(scriptengine) << whitelistPrefix << "Whitelist Bypassed, entire domain is whitelisted. Current Domain Host: "
|
|
||||||
<< nodeList->getDomainHandler().getHostname()
|
|
||||||
<< "Current Domain: " << currentDomain;
|
|
||||||
passList = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// END bypass whitelist based on current domain.
|
|
||||||
|
|
||||||
// Start processing scripts through the whitelist.
|
|
||||||
if (ScriptEngine::getContext() == "entity_server") { // If running on the server, do not engage whitelist.
|
|
||||||
passList = true;
|
|
||||||
} else if (!passList) { // If waved through, do not engage whitelist.
|
|
||||||
for (const auto& str : safeURLPrefixes) {
|
|
||||||
qCDebug(scriptengine) << whitelistPrefix << "Script URL: " << scriptOrURL << "TESTING AGAINST" << str << "RESULTS IN"
|
|
||||||
<< scriptOrURL.startsWith(str);
|
|
||||||
if (!str.isEmpty() && scriptOrURL.startsWith(str)) {
|
|
||||||
passList = true;
|
|
||||||
qCDebug(scriptengine) << whitelistPrefix << "Script approved.";
|
|
||||||
break; // Bail early since we found a match.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// END processing of scripts through the whitelist.
|
|
||||||
|
|
||||||
if (!passList) { // If the entity failed to pass for any reason, it's blocked and an error is thrown.
|
|
||||||
qCDebug(scriptengine) << whitelistPrefix << "(disabled entity script)" << entityID.toString() << scriptOrURL;
|
|
||||||
exception = makeError("UNSAFE_ENTITY_SCRIPTS == 0");
|
|
||||||
} else {
|
|
||||||
QTimer timeout;
|
|
||||||
timeout.setSingleShot(true);
|
|
||||||
timeout.start(SANDBOX_TIMEOUT);
|
|
||||||
connect(&timeout, &QTimer::timeout, [=, &sandbox] {
|
|
||||||
qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable timeout";
|
|
||||||
|
|
||||||
// Guard against infinite loops and non-performant code
|
|
||||||
sandbox.raiseException(
|
|
||||||
sandbox.makeError(QString("Timed out (entity constructors are limited to %1ms)").arg(SANDBOX_TIMEOUT)));
|
|
||||||
});
|
|
||||||
|
|
||||||
testConstructor = sandbox.evaluate(program);
|
|
||||||
|
|
||||||
if (sandbox.hasUncaughtException()) {
|
|
||||||
exception = sandbox.cloneUncaughtException(QString("(preflight %1)").arg(entityID.toString()));
|
|
||||||
sandbox.clearExceptions();
|
|
||||||
} else if (testConstructor.isError()) {
|
|
||||||
exception = testConstructor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ENTITY SCRIPT WHITELIST ENDS HERE, uncomment below for original full disabling.
|
|
||||||
|
|
||||||
// qDebug() << "(disabled entity script)" << entityID.toString() << scriptOrURL;
|
|
||||||
// exception = makeError("UNSAFE_ENTITY_SCRIPTS == 0");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exception.isError()) {
|
if (exception.isError()) {
|
||||||
|
@ -2925,6 +2839,3 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ScriptEngine::getExternalPath(ExternalResource::Bucket bucket, const QString& path) {
|
|
||||||
return ExternalResource::getInstance()->getUrl(bucket, path);
|
|
||||||
}
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
# add the plugin directories
|
# add the plugin directories
|
||||||
file(GLOB PLUGIN_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
file(GLOB PLUGIN_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
||||||
list(REMOVE_ITEM PLUGIN_SUBDIRS "CMakeFiles")
|
list(REMOVE_ITEM PLUGIN_SUBDIRS "CMakeFiles")
|
||||||
set(CMAKE_BUILD_TYPE "Release")
|
|
||||||
# client-side plugins
|
# client-side plugins
|
||||||
if (NOT SERVER_ONLY AND NOT ANDROID)
|
if (NOT SERVER_ONLY AND NOT ANDROID)
|
||||||
set(DIR "oculus")
|
set(DIR "oculus")
|
||||||
|
|
Loading…
Reference in a new issue