Skip to content

Commit 7098110

Browse files
JeodCKiritoDv
authored andcommitted
Guard Stella behind USE_NETWORKING
1 parent 554c653 commit 7098110

7 files changed

Lines changed: 14 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ endif()
153153

154154
# Set game compilation version
155155
set(VERSION us)
156-
set(USE_NETWORKING ON)
156+
if(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch" OR CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
157+
set(USE_NETWORKING_DEFAULT OFF)
158+
else()
159+
set(USE_NETWORKING_DEFAULT ON)
160+
endif()
161+
option(USE_NETWORKING "Enable the Satella online relay / networking features" ${USE_NETWORKING_DEFAULT})
157162
set(SKIP_XCODE_VERSION_CHECK ON)
158163

159164
# Add compile definitions for the target

src/port/Engine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ void GameEngine::RunExtract(int argc, char* argv[]) {
554554
#endif
555555
std::shared_ptr<BS::thread_pool> threadPool = std::make_shared<BS::thread_pool>(1);
556556
while (true) {
557-
#ifndef __SWITCH__
557+
#ifdef USE_NETWORKING
558558
auto satellaPhase = Satella::Client::Instance().GetPhase();
559559
bool satellaActive = satellaPhase == Satella::Phase::Connecting || satellaPhase == Satella::Phase::FetchingKeys;
560560
#else
@@ -837,7 +837,7 @@ void GameEngine::RunExtract(int argc, char* argv[]) {
837837
continue;
838838
}
839839
case GS_COMPILE: {
840-
#ifndef __SWITCH__
840+
#ifdef USE_NETWORKING
841841
threadPool->submit_task([&]() -> void {
842842
Satella::Client::Instance().Execute();
843843
extractStep = GS_LOAD;
@@ -937,7 +937,7 @@ void GameEngine::RunExtract(int argc, char* argv[]) {
937937
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize |
938938
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar |
939939
ImGuiWindowFlags_NoSavedSettings)) {
940-
#ifndef __SWITCH__
940+
#ifdef USE_NETWORKING
941941
if (satellaActive) {
942942
const char* msg = satellaPhase == Satella::Phase::Connecting ? "Connecting to Satella..."
943943
: "Retrieving public keys...";

src/port/api/relay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifndef __SWITCH__
1+
#ifdef USE_NETWORKING
22
#include "relay.h"
33
#include "port/net/Relay.h"
44
#include "spdlog/spdlog.h"

src/port/net/Relay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifndef __SWITCH__
1+
#ifdef USE_NETWORKING
22
#include "Relay.h"
33
#include "SatellaClient.h"
44

src/port/net/Relay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#ifndef __SWITCH__
2+
#ifdef USE_NETWORKING
33

44
#include <cstdint>
55
#include <functional>

src/port/net/SatellaClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#ifndef __SWITCH__
1+
#ifdef USE_NETWORKING
22
#include "port/net/SatellaClient.h"
33

44
#include "ship/Context.h"

src/port/net/SatellaClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#ifndef __SWITCH__
3+
#ifdef USE_NETWORKING
44
#include <condition_variable>
55
#include <cstdint>
66
#include <memory>

0 commit comments

Comments
 (0)