From 94273a45498733eb27384c64e18808b9468b0f1d Mon Sep 17 00:00:00 2001 From: qydysky Date: Thu, 18 Jan 2024 06:43:29 +0800 Subject: [PATCH] =?utf8?q?Fix=20=E7=9B=B4=E6=92=AD=E4=BF=A1=E6=81=AF?= =?utf8?q?=E8=A2=AB=E9=94=99=E8=AF=AF=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/Msg.go | 1 + Reply/stream.go | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Reply/Msg.go b/Reply/Msg.go index 67cf031..a258e96 100644 --- a/Reply/Msg.go +++ b/Reply/Msg.go @@ -17,6 +17,7 @@ var msglog = c.C.Log.Base(`Msg`) // Msg类型数据处理方法map var Msg_map = map[string]func(replyF, string){ + `PK_BATTLE_SETTLE_NEW`: nil, `LIKE_GUIDE_USER`: nil, //主播@你:点点赞支持一下我吧 `ROOM_LOCK`: replyF.room_lock, //房间封禁提示 `DM_INTERACTION`: nil, //他们都在说 diff --git a/Reply/stream.go b/Reply/stream.go index de86003..d3f19c9 100644 --- a/Reply/stream.go +++ b/Reply/stream.go @@ -1272,22 +1272,16 @@ func (t *M4SStream) Start() bool { ms.getSavepath() - var ( - cp = ms.Current_save_path - st = ms.stream_type - cr = ms.common.Roomid - ) - l := ms.log.Base_add(`文件保存`) startf := func(_ *M4SStream) error { l.L(`T: `, `开始`) return nil } - stopf := func(_ *M4SStream) error { + stopf := func(ms *M4SStream) error { // savestate { var pathInfo paf - fj := file.New(cp+"0.json", 0, true) + fj := file.New(ms.Current_save_path+"0.json", 0, true) if fj.IsExist() { if data, err := fj.ReadAll(1<<18, 1<<20); err != nil && !errors.Is(err, io.EOF) { l.L(`E: `, err) @@ -1300,12 +1294,12 @@ func (t *M4SStream) Start() bool { pathInfo.Uname = ms.common.Uname pathInfo.UpUid = ms.common.UpUid pathInfo.Roomid = ms.common.Roomid - pathInfo.Format = st + pathInfo.Format = ms.stream_type pathInfo.Qn = c.C.Qn[ms.common.Live_qn] pathInfo.Name = ms.common.Title pathInfo.EndT = time.Now().Format(time.DateTime) pathInfo.StartLiveT = ms.common.Live_Start_Time.Format(time.DateTime) - pathInfo.Path = path.Base(cp) + pathInfo.Path = path.Base(ms.Current_save_path) if pathInfoJson, err := json.Marshal(pathInfo); err != nil { l.L(`E: `, err) } else if _, err := fj.Write(pathInfoJson, true); err != nil { @@ -1322,6 +1316,12 @@ func (t *M4SStream) Start() bool { l.L(`W: `, err) } + var ( + cp = ms.Current_save_path + st = ms.stream_type + cr = ms.common.Roomid + ) + // savestate { fj := file.New(cp+"0.json", 0, true) -- 2.39.2