1#ifndef YAZE_APP_NET_COLLABORATION_SERVICE_H_
2#define YAZE_APP_NET_COLLABORATION_SERVICE_H_
8#include "absl/status/status.h"
55 absl::Status
Connect(
const std::string& host,
int port = 8765);
66 const std::string& session_name,
67 const std::string& username,
68 bool ai_enabled =
true);
74 const std::string& session_code,
75 const std::string& username);
86 const std::string& description,
87 const std::string& username);
93 const std::string& diff_data,
94 const std::string& rom_hash,
95 const std::string& sender);
101 const std::string& proposal_id,
102 const nlohmann::json& proposal_data,
103 const std::string& sender);
109 const std::string& proposal_id,
111 const std::string& username);
157 std::string
GenerateDiff(
const std::string& from_hash,
const std::string& to_hash);
158 absl::Status
ApplyDiff(
const std::string& diff_data);
The Rom class is used to load, save, and modify Rom data.
High-level service integrating version management with networking.
absl::Status LeaveSession()
std::unique_ptr< WebSocketClient > client_
absl::Status ApplyApprovedProposal(const std::string &proposal_id)
void OnProposalUpdated(const nlohmann::json &payload)
absl::Status VoteOnProposal(const std::string &proposal_id, bool approved, const std::string &username)
absl::Status HandleIncomingProposal(const std::string &proposal_id, const nlohmann::json &proposal_data, const std::string &sender)
absl::Status Initialize(const Config &config, RomVersionManager *version_mgr, ProposalApprovalManager *approval_mgr)
void OnProposalReceived(const nlohmann::json &payload)
void OnRomSyncReceived(const nlohmann::json &payload)
void SetAutoSync(bool enabled)
std::string last_sync_hash_
RomVersionManager * version_mgr_
absl::Status ApplyRomSync(const std::string &diff_data, const std::string &rom_hash, const std::string &sender)
absl::StatusOr< SessionInfo > GetSessionInfo() const
absl::Status SubmitChangesAsProposal(const std::string &description, const std::string &username)
ProposalApprovalManager * approval_mgr_
WebSocketClient * GetClient()
void OnParticipantJoined(const nlohmann::json &payload)
absl::Status Connect(const std::string &host, int port=8765)
absl::Status JoinSession(const std::string &session_code, const std::string &username)
absl::Status ApplyDiff(const std::string &diff_data)
absl::Status HostSession(const std::string &session_name, const std::string &username, bool ai_enabled=true)
void OnParticipantLeft(const nlohmann::json &payload)
std::string GenerateDiff(const std::string &from_hash, const std::string &to_hash)
Manages proposal approval workflow for collaborative sessions.
Manages ROM versioning, snapshots, and rollback capabilities.
WebSocket client for connecting to yaze-server.
Main namespace for the application.
bool require_approval_for_sync
bool create_snapshot_before_sync