This commit is contained in:
aozhiwei 2023-09-15 23:12:55 +08:00
parent 80c258b4e1
commit e0a9a2b673
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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)