Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
scanline committed Oct 31, 2024
1 parent 932cb8a commit 7686d68
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ md ..\app\extensions\extVibrancy
g++.exe -std=c++11 -D_WEBSOCKETPP_CPP11_STL_ -DASIO_STANDALONE -D_WEBSOCKETPP_CPP11_THREAD_ -Os -I.\lib\ -c main.cpp -o obj\main.o
g++.exe -o ..\app\extensions\extVibrancy\bin.exe obj\main.o -s -static -lws2_32
```

Of course you can also get the compiled binary from [Releases](https://github.com/scanline/neutralinojs-ext-vibrancy/releases).

Now go back to the application and start it:
```batchfile
cd ../app
Expand Down
15 changes: 12 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include <fstream>
#include <stdio.h>
#include "lib/json/json.hpp"
#include "uuid.h"
#include "uuid.hpp"

#if _WIN32
#include "vibrancyWindows.h"
#include "vibrancyWindows.hpp"
#elif __linux__

#elif __APPLE__
Expand All @@ -27,7 +27,16 @@ int main()
cout << "Waiting for stdin..." << endl;
string stdInput = "";
cin >> stdInput;
json data = json::parse(stdInput);
json data;
try
{
data = json::parse(stdInput);
}
catch (json::parse_error& error)
{
cout << "Parse error at byte: " << error.byte << endl;
exit(0);
}

string idExtension = data["nlExtensionId"];
string port = data["nlPort"];
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 7686d68

Please sign in to comment.