# Course: The EOS Online Subsystem (OSS) Plugin

**URL:** <https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111>\
**Category:** Tutorial & Course Discussions\
**Tags:** unreal-engine\
**Created:** [May 25, 2023, 12:11pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111 "2023-05-25T12:11:09Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [May 25, 2023, 12:11pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/1 "2023-05-25T12:11:09Z")

</div>

This course is a walkthrough for integrating and using the Epic Online Services (EOS) Online Subsystem (OSS) plugin in Unreal Engine. The course was written for UE 5.1, though the code should work in future versions of UE, in UE 5.0 and in UE4.27.  
  
[https://dev.epicgames.com/community/learning/courses/1px/unreal-engine-the-eos-online-subsystem-oss-plugin](https://dev.epicgames.com/community/learning/courses/1px/unreal-engine-the-eos-online-subsystem-oss-plugin)

---

<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:** [May 25, 2023, 1:04pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/2 "2023-05-25T13:04:27Z")

</div>

If you get a 404 on the link, try signing-in first. We’re working on fixing this!

---

<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:** [May 25, 2023, 7:55pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/3 "2023-05-25T19:55:51Z")

</div>

The 404 issue should now be fixed!

---

<div class="post-metadata">

**Author:** ![uniwang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uniwang](https://forums.unrealengine.com/u/uniwang)\
**Post date:** [July 5, 2023, 2:33pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/4 "2023-07-05T14:33:43Z")

</div>

Hi, I have a question about presence search.  
I have set the bUsesPresence as False in FOnlineSessionSettings when creating session.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/8/d9878bb51949240878c240a31fc3979abd5f611f.png)  
But I found in the dedicated server log that it said AddAttribute named (PRESENCESEARCH) with value (), seems no value is passed to it.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/0/b6029f6d652f2415f031d9e11a8ca5abbcb029f2.png)  
And when I check the session in the DEV Portal, I see Join via Presence is enabled, also the PRESENCESEARCH\_b attribute is true.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/0/580badd80e103b7b893fc3f6a01f9eb0ad01df1f.png)  
Is it an issue?  
Thanks.

---

<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:** [July 17, 2023, 9:58pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/5 "2023-07-17T21:58:44Z")

</div>

This is NOT an issue. I didn’t explain this well at all in the code comments. With bShouldAdvertise set to true, this will supersede the bAllowJoinViaPresence and bAllowJoinViaPresenceFriendsOnly on our backend and set them to true. With bShouldAdvertise set to true, the session is public and can be found by anyone. Sorry for the confusion this caused.

---

<div class="post-metadata">

