The MultiplayerSessions plugin provides comprehensive tools to handle multiplayer sessions in your Unreal Engine 5 projects.
- MultiplayerSessionSubsystem: This subsystem offers functionality for creating, finding, joining, destroying, and starting multiplayer sessions.
- Menu UserWidget: An easy-to-integrate widget to manage your multiplayer session interactions, including host and join buttons.
- OnlineSubsystem Integration: Designed to work seamlessly with UE's OnlineSubsystem and OnlineSubsystemSteam, facilitating multiplayer functionalities.
Ensure you have the OnlineSubsystem
and OnlineSubsystemSteam
plugins enabled in your project.
- Copy the
MultiplayerSessions
plugin folder into your project'sPlugins
directory. - Rebuild your project.
- Enable the plugin from the Edit -> Plugins menu in the UE5 editor.
CreateSession(int32 NumPublicConnections, FString MatchType)
: Initiates session creation.FindSession(int32 MaxSearchResults)
: Starts the process to find available sessions.JoinSession(const FOnlineSessionSearchResult& SessionResult)
: Allows a player to join a specific session.DestroySession()
: Terminates the current session.StartSession()
: Starts the current session, making it active.
MenuSetup(int32 NumPublicConnections, FString TypeOfMatch, FString LobbyPath)
: Set up the menu with the desired parameters.BPMenuTearDown()
: Blueprint callable function to tear down the menu.
HostButton
: Button for the player to host a new session.JoinButton
: Button for the player to join an existing session.ResumeButton
: Blueprint-implemented button allowing players to resume their current session.QuitButton
: Blueprint-implemented button allowing players to exit the game.
There are custom callbacks for the MultiplayerSubsystem, which you can override or bind to in Blueprints, such as OnCreateSession
, OnFindSession
, OnJoinSession
, OnDestroySession
, and OnStartSession
.
Ensure that you include dependencies on OnlineSubsystem
, OnlineSubsystemSteam
, Slate
, SlateCore
, and UMG
in your project build settings.
- This plugin is designed with the Steam OnlineSubsystem in mind. Adjustments may be required for other platforms.
- Ensure you handle failed session operations appropriately in your project.
Feel free to fork and submit pull requests for any enhancements or bug fixes. Your contributions are appreciated.
This code is released as open-source. You are free to use, modify, and distribute it without seeking additional permissions or giving credit to the author. Use at your own risk.