# Filtering own lobby from lobby search result 

**URL:** <https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185>\
**Category:** Multiplayer\
**Tags:** epic-online-services, question\
**Created:** [January 8, 2025, 1:43pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185 "2025-01-08T13:43:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [January 8, 2025, 1:43pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/1 "2025-01-08T13:43:30Z")

</div>

I was trying to do a lobby search while the local player was already in a lobby, and I was confused because I was getting a search result for my own session, but the LobbyOwnerUserId field was 0. I mistakenly assumed that this field was not being set properly for any search results and I couldn’t really use it.

Until I realized, “maybe 0 is a special value and it means it’s owned by the local player”. And that proved to be exactly the case, even though that is not stated anywhere in the documentation.

I’m just posting this in case anyone else runs into this strange undocumented implementation detail.

---

<div class="post-metadata">

**Author:** ![SebBergy2.0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sebbergy2.0/32/1214708_2.png) [@SebBergy2.0](https://forums.unrealengine.com/u/SebBergy2.0)\
**Post date:** [January 8, 2025, 3:19pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/2 "2025-01-08T15:19:19Z")

</div>

Hello, which version of the EOS SDK are you using? I tried to reproduce this using the Lobbies sample with the most recent version (1.16.4), and the LobbyOwnerUserId field is correctly set when searching for a lobby the current player is the owner of. I modified the sample with the code below to confirm.

```auto
static char LobbyOwnerId[EOS_PRODUCTUSERID_MAX_LENGTH + 1];
int32_t Size = sizeof(LobbyOwnerId);
EOS_EResult Result = EOS_ProductUserId_ToString(LobbyInfo->LobbyOwnerUserId, LobbyOwnerId, &Size);
if (Result != EOS_EResult::EOS_Success)
{
	FDebugLog::LogError(L"Lobbies: failed to retrive LobbyOwnerId. Error code: %ls", FStringUtils::Widen(EOS_EResult_ToString(Result)).c_str());
}

```

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [January 8, 2025, 4:24pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/3 "2025-01-08T16:24:02Z")

</div>

Hi, I’m using the version bundled with Unreal Engine 5.4, which appears to be 1.16.3.

Is it possible in your sample code that EOS\_ProductUserId\_ToString is converting a value of 0 to the string representation of the local user’s product user id?

---

<div class="post-metadata">

**Author:** ![SebBergy2.0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sebbergy2.0/32/1214708_2.png) [@SebBergy2.0](https://forums.unrealengine.com/u/SebBergy2.0)\
**Post date:** [January 8, 2025, 7:19pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/4 "2025-01-08T19:19:28Z")

</div>

Hello, I debugged through EOS\_ProductUserId\_ToString and the value stored at the memory address for LobbyOwnerUserId is not 0. In your code, how are you identifying that the value is 0? Can you share a code snippet? Thanks!

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [January 8, 2025, 9:39pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/5 "2025-01-08T21:39:53Z")

</div>

I went through it with the debugger. It was always 0x00000000 for the lobby I owned, and another, valid value for sessions hosted by anyone else.

I don’t have a code snippet per se, but I just stepped through FOnlineSessionEOS::AddLobbySearchResult and looked at LobbyDetailsInfo after it was fetched with EOS\_LobbyDetails\_CopyInfo

---

<div class="post-metadata">

**Author:** ![SebBergy2.0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sebbergy2.0/32/1214708_2.png) [@SebBergy2.0](https://forums.unrealengine.com/u/SebBergy2.0)\
**Post date:** [January 9, 2025, 4:00pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/6 "2025-01-09T16:00:06Z")

</div>

I wonder if there is a timing issue here as I don’t see this on my end in AddLobbySearchResult either:

 ![LobbySearchResult](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/c/c/0cc9b3c0ce844d64235fa7004cffd504c4c7df5b.png)

If you have specific steps to reproduce, let us know!

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [January 9, 2025, 6:44pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/7 "2025-01-09T18:44:25Z")

</div>

These are our EOSSettings:

 ![image.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/4/a64bea314a654e8f25df2c3fd1e9053986c7ba5c.png)

To repro I’m simply doing a lobby search while having an active lobby.

Here’s a screenshot from the debugger:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/8/0b8d2b5d14beb94ab620cd9121acaf153b9dd15b.png)

Again, the LobbyOwnerUserId does show a valid id when the lobby is created by some other player, but it shows up like this for the one I created.

---

<div class="post-metadata">

**Author:** ![SebBergy2.0](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sebbergy2.0/32/1214708_2.png) [@SebBergy2.0](https://forums.unrealengine.com/u/SebBergy2.0)\
**Post date:** [January 10, 2025, 2:14pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/8 "2025-01-10T14:14:09Z")

</div>

Thanks for sharing those screenshots. Yes, I’m testing on the same instance, creating a lobby and then searching for it. In your last screenshot, there is something odd. AvailableSlots should be at 3, not 4 as the lobby owner counts against the number of members in the lobby. Before doing the lobby search, but after creating the lobby, can you confirm that you can see the Lobby in the developer portal?

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [January 10, 2025, 7:45pm UTC](https://forums.unrealengine.com/t/filtering-own-lobby-from-lobby-search-result/2858185/9 "2025-01-10T19:45:29Z")

</div>

I noticed that we were doing something weird in the widget blueprint that was invoking the search only a little while before you responded.

The problem was that widget blueprint was calling a function that destroyed the local session immediately before calling up the search. I guess EOS returns a null owner id for lobbies that are being destroyed, and that explains what I was seeing.

After removing the call to destroy the session before searching, I began seeing another issue, but that’s from FOnlineSessionEOS, so not relevant to EOS itself. When resolving the unique net id for the search result corresponding to my lobby, it was fetching the session info only for the named session, and not the search result, so I was getting a null OwningUserId on the search result.

I modified FOnlineSessionEOS so it properly set the unique net id for both the named session and the search result, and now I can finally compare with the local user id.
