mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-09 06:48:35 -05:00
@@ -88,7 +88,7 @@ int ServerModule::skyBrowserUpdateTime() const {
|
||||
|
||||
void ServerModule::internalInitialize(const ghoul::Dictionary& configuration) {
|
||||
global::callback::preSync->emplace_back([this]() {
|
||||
ZoneScopedN("ServerModule")
|
||||
ZoneScopedN("ServerModule");
|
||||
|
||||
preSync();
|
||||
});
|
||||
@@ -173,7 +173,7 @@ void ServerModule::preSync() {
|
||||
}
|
||||
|
||||
void ServerModule::cleanUpFinishedThreads() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (ConnectionData& connectionData : _connections) {
|
||||
Connection& connection = *connectionData.connection;
|
||||
@@ -194,7 +194,7 @@ void ServerModule::cleanUpFinishedThreads() {
|
||||
}
|
||||
|
||||
void ServerModule::disconnectAll() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (std::unique_ptr<ServerInterface>& serverInterface : _interfaces) {
|
||||
serverInterface->deinitialize();
|
||||
@@ -211,7 +211,7 @@ void ServerModule::disconnectAll() {
|
||||
}
|
||||
|
||||
void ServerModule::handleConnection(std::shared_ptr<Connection> connection) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
std::string messageString;
|
||||
messageString.reserve(256);
|
||||
@@ -222,7 +222,7 @@ void ServerModule::handleConnection(std::shared_ptr<Connection> connection) {
|
||||
}
|
||||
|
||||
void ServerModule::consumeMessages() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
std::lock_guard lock(_messageQueueMutex);
|
||||
while (!_messageQueue.empty()) {
|
||||
|
||||
@@ -99,7 +99,7 @@ Connection::Connection(std::unique_ptr<ghoul::io::Socket> s, std::string address
|
||||
}
|
||||
|
||||
void Connection::handleMessage(const std::string& message) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
try {
|
||||
nlohmann::json j = nlohmann::json::parse(message.c_str());
|
||||
@@ -140,7 +140,7 @@ void Connection::handleMessage(const std::string& message) {
|
||||
}
|
||||
|
||||
void Connection::handleJson(const nlohmann::json& json) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
auto topicJson = json.find(MessageKeyTopic);
|
||||
auto payloadJson = json.find(MessageKeyPayload);
|
||||
@@ -196,13 +196,13 @@ void Connection::handleJson(const nlohmann::json& json) {
|
||||
}
|
||||
|
||||
void Connection::sendMessage(const std::string& message) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
_socket->putMessage(message);
|
||||
}
|
||||
|
||||
void Connection::sendJson(const nlohmann::json& json) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
sendMessage(json.dump());
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ const json TimeTopic::getNextPrevDeltaTimeStepJson() {
|
||||
}
|
||||
|
||||
void TimeTopic::sendCurrentTime() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const json timeJson = {
|
||||
{ "time", global::timeManager->time().ISO8601() }
|
||||
|
||||
@@ -36,7 +36,7 @@ void Topic::initialize(std::shared_ptr<Connection> connection, size_t topicId) {
|
||||
}
|
||||
|
||||
nlohmann::json Topic::wrappedPayload(const nlohmann::json& payload) const {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// TODO: add message time
|
||||
nlohmann::json j = {
|
||||
@@ -47,7 +47,7 @@ nlohmann::json Topic::wrappedPayload(const nlohmann::json& payload) const {
|
||||
}
|
||||
|
||||
nlohmann::json Topic::wrappedError(std::string message, int code) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
nlohmann::json j = {
|
||||
{ "topic", _topicId },
|
||||
|
||||
Reference in New Issue
Block a user