InitializeSimpl first. See Setup.
Calls
In C++, every call is a method onUSimplClientSubsystem. Each one takes an optional last argument: a function that runs when the call is done. Blueprints get the same calls as nodes. See Blueprints.
“Host only” means only the lobby’s host can do it. Other players get the error NOT_HOST.
The queue and match calls are on Queues and matches.
Player state
Player state is a small set of values you send when you create or join a lobby. Queue rules read it. In C++ it is aTMap<FString, FSimplStateValue>. A value can be a string, a number, a bool, a list of strings, a list of numbers, or JSON text.
Numbers are 32-bit floats. Keep IDs as strings.
UpdatePlayerState takes the new state and a bMerge flag. It is on by default, so the new values are added to your old ones. Other players do not get an event when your state changes. They see it the next time their lobby is read.
Team and role are set by the queue. Only members of the lobby can see them.
Browse lobbies
BrowseLobbies takes a queue ID, a status, a region, a limit, an offset and a sort. The plugin only sends the ones you fill in.
Limitis at most 100.Sortcan becreated_at_desc,created_at_ascorplayer_count_desc.- The answer has the lobbies, a
Totaland abHasMoreflag.
What the plugin does for you
- One lobby at a time. Creating, joining or reconnecting leaves the current lobby first.
OnLobbyLeftfires for that. - Version tag. It adds
version_tagto your state if you did not. - Joining a lobby you are already in.
JoinLobbyreconnects you instead of failing. - Keeping the lobby fresh. It listens for live events and also reads the lobby on a timer. See Events.
- Retries. It retries
TRY_AGAIN. See Errors.
What you must save yourself
The plugin keeps the lobby ID in memory only.GetLastLobbyId returns it. If you want to reconnect after your game restarts, save the lobby ID and the player ID yourself. After the restart, call InitializeSimpl with the same player ID, then ReconnectToLobby with the saved lobby ID.