From 91773a51e14d27f12b4ddae4eeb55cbaea761db3 Mon Sep 17 00:00:00 2001 From: qydysky Date: Wed, 12 Jul 2023 16:16:40 +0800 Subject: [PATCH] =?utf8?q?Add=20wsmsg=20=E8=8D=A3=E8=80=80=E7=AD=89?= =?utf8?q?=E7=BA=A7=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Reply/Msg.go | 1 + Reply/Reply.go | 12 ++++++++++++ Reply/ws_msg/WEALTH_NOTIFY.go | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 Reply/ws_msg/WEALTH_NOTIFY.go diff --git a/Reply/Msg.go b/Reply/Msg.go index bbf3153..a50d932 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){ + `WEALTH_NOTIFY`: replyF.wealth_notify, //荣耀等级提示 `LOG_IN_NOTICE`: replyF.log_in_notice, //登录提示 `HOT_BUY_NUM`: nil, `VOICE_JOIN_ROOM_COUNT_INFO`: replyF.voice_join_room_count_info, //连麦等待 diff --git a/Reply/Reply.go b/Reply/Reply.go index a43700b..643c7a4 100644 --- a/Reply/Reply.go +++ b/Reply/Reply.go @@ -100,6 +100,18 @@ func (replyF) defaultMsg(s string) { msglog.Base_add("Unknow").L(`E: `, s) } +// 荣耀等级提示 +func (replyF) wealth_notify(s string) { + msglog := msglog.Base_add("房") + var j ws_msg.WEALTH_NOTIFY + if e := json.Unmarshal([]byte(s), &j); e != nil { + msglog.L(`E: `, e) + return + } + Gui_show(fmt.Sprintf("当前荣耀等级 %d", j.Data.Info.Level), `0room`) + msglog.L(`I: `, fmt.Sprintf("当前荣耀等级 %d", j.Data.Info.Level)) +} + // 登录提示 func (replyF) log_in_notice(s string) { msglog := msglog.Base_add("房") diff --git a/Reply/ws_msg/WEALTH_NOTIFY.go b/Reply/ws_msg/WEALTH_NOTIFY.go new file mode 100644 index 0000000..9f93dbd --- /dev/null +++ b/Reply/ws_msg/WEALTH_NOTIFY.go @@ -0,0 +1,18 @@ +package part + +type WEALTH_NOTIFY struct { + Cmd string `json:"cmd"` + Data struct { + Flag int `json:"flag"` + Info struct { + EffectKey int `json:"effect_key"` + HasItemsChanged int `json:"has_items_changed"` + Level int `json:"level"` + SendTime int64 `json:"send_time"` + Status int `json:"status"` + } `json:"info"` + } `json:"data"` + IsReport bool `json:"is_report"` + MsgID string `json:"msg_id"` + SendTime int64 `json:"send_time"` +} -- 2.39.2