**Author:** ![fjardon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fjardon/32/571988_2.png) [@fjardon](https://forums.unrealengine.com/u/fjardon)\
**Post date:** [August 4, 2023, 8:48pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/6 "2023-08-04T20:48:50Z")

</div>

Hi,

I would like to report (small) errors in the documentation:

- in the chapter “Setting up a dedicated server to host EOS sessions”, the `DestroySession()` method is not provided. Instead we get a duplicate of the `EndPlay()` method.
- in the `HandleEndSessionCompleted()` method, we clear the “Start” delegate instead of the `End` delegate: `Session->ClearOnEndSessionCompleteDelegate_Handle(StartSessionDelegateHandle);`

Thanks

---

<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:** [August 7, 2023, 9:05pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/7 "2023-08-07T21:05:53Z")

</div>

Hey,

Thank you for reporting these issues! I just updated the course content. The GitHub repo will be updated soon. Just a heads up, there is a bug in UnregisterPlayer. You can find the explanation and fix here: [UnregisterPlayer() has a bug in it · Issue #14 · EpicGames/EOS-Getting-Started · GitHub](https://github.com/EpicGames/EOS-Getting-Started/issues/14)

Thanks again, and we really hope you found this course useful!

---

<div class="post-metadata">

**Author:** ![joaulo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/joaulo/32/464778_2.png) [@joaulo](https://forums.unrealengine.com/u/joaulo)\
**Post date:** [August 24, 2023, 9:08am UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/8 "2023-08-24T09:08:04Z")

</div>

HI! I just discovered this course, after weeks of banging my head against the wall to get the EOS OSS plugin working, too bad I didn’t see it sooner!  
Now I’m trying to implement **Leaderboards** and **Achievements** , and I see that should be the _next_ Topic of the course!  
Do you already have a **release date** planned for that chapter? 😃  
Thanks so much for this course, there is very little documentation on the subject online.

---

<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:** [August 24, 2023, 2:21pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/9 "2023-08-24T14:21:51Z")

</div>

It’s currently in review. I don’t have a precise ETA to share, but it should be coming out in the next few weeks. If ever you’re in a jam and need help before, you can open a ticket on our EOSHelp platform: [Epic Online Services (EOS) Developer Support](https://eoshelp.epicgames.com/s/?language=en_US)

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [September 5, 2023, 12:50pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/10 "2023-09-05T12:50:16Z")

</div>

Any particular reason you choose to handle the dedicated server stuff in the game-session instead of the game-instance class?

---

<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:** [September 6, 2023, 2:39pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/11 "2023-09-06T14:39:23Z")

</div>

We’ve just updated the content of this course and added sections for:

- EOS Stats, Achievements and Leaderboards
- EOS Player and Title Data Storage
- EOS P2P, Lobbies and Voice

---

<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:** [September 6, 2023, 2:51pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/12 "2023-09-06T14:51:46Z")

</div>

Yes there’s a few reason we opted for AGameSession over a UGameInstance. The project in this course is meant to be an example of a simple multiplayer game, where players join a session to play a match on the same map. Data isn’t persisted across sessions once a session is ended. In other words, the data is relevant to the session, not the entire game. The AGameSession is a nice wrapper around the session interface. As the EOS OSS uses this interface, you can leverage the functions, events, etc… in the base class or use overrides to tweak the behavior as needed (as I did in this course). Let us know if you have follow up questions.

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [September 10, 2023, 10:27pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/13 "2023-09-10T22:27:49Z")

</div>

I will have to go through this all again. At this moment I have dedicated servers running on PlayFAB but am using the Lyra Example Game as base. The register and update players part for me doesn’t seem to work as of now. And the backend says the servers are not active but they are (I can connect to them with the open {ip:port} command and get destroyed by the bots 😅

---

<div class="post-metadata">

**Author:** ![0dysseus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/0dysseus/32/1130446_2.png) [@0dysseus](https://forums.unrealengine.com/u/0dysseus)\
**Post date:** [September 12, 2023, 2:36am UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/14 "2023-09-12T02:36:57Z")

</div>

Hi SebBergy,

Thank you very much for this course! You mentioned in the course, “query stat and achievements,” if you have time, I am curious about how to query stat and achievements. Thanks again!

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [September 13, 2023, 9:12pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/15 "2023-09-13T21:12:06Z")

</div>

Any chance we could see a working session search for Dedicated Servers? It’s one of the few things that I can’t get to work.

> | | SessionSearch-\>bIsLanQuery = false; |
> | --- | --- |
> | | SessionSearch-\>QuerySettings.Set(FName(TEXT(DEDICATEDONLY)), true, EOnlineComparisonOp::Equals); |
> | | SessionSearch-\>QuerySettings.Set(FName(TEXT(LOBBYSEARCH)), false, EOnlineComparisonOp::Equals); |

Doesn’t seem to get me any results when trying to find my server.

Also any way to get more info when the server fails to register a player?

> LogTemp: Warning: Failed to register player! (From Callback)

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [September 17, 2023, 7:04pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/16 "2023-09-17T19:04:34Z")

</div>

Also for the register player. Doesn’t the UniqueID give the EOS string? (Epic account id + eos player user id (PUID with a | separator? Wouldn’t this always fail the register player part?)

---

<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:** [September 18, 2023, 9:09pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/17 "2023-09-18T21:09:10Z")

</div>

Hey! Yes, with Epic Account Services being used, the UniqueId is “EpicAccountId | EOS PUID”. In FOnlineSessionEOS::RegisterPlayers() we have some code that will retrieve the EOS PUID  
from the UniqueId and use this to register the player. If you’re running into an issue registering your player on the EOS backend, there should be a hint in your logs. You can also attach to your game and check the EOS\_EResult in Data-\>ResultCode in the CallbackObj.

I’m a bit confused by your code to search for a dedicated server session? Why do you have LOBBYSEARCH in your QuerySettings?

---

<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:** [September 18, 2023, 9:10pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/18 "2023-09-18T21:10:02Z")

</div>

I’ll update here with some code for both later this week!

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [September 18, 2023, 11:02pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/19 "2023-09-18T23:02:25Z")

</div>

Hi and thanks for responding, I already have it working 🙂 I split the string so I will get both the Epic Account ID and the Player PUID.

I have the servers working / hosted on PlayFAB all is working fine (except the search). I define LOBBYSEARCH false ? and Dedicated to true? Or should I simply omit the LOBBYSEARCH all together.?

---

<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:** [September 20, 2023, 9:01pm UTC](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111/20 "2023-09-20T21:01:58Z")

</div>

Here is some code for Stats. I’ll work on getting some code for achievements by end of week.

```auto
// Additional code to query stats - Example not included in course 
void AEOSPlayerState::QueryStats(TArray<FString> StatNames)
{
	// This function will query EOS Stats
	IOnlineSubsystem* Subsystem = Online::GetSubsystem(GetWorld());
	IOnlineIdentityPtr Identity = Subsystem->GetIdentityInterface();
	IOnlineStatsPtr Stats = Subsystem->GetStatsInterface();

	// Check if player is online before trying to update stat 
	FUniqueNetIdPtr NetId = Identity->GetUniquePlayerId(0);

	if (!NetId || Identity->GetLoginStatus(*NetId) != ELoginStatus::LoggedIn)
	{
		return;
	}

	// Same idea as UpdateStats, use an inline lambda - We are only querying for local player only in this example.
	// You need to pass in a list of StatNames. Querying for all stats is not supported. 

	TArray<TSharedRef<const FUniqueNetId>> Users;
	Users.Add(NetId.ToSharedRef());

	Stats->QueryStats(NetId.ToSharedRef(),Users, StatNames,
		FOnlineStatsQueryUsersStatsComplete::CreateLambda([](
			const FOnlineError& QueryResult,
			const TArray<TSharedRef<const FOnlineStatsUserStats>>& UsersStats)
			{
				if (!QueryResult.bSucceeded)
				{
					UE_LOG(LogTemp, Warning, TEXT("Error querying player statistics: %s"), *QueryResult.ErrorCode);
					return; 
				}

				// double loop to loop through all users and all stats
				for (auto UserStats : UsersStats)
				{
					// Account we are about to loop through stats
					FUniqueNetIdRef NetId = UserStats->Account;

					for (auto StatNameValuePair : UserStats->Stats)
					{
						FString StatName = StatNameValuePair.Key;
						FVariantData StatValue = StatNameValuePair.Value;
					}
				}
			}));
}

```

[Next page](https://forums.unrealengine.com/t/course-the-eos-online-subsystem-oss-plugin/1178111.md?page=2)
