void UtrnetDemoGameInstance::StartOnlineGame() { // Creating a local player where we can get the UserID from ULocalPlayer* const Player = GetFirstGamePlayer(); // Call our custom HostSession function. GameSessionName is a GameInstance variable HostSession(Player->GetPreferredUniqueNetId(), GameSessionName, true, true, 4); }
// Host Speicific Map void URadeGameInstance::StartOnlineGameMap(FString MapName, int32 MaxPlayerNumber) { // Creating a local player where we can get the UserID from ULocalPlayer* const Player = GetFirstGamePlayer(); //Player->GetPreferredUniqueNetId() TheMapName = MapName; // Call our custom HostSession function. GameSessionName is a GameInstance variable HostSession(Player->GetPreferredUniqueNetId(), GameSessionName, TheMapName, true, true, MaxPlayerNumber); }
// Host Default Map void URadeGameInstance::StartOnlineGame() { // Creating a local player where we can get the UserID from ULocalPlayer* const Player = GetFirstGamePlayer(); TheMapName = "BattleArena"; // Call our custom HostSession function. GameSessionName is a GameInstance variable HostSession(Player->GetPreferredUniqueNetId(), *PlayerName, TheMapName, true, true, 16); }