]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
观看人数显示新增数量
authorqydysky <qydysky@foxmail.com>
Sat, 7 May 2022 16:43:26 +0000 (00:43 +0800)
committerqydysky <qydysky@foxmail.com>
Sat, 7 May 2022 16:43:26 +0000 (00:43 +0800)
Reply/Reply.go

index a99e95fabab45b6a6539ac93f8be2f09d3f181eb..1f876cf08f80f92701f172e4fa9eea3ca7c81258 100644 (file)
@@ -321,8 +321,9 @@ func (replyF) user_toast_msg(s string) {
 
 //HeartBeat-心跳用来传递人气值
 var (
-       renqi_old  int
-       continuity int
+       renqi_old   int
+       watched_old int
+       continuity  int
 )
 
 func (replyF) heartbeat(s int) {
@@ -331,7 +332,8 @@ func (replyF) heartbeat(s int) {
                return
        } //人气为1,不输出
        var (
-               tmp string
+               tmp  string
+               tmp2 string
        )
        if renqi_old != 0 {
                if s > renqi_old {
@@ -355,12 +357,15 @@ func (replyF) heartbeat(s int) {
                }
                tmp = `(` + tmp + `)`
        }
-
+       if watched_old != 0 {
+               tmp2 += `(+` + strconv.Itoa(c.C.Watched-watched_old) + `)`
+       }
        if renqi_old != s {
-               fmt.Printf("\t人气:%d %s\t观看人数:%d\n", s, tmp, c.C.Watched)
+               fmt.Printf("\t人气:%d %s\t观看人数:%d %s\n", s, tmp, c.C.Watched, tmp2)
        }
        reply_log.Base_add(`人气`).Log_show_control(false).L(`I: `, "当前人气", s)
        renqi_old = s
+       watched_old = c.C.Watched
 }
 
 //Msg-房间特殊活动