1 parent
cf48f2f350
commit
4a92d09e63
7 files changed
+571
-64
No files matched your search
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Echoion::Standalone
|
||||
{
|
||||
// Split TeamSpeak messages on UTF-8/line boundaries while preserving each
|
||||
// complete markdown-it `:::details ... :::` container in one message.
|
||||
[[nodiscard]] std::vector<std::string>
|
||||
chunkMessage(const std::string& message, std::size_t limit = 900);
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace Echoion::Standalone
|
||||
@@ -28,6 +29,7 @@ namespace Echoion::Standalone
|
||||
// required.
|
||||
struct StandaloneSettings {
|
||||
std::string identityPath; // where to load/persist the TS identity
|
||||
std::string avatarCachePath;
|
||||
int securityLevel = 8;
|
||||
int opusBitrate = 96000;
|
||||
};
|
||||
@@ -48,6 +50,15 @@ namespace Echoion::Standalone
|
||||
getClients() override;
|
||||
[[nodiscard]] Api::Result<std::optional<Api::ClientInfo>>
|
||||
getClient(uint64_t clientId) override;
|
||||
[[nodiscard]] Api::Result<std::optional<std::string>>
|
||||
getClientIp(uint64_t clientId) override;
|
||||
[[nodiscard]] Api::Result<std::optional<std::string>>
|
||||
getClientAvatarPath(uint64_t clientId) override;
|
||||
[[nodiscard]] Api::Result<std::optional<std::string>>
|
||||
getClientAvatarUrl(uint64_t clientId) override;
|
||||
[[nodiscard]] Api::Result<std::optional<std::string>>
|
||||
requestClientAvatar(uint64_t clientId,
|
||||
const std::string& destDir) override;
|
||||
Api::Result<void> moveClient(uint64_t clientId,
|
||||
uint64_t channelId) override;
|
||||
Api::Result<void> kickClient(uint64_t clientId,
|
||||
@@ -96,6 +107,10 @@ namespace Echoion::Standalone
|
||||
void broadcast(const Api::PluginEvent& event);
|
||||
void upsertClientGroup(const Protocol::CommandParams& p,
|
||||
bool emitConnected);
|
||||
void refreshClient(const Protocol::CommandParams& params);
|
||||
void loadInitialSnapshot();
|
||||
[[nodiscard]] Api::Result<void>
|
||||
commandResult(const Protocol::CommandResult& result) const;
|
||||
|
||||
StandaloneSettings settings_;
|
||||
std::unique_ptr<Protocol::Identity> identity_;
|
||||
@@ -108,7 +123,12 @@ namespace Echoion::Standalone
|
||||
mutable std::mutex mirrorMutex_;
|
||||
std::map<uint64_t, Api::ClientInfo> clients_;
|
||||
std::map<uint64_t, Api::ChannelInfo> channels_;
|
||||
std::map<uint64_t, std::string> clientIps_;
|
||||
std::map<uint64_t, std::string> avatarHashes_;
|
||||
std::map<uint64_t, std::string> avatarUrls_;
|
||||
std::map<uint64_t, std::string> avatarPaths_;
|
||||
std::vector<uint64_t> whisperList_;
|
||||
std::jthread snapshotThread_;
|
||||
|
||||
std::mutex cbMutex_;
|
||||
std::vector<Api::EventCallback> callbacks_;
|
||||
|
||||
Reference in new issue
Block a user