diff --git a/github b/github index 989bdd6..279544d 160000 --- a/github +++ b/github @@ -1 +1 @@ -Subproject commit 989bdd62182ba2d4ad040c4177d3ab72eb10e408 +Subproject commit 279544d0a48ab5236755d6d2ba47d6d23d31f749 diff --git a/jenkins/create_build.sh b/jenkins/create_build.sh index 5a08647..90ac2ea 100755 --- a/jenkins/create_build.sh +++ b/jenkins/create_build.sh @@ -122,5 +122,5 @@ function deploy_client() { #install_npm #compile_scripts #compile_native -#package_client +package_client deploy_client diff --git a/modules/renderer/connection/ServerConnection.ts b/modules/renderer/connection/ServerConnection.ts index 47148de..60eb797 100644 --- a/modules/renderer/connection/ServerConnection.ts +++ b/modules/renderer/connection/ServerConnection.ts @@ -38,6 +38,8 @@ interface ErrorCodeListener { class ErrorCommandHandler extends AbstractCommandHandler { private readonly handle: ServerConnection; + private serverType: "teaspeak" | "teamspeak"; + private errorCodeMapping: {[key: string]: ErrorCodeListener} = {}; private errorCodeHistory: ErrorCodeListener[] = []; @@ -46,6 +48,7 @@ class ErrorCommandHandler extends AbstractCommandHandler { constructor(handle: ServerConnection) { super(handle); this.handle = handle; + this.serverType = "teaspeak"; } generateReturnCode(command: string, callback: (result: CommandResult) => void, returnCode?: string) : string { @@ -115,6 +118,9 @@ class ErrorCommandHandler extends AbstractCommandHandler { if(command.arguments[0]["teaspeak"] == true) { console.log("Using TeaSpeak identity type"); this.handle.handshake_handler().startHandshake(); + this.serverType = "teaspeak"; + } else { + this.serverType = "teamspeak"; } return true; } else if(command.command == "initivexpand2") { @@ -128,7 +134,11 @@ class ErrorCommandHandler extends AbstractCommandHandler { clearTimeout(listener.timeout); } - this.handle.getRtcConnection().doInitialSetup(); + if(this.serverType === "teaspeak") { + this.handle.getRtcConnection().doInitialSetup(); + } else { + this.handle.getRtcConnection().setNotSupported(); + } this.errorCodeMapping = {}; } else if(command.command == "notifyconnectioninforequest") { this.handle.send_command("setconnectioninfo", diff --git a/modules/shared/version/index.ts b/modules/shared/version/index.ts index 7a0e735..909f3e4 100644 --- a/modules/shared/version/index.ts +++ b/modules/shared/version/index.ts @@ -59,7 +59,7 @@ export class Version { } isDevelopmentVersion() : boolean { - return this.build == 0 && this.major == 0 && this.minor == 0 && this.patch == 0 && this.timestamp == 0; + return this.build == 0 && this.major == 0 && this.minor == 0 && this.patch == 0; } } diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt index 73d17e0..b7618de 100644 --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt @@ -21,11 +21,11 @@ message("Module path: ${CMAKE_MODULE_PATH}") #Setup NodeJS function(setup_nodejs) set(NodeJS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") - set(NODEJS_URL "https://atom.io/download/atom-shell") - set(NODEJS_VERSION "v8.0.0") + #set(NODEJS_URL "https://atom.io/download/atom-shell") + #set(NODEJS_VERSION "v8.0.0") - #set(NODEJS_URL "https://nodejs.org/download/release/") - #set(NODEJS_VERSION "v12.13.0") + set(NODEJS_URL "https://nodejs.org/download/release/") + set(NODEJS_VERSION "v12.13.0") find_package(NodeJS REQUIRED) diff --git a/native/serverconnection/src/bindings.cpp b/native/serverconnection/src/bindings.cpp index b17217a..63fb8af 100644 --- a/native/serverconnection/src/bindings.cpp +++ b/native/serverconnection/src/bindings.cpp @@ -70,8 +70,8 @@ tc::audio::AudioOutput* global_audio_output; Nan::Set(object, (uint32_t) value, Nan::New(key).ToLocalChecked()); NAN_MODULE_INIT(init) { - logger::initialize_node(); - //logger::initialize_raw(); + //logger::initialize_node(); + logger::initialize_raw(); #ifndef WIN32 logger::info(category::general, tr("Hello World from C. PPID: {}, PID: {}"), getppid(), getpid()); diff --git a/native/serverconnection/test/js/flood.ts b/native/serverconnection/test/js/flood.ts index 85200ff..2b0fb03 100644 --- a/native/serverconnection/test/js/flood.ts +++ b/native/serverconnection/test/js/flood.ts @@ -24,6 +24,7 @@ class Bot { private _timeouts = []; reset() { + this.connection?.disconnect("reset", () => {}); this.connection = undefined; for(const interval of this.switchInterval) clearInterval(interval); @@ -31,7 +32,7 @@ class Bot { clearInterval(timeouts); } - connect() { + connect(callbackConnected?: () => void) { this.knwonChannelIds = []; this.client_id = 0; this.initialized = false; @@ -42,6 +43,10 @@ class Bot { remote_port: port, remote_host: host, callback: error => { + if(callbackConnected) { + callbackConnected(); + } + if(error == 0) { this.connection.send_command("clientinit", [ { @@ -95,8 +100,9 @@ class Bot { if(command == "initserver") { this.client_id = parseInt(args[0]["aclid"]); } else if(command == "channellistfinished"){ + this.disconnect(); this.initialized = true; - this.switchInterval.push(setInterval(() => this.switch_channel(), 30_000 + Math.random() * 10_000)); + this.switchInterval.push(setInterval(() => this.switch_channel(), 10_000 + Math.random() * 5_000)); } else if(command == "channellist") { for(const element of args) { this.knwonChannelIds.push(parseInt(element["cid"])); @@ -121,22 +127,26 @@ class Bot { } -const bot_list: Bot[] = []; +const botList: Bot[] = []; async function connectBots() { - for(let index = 0; index < 5; index++) { + for(let index = 0; index < 1 || true; index++) { const bot = new Bot(); - bot_list.push(bot); - bot.connect(); + botList.push(bot); + await new Promise(resolve => bot.connect(resolve)); - await new Promise(resolve => setTimeout(resolve, 10_000)); + await new Promise(resolve => setTimeout(resolve, 1000)); + while(botList.length > 50) { + const [ bot ] = botList.splice(0, 1); + bot.reset(); + } } } setInterval(() => { - bot_list.forEach(connection => { + botList.forEach(connection => { if(connection.connection) { - connection.connection.send_voice_data(new Uint8Array([1, 2, 3]), 5, false); + //connection.connection.send_voice_data(new Uint8Array([1, 2, 3]), 5, false); } else { connection.connect(); }