Compare commits
No commits in common. "3072d2936ee353c6a06eca2dca2bf79dd2843bd7" and "2b3ee3316a2ab26665cca60564cbebd1f7fc9ce6" have entirely different histories.
3072d2936e
...
2b3ee3316a
4
.github/workflows/cd.yml
vendored
4
.github/workflows/cd.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: vcpkg install libsodium:x64-windows-static pthreads:x64-windows-static
|
run: vcpkg install libsodium:x64-windows pthreads:x64-windows
|
||||||
|
|
||||||
# setup vs env
|
# setup vs env
|
||||||
- uses: ilammy/msvc-dev-cmd@v1
|
- uses: ilammy/msvc-dev-cmd@v1
|
||||||
@ -29,7 +29,7 @@ jobs:
|
|||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
|
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
|
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "./states/send_start_sha1.hpp"
|
#include "./states/send_start_sha1.hpp"
|
||||||
#include "./states/receive_start_sha1.hpp"
|
#include "./states/receive_start_sha1.hpp"
|
||||||
#include "toxcore/tox.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sodium.h>
|
#include <sodium.h>
|
||||||
@ -213,26 +212,6 @@ bool ToxClient::iterate(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_rejoin_group_timer -= time_delta;
|
|
||||||
if (_rejoin_group_timer <= 0.f) {
|
|
||||||
_rejoin_group_timer = 6.f * 60.f;
|
|
||||||
std::cerr << "TCL rejoin timer!\n";
|
|
||||||
|
|
||||||
forEachGroup([this](const uint32_t group_number) {
|
|
||||||
// is connected or trying to connect
|
|
||||||
if (!tox_group_is_connected(_tox, group_number, nullptr)) {
|
|
||||||
std::cerr << "TCL disconnected group " << group_number << "\n";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// never seen another peer
|
|
||||||
if (_groups.at(group_number).empty()) {
|
|
||||||
tox_group_reconnect(_tox, group_number, nullptr);
|
|
||||||
std::cerr << "TCL reconnecting empty group " << group_number << "\n";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_tox_profile_dirty) {
|
if (_tox_profile_dirty) {
|
||||||
saveToxProfile();
|
saveToxProfile();
|
||||||
}
|
}
|
||||||
@ -270,20 +249,9 @@ void ToxClient::onToxSelfConnectionStatus(TOX_CONNECTION connection_status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (connection_status != TOX_CONNECTION::TOX_CONNECTION_NONE && !_join_group_after_dht_connect.empty()) {
|
if (connection_status != TOX_CONNECTION::TOX_CONNECTION_NONE && !_join_group_after_dht_connect.empty()) {
|
||||||
Tox_Err_Group_Join err;
|
// TODO: error checking
|
||||||
uint32_t new_group_number = tox_group_join(
|
tox_group_join(_tox, _join_group_after_dht_connect.data(), nullptr, 0, nullptr, 0, nullptr);
|
||||||
_tox,
|
|
||||||
_join_group_after_dht_connect.data(),
|
|
||||||
reinterpret_cast<const uint8_t*>(_self_name.data()), _self_name.size(),
|
|
||||||
nullptr, 0,
|
|
||||||
&err
|
|
||||||
);
|
|
||||||
if (err == TOX_ERR_GROUP_JOIN_OK) {
|
|
||||||
std::cout << "TCL joining group " << bin2hex(_join_group_after_dht_connect) << "\n";
|
std::cout << "TCL joining group " << bin2hex(_join_group_after_dht_connect) << "\n";
|
||||||
_groups[new_group_number] = {};
|
|
||||||
} else {
|
|
||||||
std::cerr << "TCL error joining group failed " << err << "\n";
|
|
||||||
}
|
|
||||||
_join_group_after_dht_connect.clear();
|
_join_group_after_dht_connect.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,6 @@ struct ToxClient {
|
|||||||
bool _tox_profile_dirty {false}; // set in callbacks
|
bool _tox_profile_dirty {false}; // set in callbacks
|
||||||
|
|
||||||
std::vector<uint8_t> _join_group_after_dht_connect;
|
std::vector<uint8_t> _join_group_after_dht_connect;
|
||||||
float _rejoin_group_timer {4.f * 60.f};
|
|
||||||
|
|
||||||
std::unique_ptr<StateI> _state;
|
std::unique_ptr<StateI> _state;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user