Some updates

This commit is contained in:
WolverinDEV 2020-02-02 17:51:06 +01:00
parent a2b33fb11b
commit 3dcfad1038
7 changed files with 17 additions and 20 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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<dns_request*>(_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<dns_request*>(_request);
request->resolver->ub_callback(request, a, b, c, d, e);
}, &request->ub_id);

View File

@ -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)

View File

@ -8,7 +8,6 @@
#include <tommath.h>
#include <misc/base64.h>
#include <misc/endianness.h>
#include <query/command2.h>
#include <protocol/Packet.h>
#include "audio/VoiceConnection.h"
#include "../logger.h"
@ -35,9 +34,6 @@ void ProtocolHandler::handlePacketCommand(const std::shared_ptr<ts::protocol::Se
} catch(const std::invalid_argument& ex) {
log_error(category::connection, tr("Failed to parse command (invalid_argument): {}"), ex.what());
return;
} catch(const ts::command_malformed_exception& ex) {
log_error(category::connection, tr("Failed to parse command (command_malformed_exception): {}@{}"), ex.what(), ex.index());
return;
} catch(const std::exception& ex) {
log_error(category::connection, tr("Failed to parse command (exception): {}"), ex.what());
return;

View File

@ -16,7 +16,7 @@ namespace tc {
namespace connection {
class VoiceConnection;
class VoiceSender : private event::EventEntry {
class VoiceSender : public event::EventEntry {
template<typename _Tp, typename _Up>
friend inline std::shared_ptr<_Tp> std::static_pointer_cast(const std::shared_ptr<_Up>& __r) noexcept;
friend class VoiceConnection;

View File

@ -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];