From e8c1fc39eccf977c702b1932252075cdc3eeed95 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 30 Jul 2023 19:42:41 +0800 Subject: Add Danmaku decode CLI tool --- danmaku/dmpkg/package.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'danmaku/dmpkg') diff --git a/danmaku/dmpkg/package.go b/danmaku/dmpkg/package.go index 51c769a..639bde8 100644 --- a/danmaku/dmpkg/package.go +++ b/danmaku/dmpkg/package.go @@ -31,6 +31,11 @@ func (e *DanmakuExchange) String() string { e.Length, e.ProtocolVer, e.Operation, e.Body) } +func (e *DanmakuExchange) PrettyString() string { + return fmt.Sprintf("DanmakuExchange{length=%v, protocol=%v, operation=%v, body=%v}", + e.Length, e.ProtocolVer, e.Operation.String(), string(e.Body)) +} + const ( HeaderLength = 16 SequenceId = 1 -- cgit v1.2.3