Migrate to VoidLibrary (toolchain + API groundwork)
This commit is contained in:
1 parent
5e1e3d66c4
commit
e17cfed56f
38 files changed
+3077
-2505
No files matched your search
@@ -0,0 +1,81 @@
|
||||
#pragma once
|
||||
|
||||
#include "PluginTypes.hpp"
|
||||
#include "Types.hpp"
|
||||
#include <expected>
|
||||
#include <filesystem>
|
||||
#include <functional>
|
||||
#include <future>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Echoion::Api
|
||||
{
|
||||
|
||||
// Forward declarations
|
||||
class IPluginInterface;
|
||||
using PluginInterfacePtr = std::shared_ptr<IPluginInterface>;
|
||||
|
||||
// Plugin interface that the Core will use
|
||||
// MINIMAL VERSION - only depends on Types.hpp and PluginTypes.hpp
|
||||
// NO dependencies on TrackTypes, ConfigTypes, RpcTypes, etc.
|
||||
class IPluginInterface
|
||||
{
|
||||
public:
|
||||
|
||||
virtual ~IPluginInterface() = default;
|
||||
|
||||
// Lifecycle
|
||||
virtual Result<void> initialize() = 0;
|
||||
virtual Result<void> shutdown() = 0;
|
||||
|
||||
// Client operations
|
||||
[[nodiscard]] virtual Result<std::vector<ClientInfo>>
|
||||
getClients() = 0;
|
||||
[[nodiscard]] virtual Result<std::optional<ClientInfo>>
|
||||
getClient(uint64_t clientId) = 0;
|
||||
virtual Result<void> moveClient(uint64_t clientId,
|
||||
uint64_t channelId) = 0;
|
||||
virtual Result<void> kickClient(uint64_t clientId,
|
||||
const std::string& reason) = 0;
|
||||
|
||||
// Channel operations
|
||||
[[nodiscard]] virtual Result<std::vector<ChannelInfo>>
|
||||
getChannels() const = 0;
|
||||
[[nodiscard]] virtual Result<std::optional<ChannelInfo>>
|
||||
getChannel(uint64_t channelId) const = 0;
|
||||
|
||||
// Messaging
|
||||
virtual Result<void>
|
||||
sendTextMessage(uint64_t targetId,
|
||||
const std::string& message) = 0;
|
||||
virtual Result<void>
|
||||
sendChannelMessage(uint64_t channelId,
|
||||
const std::string& message) = 0;
|
||||
virtual Result<void>
|
||||
sendServerMessage(const std::string& message) = 0;
|
||||
|
||||
// Audio
|
||||
virtual Result<void>
|
||||
sendAudioData(const std::span<const short>& data) = 0;
|
||||
virtual Result<void>
|
||||
setWhisperList(const std::vector<uint64_t>& clientIds) = 0;
|
||||
|
||||
// Server connection
|
||||
// ServerConfig is defined in PluginTypes.hpp (self-contained)
|
||||
virtual Result<void>
|
||||
connectToServer(const ServerConfig& config) = 0;
|
||||
virtual Result<void> disconnectFromServer() = 0;
|
||||
[[nodiscard]] virtual bool isConnected() const = 0;
|
||||
virtual Result<void> reconnect() = 0;
|
||||
|
||||
// Event subscription
|
||||
virtual void
|
||||
registerEventCallback(const EventCallback& callback) = 0;
|
||||
virtual void
|
||||
unregisterEventCallback(const EventCallback& callback) = 0;
|
||||
};
|
||||
|
||||
} // namespace Echoion::Api
|
||||
Reference in new issue
Block a user