Files
voice-cat/core/src/session/session.h

56 lines
1.3 KiB
C
Raw Normal View History

/*
* session/session.h domain model: channels, users, streams, permissions, text.
*
* Design: docs/protocol.md §5, docs/architecture.md §5. Shared by client (local mirror of
* server state) and server (authoritative). Text is ephemeral (no history). Accounts are
* admin-provisioned.
*
* STATUS: M0 stub.
*/
#ifndef VOICECAT_SESSION_SESSION_H
#define VOICECAT_SESSION_SESSION_H
#include <cstdint>
#include <string>
#include <vector>
namespace voicecat::session {
struct Channel {
uint32_t id = 0;
uint32_t parent_id = 0;
std::string name;
bool password_protected = false;
uint32_t max_users = 0;
};
struct Stream {
uint32_t stream_id = 0;
uint32_t ssrc = 0;
int kind = 0; // vc_stream_kind
std::string label;
};
struct User {
uint32_t id = 0;
std::string nickname;
bool is_guest = true;
uint32_t channel_id = 0;
std::vector<Stream> streams;
};
// Mirror/authority for the channel tree + user list. TODO(M1): snapshot + delta apply.
class SessionModel {
public:
const std::vector<Channel>& channels() const { return channels_; }
const std::vector<User>& users() const { return users_; }
private:
std::vector<Channel> channels_;
std::vector<User> users_;
};
} // namespace voicecat::session
#endif // VOICECAT_SESSION_SESSION_H