chore: comment cleanup pass ahead of open-sourcing
Removes leftover debug scaffolding (stray Console.WriteLine/NSLog traces, dead nick_buf_ptr, a no-op --print-config flag now implemented for real), fixes stale/misleading comments (channel passwords are no longer a "future M5+" feature, a wrong cross-reference, a stale TlsContext::close() mention, an incomplete BanRecord::subject_type doc, and a smoke test pointing at a build/m1-dev preset that no longer exists), strips internal M1-M5 milestone jargon from comments now that the roadmap is done, trims comments that just restated the following line, and consolidates a few "why" explanations that were duplicated 2-3 times in the same file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ public enum VcConnectionState
|
||||
TlsHandshake = 2,
|
||||
Authenticating = 3,
|
||||
Connected = 4,
|
||||
/// <summary>M4: handshake succeeded, waiting on vc_confirm_server_identity().</summary>
|
||||
/// <summary>Handshake succeeded, waiting on vc_confirm_server_identity().</summary>
|
||||
VerifyingIdentity = 5,
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ public enum VcEventType
|
||||
TalkState = 9,
|
||||
Error = 10,
|
||||
Disconnected = 11,
|
||||
/// <summary>M4: reply to VoiceCatClient.JoinChannelAsync's underlying vc_join_channel.</summary>
|
||||
/// <summary>Reply to VoiceCatClient.JoinChannelAsync's underlying vc_join_channel.</summary>
|
||||
JoinResult = 12,
|
||||
/// <summary>M4: the TOFU server-identity gate — see VcTofuStatus.</summary>
|
||||
/// <summary>The TOFU server-identity gate — see VcTofuStatus.</summary>
|
||||
ServerIdentity = 13,
|
||||
/// <summary>M5: async result for moderation/admin/channel operations.</summary>
|
||||
/// <summary>Async result for moderation/admin/channel operations.</summary>
|
||||
GenericResult = 14,
|
||||
/// <summary>M5: reply to VoiceCatClient.RequestAccountList — call ListAccounts() to read.</summary>
|
||||
/// <summary>Reply to VoiceCatClient.RequestAccountList — call ListAccounts() to read.</summary>
|
||||
AccountList = 15,
|
||||
/// <summary>Voice-plane subscription state. u32a = 1 (subscribed) or 0 (unsubscribed).</summary>
|
||||
VoiceState = 16,
|
||||
|
||||
@@ -148,7 +148,7 @@ internal static partial class NativeMethods
|
||||
[LibraryImport(LibName)]
|
||||
internal static partial void vc_free_device_list(ref VcDeviceListNative list);
|
||||
|
||||
// ── M4: channel / user / stream snapshot getters ────────────────────────────────────────
|
||||
// ── Channel / user / stream snapshot getters ────────────────────────────────────────────
|
||||
[LibraryImport(LibName)]
|
||||
internal static partial VcResult vc_list_channels(nint c, out VcChannelListNative outList);
|
||||
|
||||
@@ -168,7 +168,7 @@ internal static partial class NativeMethods
|
||||
[LibraryImport(LibName)]
|
||||
internal static partial void vc_free_stream_summary_list(ref VcStreamSummaryListNative list);
|
||||
|
||||
// ── M4: TOFU server-identity gate ───────────────────────────────────────────────────────
|
||||
// ── TOFU server-identity gate ───────────────────────────────────────────────────────────
|
||||
[LibraryImport(LibName)]
|
||||
internal static partial VcResult vc_confirm_server_identity(nint c, int accept);
|
||||
|
||||
@@ -176,7 +176,7 @@ internal static partial class NativeMethods
|
||||
internal static partial VcResult vc_get_server_identity_display(nint c, nint outBuf,
|
||||
nuint bufCap, out nuint outLen);
|
||||
|
||||
// ── M5: Moderation & admin ─────────────────────────────────────────────────────────────
|
||||
// ── Moderation & admin ───────────────────────────────────────────────────────────────────
|
||||
[LibraryImport(LibName, StringMarshalling = StringMarshalling.Utf8)]
|
||||
internal static partial VcResult vc_kick_user(nint c, uint userId, string? reason);
|
||||
|
||||
|
||||
@@ -95,10 +95,6 @@ public sealed class VoiceCatClient : IDisposable
|
||||
|
||||
internal void EnqueueEvent(VoiceCatEvent ev)
|
||||
{
|
||||
// Temporary diagnostic (manual debugging session) — confirms the native callback
|
||||
// chain (UnmanagedCallersOnly -> GCHandle resolve -> here) actually fires, independent
|
||||
// of whether the UI-thread drain (PumpEvents) ever sees it.
|
||||
Console.WriteLine($"[VoiceCatClient] EnqueueEvent (native thread): {ev}");
|
||||
_events.Writer.TryWrite(ev);
|
||||
}
|
||||
internal void EnqueueLevel(uint streamId, float rms) => _latestLevels[streamId] = rms;
|
||||
@@ -116,7 +112,7 @@ public sealed class VoiceCatClient : IDisposable
|
||||
public VcResult AuthenticateUser(string username, string password) =>
|
||||
NativeMethods.vc_authenticate_user(_handle.DangerousGetHandle(), username, password);
|
||||
|
||||
// ── TOFU server-identity gate (M4) ──────────────────────────────────────────────────────
|
||||
// ── TOFU server-identity gate ───────────────────────────────────────────────────────────
|
||||
public VcResult ConfirmServerIdentity(bool accept) =>
|
||||
NativeMethods.vc_confirm_server_identity(_handle.DangerousGetHandle(), accept ? 1 : 0);
|
||||
|
||||
@@ -143,9 +139,7 @@ public sealed class VoiceCatClient : IDisposable
|
||||
|
||||
// ── Channels ─────────────────────────────────────────────────────────────────────────
|
||||
/// <summary>Result arrives as a VcEventType.JoinResult event, not via this return value
|
||||
/// (which only reflects "request queued" — see voicecat.h's vc_join_channel doc comment).
|
||||
/// NOTE: no in-tree channel has a server-side password to check yet (M5+ feature) — this
|
||||
/// path is wired but not yet exercisable end-to-end.</summary>
|
||||
/// (which only reflects "request queued" — see voicecat.h's vc_join_channel doc comment).</summary>
|
||||
public VcResult JoinChannel(uint channelId, string? password = null) =>
|
||||
NativeMethods.vc_join_channel(_handle.DangerousGetHandle(), channelId, password);
|
||||
|
||||
@@ -290,7 +284,7 @@ public sealed class VoiceCatClient : IDisposable
|
||||
public VcResult SetPcmSink(nint cb, IntPtr user) =>
|
||||
NativeMethods.vc_set_pcm_sink(_handle.DangerousGetHandle(), cb, user);
|
||||
|
||||
// ── M5: Moderation & admin ───────────────────────────────────────────────────────────
|
||||
// ── Moderation & admin ───────────────────────────────────────────────────────────────
|
||||
public VcResult KickUser(uint userId, string? reason = null) =>
|
||||
NativeMethods.vc_kick_user(_handle.DangerousGetHandle(), userId, reason);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user