Skip to content

Commit 8c5bdd7

Browse files
Maker preview version for 0.0.4
1 parent c66d79b commit 8c5bdd7

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

loader/main.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main(int argc, char *argv[]) {
2121

2222
#define BUFFER_SIZE 8000
2323
DWORD buffer_size = BUFFER_SIZE;
24-
//wchar_t buffer[BUFFER_SIZE];
24+
wchar_t buffer[BUFFER_SIZE];
2525

2626
std::wstring config_path;
2727
std::wstring launch_path;
@@ -35,7 +35,6 @@ int main(int argc, char *argv[]) {
3535
}*/
3636

3737
buffer_size = BUFFER_SIZE;
38-
/*
3938
auto status = RegGetValueW(HKEY_CURRENT_USER, L"SOFTWARE\\elgato\\obs", L"",
4039
RRF_RT_REG_SZ, nullptr, buffer, &buffer_size);
4140
// Ignore if the value is too long for our buffer. The user can suffer if OBS is installed in a path longer than 8000 characters long
@@ -78,7 +77,7 @@ int main(int argc, char *argv[]) {
7877

7978
connect_attempts_remaining = 6;
8079
}
81-
*/
80+
8281

8382
std::string payload = argv[1];
8483

@@ -87,7 +86,7 @@ int main(int argc, char *argv[]) {
8786
std::string base_name = "\\\\.\\pipe\\" + pipe_name;
8887
std::string attempt_name;
8988
HANDLE pipe = INVALID_HANDLE_VALUE;
90-
int connect_attempts_remaining = 6;
89+
9190
while (connect_attempts_remaining-- > 0 &&
9291
pipe == INVALID_HANDLE_VALUE) {
9392
pipe_number = 0;
@@ -108,15 +107,13 @@ int main(int argc, char *argv[]) {
108107
}
109108
if (pipe == INVALID_HANDLE_VALUE) {
110109
printf("Could not open named pipe!");
111-
while (true) Sleep(100);
112110
return 1;
113111
}
114112
DWORD mode = PIPE_READMODE_MESSAGE;
115113
auto success = SetNamedPipeHandleState(pipe, &mode, NULL, NULL);
116114
if (!success) {
117115
CloseHandle(pipe);
118116
printf("Could not configure named pipe!");
119-
while (true) Sleep(100);
120117
return 1;
121118
}
122119

@@ -126,10 +123,9 @@ int main(int argc, char *argv[]) {
126123
if (!success || written < payload.size()) {
127124
printf("Failed to write to named pipe!");
128125
CloseHandle(pipe);
129-
while (true) Sleep(100);
130126
return 1;
131127
}
128+
132129
CloseHandle(pipe);
133-
while (true) Sleep(100);
134130
return 0;
135131
}

src/elgato-cloud-window.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,9 @@ extern void InitElgatoCloud(obs_module_t *module)
808808
obs_log(LOG_INFO, "version: %s", "0.0.4");
809809

810810
elgatoCloud = new ElgatoCloud(module);
811-
QAction *action = (QAction *)obs_frontend_add_tools_menu_qaction(
812-
"Elgato Marketplace");
813-
action->connect(action, &QAction::triggered, OpenElgatoCloudWindow);
811+
//QAction *action = (QAction *)obs_frontend_add_tools_menu_qaction(
812+
// "Elgato Marketplace");
813+
//action->connect(action, &QAction::triggered, OpenElgatoCloudWindow);
814814
}
815815

816816
extern obs_data_t *GetElgatoCloudConfig()

src/platform.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ bool listen_on_pipe(const std::string &pipe_name,
200200
}
201201

202202
Sleep(100);
203-
obs_log(LOG_INFO, "Connecting...");
203+
obs_log(LOG_INFO, "Connecting... to %s", attempt_name.c_str());
204204
bool connected = ConnectNamedPipe(pipe, NULL);
205205
if (!connected && GetLastError() == ERROR_PIPE_CONNECTED) {
206206
connected = true;
@@ -209,7 +209,7 @@ bool listen_on_pipe(const std::string &pipe_name,
209209
std::string buffer;
210210

211211
if (connected) {
212-
obs_log(LOG_INFO, "Connected");
212+
obs_log(LOG_INFO, "Connected to %s", attempt_name.c_str());
213213
while (true) {
214214
buffer.resize(2048);
215215
DWORD read_count = 0;
@@ -327,4 +327,4 @@ std::string move_file_safe(const std::string &from, const std::string &to)
327327
} while (!move_file(from, newDst));
328328

329329
return newDst;
330-
}
330+
}

src/plugin-module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bool obs_module_load(void)
7373
auto config = elgatocloud::GetElgatoCloudConfig();
7474
bool makerTools = obs_data_get_bool(config, "MakerTools");
7575
obs_data_release(config);
76-
if (makerTools) {
76+
if (makerTools || true) {
7777
obs_frontend_add_tools_menu_item("Export Marketplace Scene",
7878
export_collection, NULL);
7979
obs_frontend_add_tools_menu_item("Import Marketplace Scene",

0 commit comments

Comments
 (0)