mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-01 17:20:09 -06:00
Feature/documentation topic (#822)
- Implement documentation topic that can be used to query documentation using the network API. - Implement a way to pass arguments to lua scripts using json (rather than formatting entire lua string clientside) - Implement ability to attach callback to lua script executions - Implement abillity to transport return values from lua scripts back to network API clients. - Do not initialize server interface on slave nodes. - Implement Dictionary -> json converter using nlohmann json library
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
#include <modules/server/include/connection.h>
|
||||
#include <modules/server/include/topics/topic.h>
|
||||
#include <openspace/engine/globalscallbacks.h>
|
||||
#include <openspace/engine/globals.h>
|
||||
#include <openspace/engine/windowdelegate.h>
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/io/socket/socket.h>
|
||||
#include <ghoul/io/socket/tcpsocketserver.h>
|
||||
@@ -86,7 +88,10 @@ void ServerModule::internalInitialize(const ghoul::Dictionary& configuration) {
|
||||
std::unique_ptr<ServerInterface> serverInterface =
|
||||
ServerInterface::createFromDictionary(interfaceDictionary);
|
||||
|
||||
serverInterface->initialize();
|
||||
|
||||
if (global::windowDelegate.isMaster()) {
|
||||
serverInterface->initialize();
|
||||
}
|
||||
|
||||
_interfaceOwner.addPropertySubOwner(serverInterface.get());
|
||||
|
||||
@@ -101,6 +106,10 @@ void ServerModule::internalInitialize(const ghoul::Dictionary& configuration) {
|
||||
}
|
||||
|
||||
void ServerModule::preSync() {
|
||||
if (!global::windowDelegate.isMaster()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set up new connections.
|
||||
for (std::unique_ptr<ServerInterface>& serverInterface : _interfaces) {
|
||||
if (!serverInterface->isEnabled()) {
|
||||
@@ -165,7 +174,9 @@ void ServerModule::cleanUpFinishedThreads() {
|
||||
|
||||
void ServerModule::disconnectAll() {
|
||||
for (std::unique_ptr<ServerInterface>& serverInterface : _interfaces) {
|
||||
serverInterface->deinitialize();
|
||||
if (global::windowDelegate.isMaster()) {
|
||||
serverInterface->deinitialize();
|
||||
}
|
||||
}
|
||||
|
||||
for (ConnectionData& connectionData : _connections) {
|
||||
|
||||
Reference in New Issue
Block a user