From 05891cb07ef09460bb12387bde06d38b93111241 Mon Sep 17 00:00:00 2001 From: hujiebin Date: Mon, 24 Jul 2023 16:41:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81socket=E7=9A=84=E9=BA=A6?= =?UTF-8?q?=E4=BD=8D=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocol/userProxy.proto | 4 ++-- rpc/user_center_func.go | 49 ++++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/protocol/userProxy.proto b/protocol/userProxy.proto index 2ac061e..8ebe490 100644 --- a/protocol/userProxy.proto +++ b/protocol/userProxy.proto @@ -437,7 +437,7 @@ message GroupMicChange { bool forbid = 5; bool micForbid = 6; string externalId = 7; - string agoraId = 8; + uint32 agoraId = 8; int64 timestamp = 9; MicUserData user = 10; } @@ -459,7 +459,7 @@ message MicUserData { string headwearPicUrl = 9; string headwearEffectUrl = 10; string headwearReverseEffectUrl = 11; - int32 svipLevel = 12; + uint32 svipLevel = 12; string micEffect = 14; string headwearIcon = 15; } diff --git a/rpc/user_center_func.go b/rpc/user_center_func.go index 09ff348..9c3d472 100644 --- a/rpc/user_center_func.go +++ b/rpc/user_center_func.go @@ -400,33 +400,34 @@ func SendSvipUpgrade(nick, avatar string, svipLevel uint32, txGroupId string) er } // 发送socket的麦位变化 -// todo fix -func SendSocketMicChange(userId uint64) error { +func SendSocketMicChange(userId uint64, externalId, txGroupId string, i uint32, lock, forbid, micForbid bool, agoraId uint32, + avatar, nick string, sex uint32, code string, isVip bool, noble uint32, headwearPicUrl, headwearEffectUrl, headwearReverseEffectUrl string, + svipLevel uint32, micEffect, headwearIcon string) error { var msg = &userProxy.GroupMicChange{ - SeqId: "todo", - GroupId: "todo", - I: 1, - Lock: true, - Forbid: false, - MicForbid: false, - ExternalId: "1234", - AgoraId: "todotodo", + SeqId: "todo", // todo todo + GroupId: txGroupId, + I: i, + Lock: lock, + Forbid: forbid, + MicForbid: micForbid, + ExternalId: externalId, + AgoraId: agoraId, Timestamp: time.Now().Unix(), User: &userProxy.MicUserData{ - Id: 1, - ExternalId: "", - Avatar: "", - Nick: "", - Sex: 0, - Code: "", - IsVip: false, - Noble: 0, - HeadwearPicUrl: "", - HeadwearEffectUrl: "", - HeadwearReverseEffectUrl: "", - SvipLevel: 0, - MicEffect: "", - HeadwearIcon: "1231", + Id: userId, + ExternalId: externalId, + Avatar: avatar, + Nick: nick, + Sex: sex, + Code: code, + IsVip: isVip, + Noble: noble, + HeadwearPicUrl: headwearPicUrl, + HeadwearEffectUrl: headwearEffectUrl, + HeadwearReverseEffectUrl: headwearReverseEffectUrl, + SvipLevel: svipLevel, + MicEffect: micEffect, + HeadwearIcon: headwearIcon, }, } if buffer, err := proto.Marshal(msg); err == nil { -- 2.22.0