From e0a9a2b67348a3ab0a65f5159e39574ccbdd76ef Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 15 Sep 2023 23:12:55 +0800 Subject: [PATCH] 1 --- server/hallserver/proto/cs_proto.proto | 2 +- server/hallserver/room/roommgr.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/hallserver/proto/cs_proto.proto b/server/hallserver/proto/cs_proto.proto index 1796db42..6e9d67ba 100644 --- a/server/hallserver/proto/cs_proto.proto +++ b/server/hallserver/proto/cs_proto.proto @@ -201,7 +201,7 @@ message SMCreateRoom message CMSearchRoom { optional int64 since_id = 1; //为0时表示从第一条数据开始 - optional int32 room_id = 2; //房间id + optional string room_id = 2; //房间id } message SMSearchRoom diff --git a/server/hallserver/room/roommgr.go b/server/hallserver/room/roommgr.go index 8fce4ffb..cbb74e97 100644 --- a/server/hallserver/room/roommgr.go +++ b/server/hallserver/room/roommgr.go @@ -105,10 +105,14 @@ func (this *roomMgr) CMSearchRoom(hdr *f5.MsgHdr, msg *cs.CMSearchRoom) { rspMsg := cs.SMSearchRoom{} rspMsg.Rows = make([]*cs.MFRoom, 0, constant.SEARCH_ROOM_PAGE_SIZE) sinceId := msg.GetSinceId() + roomId := msg.GetRoomId() this.roomList.ForEach( func (data interface{}) bool { r := data.(*room) if r.roomIdx > sinceId && r.viewable() { + if roomId != "" && roomId != r.roomId { + return true + } pb := new(cs.MFRoom) r.fillMFRoom(pb) rspMsg.Rows = append(rspMsg.Rows, pb)