Also set the socket type for the server connection correctly; Fix the broken spacetime component again

This commit is contained in:
Alexander Bock
2023-05-16 15:34:32 +02:00
parent 7226ebbfb4
commit 4edb796147
2 changed files with 11 additions and 10 deletions
+3 -2
View File
@@ -348,10 +348,11 @@ void GuiSpaceTimeComponent::render() {
openspace::TimeUnits.end(),
std::string(""),
[](const std::string& a, const openspace::TimeUnit& unit) {
return fmt::format("{}{} / second\0", a, nameForTimeUnit(unit, true));
return fmt::format(
"{}{} / second", a, nameForTimeUnit(unit, true)
) + '\0';
}
);
_firstFrame = false;
}
+8 -8
View File
@@ -177,10 +177,10 @@ ServerInterface::ServerInterface(const ghoul::Dictionary& config)
const std::string type = config.value<std::string>(TypeInfo.identifier);
if (type == TcpSocketType) {
_type = static_cast<int>(InterfaceType::TcpSocket);
_socketType = static_cast<int>(InterfaceType::TcpSocket);
}
else if (type == WebSocketType) {
_type = static_cast<int>(InterfaceType::WebSocket);
_socketType = static_cast<int>(InterfaceType::WebSocket);
}
if (config.hasValue<std::string>(PasswordInfo.identifier)) {
@@ -220,12 +220,12 @@ void ServerInterface::initialize() {
return;
}
switch (static_cast<InterfaceType>(_socketType.value())) {
case InterfaceType::TcpSocket:
_socketServer = std::make_unique<ghoul::io::TcpSocketServer>();
break;
case InterfaceType::WebSocket:
_socketServer = std::make_unique<ghoul::io::WebSocketServer>();
break;
case InterfaceType::TcpSocket:
_socketServer = std::make_unique<ghoul::io::TcpSocketServer>();
break;
case InterfaceType::WebSocket:
_socketServer = std::make_unique<ghoul::io::WebSocketServer>();
break;
}
_socketServer->listen(_port);
}