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)