diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 6484066..bdd537a 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -25,8 +25,8 @@ function(setup_nodejs) set(NODEJS_VERSION "v7.1.2") #set(NODEJS_VERSION "v8.0.0") - #set(NODEJS_URL "https://nodejs.org/download/release/") - #set(NODEJS_VERSION "v12.7.0") + #set(NODEJS_URL "https://nodejs.org/download/release/") + #set(NODEJS_VERSION "v12.14.1") find_package(NodeJS REQUIRED) diff --git a/native/dns/CMakeLists.txt b/native/dns/CMakeLists.txt index 8ff2ab1..20b0324 100644 --- a/native/dns/CMakeLists.txt +++ b/native/dns/CMakeLists.txt @@ -21,6 +21,6 @@ if (WIN32) target_link_libraries(${MODULE_NAME} ${LIBEVENT_STATIC_LIBRARIES} Ws2_32.lib Ntdll.lib Dnsapi.lib) target_link_libraries(DNS-Test ${LIBEVENT_STATIC_LIBRARIES} Ws2_32.lib Ntdll.lib Dnsapi.lib) else() - target_link_libraries(${MODULE_NAME} unbound::static ${LIBEVENT_STATIC_LIBRARIES} pthread) + target_link_libraries(${MODULE_NAME} unbound::static ${LIBEVENT_STATIC_LIBRARIES} pthread) target_link_libraries(DNS-Test unbound::static ssl crypto ${LIBEVENT_STATIC_LIBRARIES} pthread) endif() \ No newline at end of file diff --git a/native/dns/src/resolver_linux.cpp b/native/dns/src/resolver_linux.cpp index 5df85c8..6eee816 100644 --- a/native/dns/src/resolver_linux.cpp +++ b/native/dns/src/resolver_linux.cpp @@ -92,8 +92,7 @@ void Resolver::resolve_dns(const char *name, const rrtype::value &rrtype, const request->register_event = evuser_new(this->event.base, [](evutil_socket_t, short, void *_request) { auto request = static_cast(_request); - - auto errc = ub_resolve_event(request->resolver->ub_ctx, request->host.c_str(), (int) request->rrtype, (int) request->rrclass, (void*) request, [](void* _request, int a, void* b, int c, int d, char* e) { + auto errc = ub_resolve_event(request->resolver->ub_ctx, request->host.c_str(), (int) request->rrtype, (int) request->rrclass, (void*) request, [](void* _request, int a, void* b, int c, int d, char* e, int) { auto request = static_cast(_request); request->resolver->ub_callback(request, a, b, c, d, e); }, &request->ub_id); diff --git a/native/serverconnection/src/audio/AudioInput.cpp b/native/serverconnection/src/audio/AudioInput.cpp index f3159c8..0af838f 100644 --- a/native/serverconnection/src/audio/AudioInput.cpp +++ b/native/serverconnection/src/audio/AudioInput.cpp @@ -113,7 +113,7 @@ void AudioInput::stop() { lock_guard lock(this->input_stream_lock); if(this->input_stream) { if(Pa_IsStreamActive(this->input_stream)) - Pa_StopStream(this->input_stream); + Pa_AbortStream(this->input_stream); } } @@ -121,7 +121,7 @@ void AudioInput::close_device() { lock_guard lock(this->input_stream_lock); if(this->input_stream) { if(Pa_IsStreamActive(this->input_stream)) - Pa_StopStream(this->input_stream); + Pa_AbortStream(this->input_stream); auto error = Pa_CloseStream(this->input_stream); if(error != paNoError) diff --git a/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp b/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp index a74b663..f3e1176 100644 --- a/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp +++ b/native/serverconnection/src/connection/ProtocolHandlerPackets.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include "audio/VoiceConnection.h" #include "../logger.h" @@ -35,9 +34,6 @@ void ProtocolHandler::handlePacketCommand(const std::shared_ptr friend inline std::shared_ptr<_Tp> std::static_pointer_cast(const std::shared_ptr<_Up>& __r) noexcept; friend class VoiceConnection; diff --git a/native/serverconnection/test/js/main.ts b/native/serverconnection/test/js/main.ts index 9078eff..7c81765 100644 --- a/native/serverconnection/test/js/main.ts +++ b/native/serverconnection/test/js/main.ts @@ -10,7 +10,7 @@ const os = require('os'); import * as fs from "fs"; const original_require = require; -require = (module => original_require("/home/wolverindev/TeaSpeak-Client/client/native/build/linux_x64/" + module + ".node")) as any; +require = (module => original_require(__dirname + "/../../../build/linux_x64/" + module + ".node")) as any; import * as handle from "teaclient_connection"; require = original_require; @@ -29,7 +29,7 @@ const stream = handle.audio.playback.create_stream(); console.log("Own stream: %o", stream); -for(let i = 0; i < 12; i++) { +for(let i = 0; i < 12 && false; i++) { const recorder = handle.audio.record.create_recorder(); for(const device of handle.audio.available_devices()) { if(!device.input_supported) @@ -141,10 +141,10 @@ connection.callback_disconnect = reason => { const do_connect = () => { connection.connect({ timeout: 5000, - remote_port: 9987, + remote_port: 9988, //remote_host: "188.40.240.20", /* twerion */ - //remote_host: "localhost", - remote_host: "ts.teaspeak.de", + remote_host: "localhost", + //remote_host: "ts.teaspeak.de", //remote_host: "51.68.181.92", //remote_host: "94.130.236.135", //remote_host: "54.36.232.11", /* the beast */ @@ -206,7 +206,7 @@ const do_connect = () => { }; connection.callback_command = (command, arguments1, switches) => { - console.log("Command: %s", command); + console.log("Command: %s: %0", command, arguments1); } connection._voice_connection.register_client(7); @@ -219,8 +219,10 @@ connection.callback_voice_data = (buffer, client_id, codec_id, flag_head, packet }; setInterval(() => { - console.log("GC"); - global.gc(); + if("gc" in global) { + console.log("GC"); + global.gc(); + } }, 1000); let a_map = [consumer, recorder];