Sein Lobby View Model
Class · USeinLobbyViewModel : UObject
#include "ViewModel/SeinLobbyViewModel.h"
Lobby state for UI binding: the slot list, the local player’s slot, ready counts, and the selected map. Bind On Lobby Changed to refresh your slot panel. Get the shared instance with Get Or Create Lobby View Model.
Functions
Section titled “Functions”Initialize
Section titled “Initialize”Binds the view model to a world and to the replicated lobby state. Call it from a widget’s Construct event, or use Get Or Create Lobby View Model, which does it for you.
void Initialize(UWorld* InWorld);Shutdown
Section titled “Shutdown”Releases the view model’s bindings. It runs automatically when the world ends.
void Shutdown();Get Slots
Section titled “Get Slots”A copy of the current lobby slots. Refreshes whenever the lobby changes.
const TArray<FSeinLobbySlotState>& GetSlots() const;Try Get Slot
Section titled “Try Get Slot”Find a slot by its index (1-based). Returns false if not present.
bool TryGetSlot(int32 SlotIndex, FSeinLobbySlotState& OutSlot) const;Get Local Slot
Section titled “Get Local Slot”The slot the local player holds. Neutral until the player’s connection to the lobby is ready.
FSeinPlayerID GetLocalSlot() const;Is Local Slot
Section titled “Is Local Slot”True if the given slot number (starting at 1) is the local player’s. Use it so a slot tile can ask whether it is you. False if the local player has no slot yet.
bool IsLocalSlot(int32 SlotIndex) const;Is Host
Section titled “Is Host”True if this machine hosts the lobby: a listen server, a dedicated server or a standalone game.
bool IsHost() const;Is In Lobby Session
Section titled “Is In Lobby Session”True when a network session is active and the local player holds a slot, meaning the lobby panel can be used. False in a standalone game and before hosting or joining. Use it to grey out the panel until the player hosts or joins.
bool IsInLobbySession() const;Can Start Match
Section titled “Can Start Match”True if this machine is the host and at least one slot is claimed by a connected human. Add further rules, such as everyone ready, in your own UI.
bool CanStartMatch() const;Has Published Match Snapshot
Section titled “Has Published Match Snapshot”True on the host once the lobby has been locked in for the match to start. Always false on clients.
bool HasPublishedMatchSnapshot() const;Is Local Ready
Section titled “Is Local Ready”Local PC’s slot ready-flag (false until the local relay arrives).
bool IsLocalReady() const;Get Ready Count
Section titled “Get Ready Count”Number of claimed slots that are ready. AI slots always count as ready. Pair with Get Claimed Count for a ready-over-total display.
int32 GetReadyCount() const;Get Claimed Count
Section titled “Get Claimed Count”Number of claimed slots, human and AI. Pair with Get Ready Count for a ready-over-total display.
int32 GetClaimedCount() const;Get Available Factions For Picker
Section titled “Get Available Factions For Picker”Every available faction, for a faction picker. Filter the list yourself to limit factions per match type.
TArray<TSoftObjectPtr<USeinFaction>> GetAvailableFactionsForPicker() const;Get Selected Map
Section titled “Get Selected Map”The map currently selected in the lobby. None until the lobby state arrives or if no map is selected.
TSoftObjectPtr<UWorld> GetSelectedMap() const;Get Available Maps
Section titled “Get Available Maps”The playable maps listed in the Net settings, with display name, slot count, team count and thumbnail. Use it to fill a map picker.
TArray<FSeinLobbyMapEntry> GetAvailableMaps() const;Is Map Shrink Safe
Section titled “Is Map Shrink Safe”True if selecting this map would not remove any claimed slot, meaning the host can pick it. Use it to disable map options that would be rejected.
bool IsMapShrinkSafe(const FSeinLobbyMapEntry& Candidate) const;Try Get Current Map Entry
Section titled “Try Get Current Map Entry”Looks up the selected map in the Net settings’ available maps and returns its full entry. False if no map is selected or it is not in the list.
bool TryGetCurrentMapEntry(FSeinLobbyMapEntry& OutEntry) const;Get Current Map Team Count
Section titled “Get Current Map Team Count”Number of teams on the selected map, for filling team pickers with 1 through that number. Returns 2 if no map is selected or it is not in the available maps.
int32 GetCurrentMapTeamCount() const;Event dispatchers
Section titled “Event dispatchers”On Lobby Changed
Section titled “On Lobby Changed”FOnLobbyChanged OnLobbyChanged
Fires when the lobby’s slots change. Bind it to refresh the slot panel.
On Local Slot Changed
Section titled “On Local Slot Changed”FOnLocalSlotChanged OnLocalSlotChanged · passes FSeinPlayerID NewLocalSlot
Fires when the local player’s slot changes. Use it to update the faction picker, the ready button and similar controls.