Download

Advanced Sessions Plugin

This is true (tested on PC-Steam and PS4)

What I said? Or that that neither event is currently working?

What you said.
On Session Invite Accepted event works Ok in PC-Steam and PS4. Event On Session Invite Received event is never received.
Sorry for the confusion :s

Thats fine, and thanks for the confirmation. There are a lot of artists and new engine users using the plugin so I get a ton of misinformation about what does/doesn’t work. I should resurrect a dead project and use it just to compile out test copies for multiple computers to make sure everything is fine across engine changes.

Thanks for the hard work mordentral!

I’m working on releasing an example project.

Any ideas why FindFriendSession causes a crash when searching the UniqueNetID of a player who is on the main screen? (No CreateAdvancedSessions started.) It doesn’t crash if the players are playing the game.

The crash only happens when a player is in the main menu and that player UniqueNetID is called by FindFriendSession. If the player is in the game it doesn’t cause an issue.

I’ve tried three different systems and both in-editor and built copies. Mismatched BuildID’s? I wonder why would it only happen in the main menu. (Where no session has been created yet.) I’ve tried a lot of things before taking your time. I’m not sure if it’s a bug.

That last friend “metahusk” is the Steam user that is sitting on the main menu.

Thanks!

edit: I built a new copy of the game. The built copies that match won’t crash on FindFriendSession hitting a Steam user sitting on the main menu but if I open the in editor Standalone Game it does crash.

Its attempting to allocate uint64_MAX worth of memory when searching for many friend sessions during a loop? ok…

Can you show me a SS of your loop? I have the function pulled up but can’t get down to testing it for a couple of hours but it looks like they are creating a unique net id manually for people out of a lobby. Regardless FindFriendSession shouldn’t be called on someone in the menu, they aren’t actually in a session at the time, but it should fail gracefully, not have memory corruption.

Edit You know what? I totally forgot to initialize Friend.PresenceInfo in the “GetFriend” function…

It contains the following:


	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
		bool bIsOnline;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
		bool bIsPlaying;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
		bool bIsPlayingThisGame;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
		bool bIsJoinable;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
		bool bHasVoiceSupport;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
		TEnumAsByte<EBPOnlinePresenceState::Type> PresenceState;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Online|Friend")
		FString StatusString;

Which should allow you to fully define whether they are joinable and their current status. I had some of the presence settings exposed to their own variables but I will fill out the entire presence structure, like “IsJoinable” which would be a big help here…

Thanks for the fast reply. I’m at work right now. I can take a screenshot later. No hurry… I know supporting things can be a lot of work. Friend.PresenceInfo discovering if they are joinable would be a great!

Edit: It’s strange it only crashes in the editor. I imagine detecting if they are joinable first will fix the problem.

It was only the “GetFriend” function that was missing the Presence information. GetStoredFriendsList and GetFriendsList both return the correct presence and you should be able to check “bIsJoinable” and “bIsPlayingSameGame”.

Also the steam function FindFriendSession already checks to see if they are actually in game or not. I would like that screenshot when possible, I can’t find a problem in the code itself so far.

Edit Unless it has to do with this:


				else
				{
					// Search for the session via host ip
					TSharedRef<FInternetAddr> IpAddr = ISocketSubsystem::Get()->CreateInternetAddr(FriendGameInfo.m_unGameIP, FriendGameInfo.m_usGamePort);
					CurrentSessionSearch->QuerySettings.Set(FName(SEARCH_STEAM_HOSTIP), IpAddr->ToString(true), EOnlineComparisonOp::Equals);

					FOnlineAsyncTaskSteamFindServer* NewTask = new FOnlineAsyncTaskSteamFindServer(SteamSubsystem, SearchSettings, LocalUserNum, OnFindFriendSessionCompleteDelegates[LocalUserNum]);
					SteamSubsystem->QueueAsyncTask(NewTask);
				}

If the player isn’t in a session then it tries to find a server by the players session IP instead, i’ll see if steam ever passes in a NULL for an ip.

Edit 2

Welp, no clue anymore, there is some funky **** going on in the steam subsystem


TSharedRef<FInternetAddr> FSocketSubsystemSteam::CreateInternetAddr(uint32 Address, uint32 Port)
{
	FInternetAddrSteam* SteamAddr = new FInternetAddrSteam();
	return MakeShareable(SteamAddr);
}

When making the search for the ip based game it uses that function, which doesn’t end up using the passed in address and port at all… The default socketsubsystem uses them but it is calling the SocketSubsystemSteams implementation instead so the port and ip are just 0.

Long story short, I think the steam subsystem has some real problems in it and you should just check if they are playing a game and are joinable before getting their session information. I will upload a new version that has the GetFriendInfo having the full presence information after I run a debug test to make sure it actually calls that function.

Uploaded the GetFriend Node Fix for presence

That was way fast. Thanks, I will just check if they are playing and are joinable before getting their session information. I will take a look at it when I get off work.

The crash problem strangely didn’t manifest again with engine version 4.12 and your current build from 06-21-2016. I was on 4.11 previously. I wonder if some things were fixed by Epic between those releases.

I had trouble getting “bIsJoinable” to report correctly? Maybe I was implementing it wrong. “bIsPlayingSameGame” did work though. I used a different solution to overcome friends showing in the server browser when sitting in the main menu. I used a check to see if UniqueBuildID != 0 to filter out the “menu player” results. Maybe not the best solution but it seems to work for now.

I will attach screenshots of my bp nodes below.

Thanks!

Here are screenshots from my progress so far.

Friends browser
friends-list.PNG

Server browser
server-browser.PNG

Fetch list of friends
construct-fetch-friends2.PNG

Fetch friend’s avatars
fetch-avatars.PNG

Fetch friend’s sessions
fetch-friends-sessions.PNG

Crude loop counter for controlling the session fetching (better method anyone?)
fetch-friends-session-loop-count.PNG

Clears list and refreshes everything
clear-refresh-friends-list.PNG

Builds the list of friends that are in sessions.
build-session-list-objects.PNG

Mmmmm, it returns an empty session result on failure to retrieve currently, i’m adding a IsValidSession() node to check if a session is valid or not and also will change that to return FAILED if there was no valid session instead of returning an empty session. So the GetFriendSession with throw “OnFailure” now if the returned session is empty instead of returning “OnSuccess” and having an empty session attached.

It was originally just returning the result of the SteamCall.

Edit Uploaded with the more correct results from GetFriendSession and the IsValidSession Node.

Is this error in the log related to the plugin?
LogVoiceEncode:Error: StopLocalVoiceProcessing: Ignoring stop request for non-owning user
I used the AdvandcedFriendsGameInstance as a parent, but have not setup anything voice related yet.

Also why does the ping return 9999, is this intended when the session is on a LAN?

Thanks for the awesome Plugin :slight_smile:

No its not, and 9999 is an engine bug that is slated to be fixed soon hopefully.

Hi mordentral,
I have a some problems with your plugin.

  1. The game can’t find any sessions. Find Sessions Advanced is always returns an empty array, and I don’t know why, because my friend is created a game session.
  2. My friend invited me, but I also can’t connect to the game and this is what my Log file says:
    [2016.06.29-11.29.45:617][561]LogOnline:Warning: Async task ‘FOnlineAsyncTaskSteamJoinLobby bWasSuccessful: 0 Session: Game LobbyId: Lobby [0x186000089DCC514] Result: ‘3’ k_EChatRoomEnterResponseNotAllowed (General Denied - You don’t have the permissions needed to join the chat)’ failed in 0.391433 seconds

P.S. Also I have a messages like this:



[2016.06.29-11.29.12:915][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 10000017 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 10000017 value 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 1000003c 14
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 1000003c value 14
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 1000003d 262144
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 1000003d value 262144
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 10000050 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 10000050 value 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 10000052 1000
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 10000052 value 1000
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 10000088 124
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 10000088 value 124
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 10000089 2
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 10000089 value 2
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 1000008a -2
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 1000008a value -2
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 1000008b -883284736
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 1000008b value -883284736
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 1000008c 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 1000008c value 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 1000008d 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 1000008d value 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 100000aa 2
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 100000aa value 2
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 2000003b 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 2000003b value 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 20000083 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 20000083 value 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 20000084 0
[2016.06.29-11.29.12:916][480]LogOnline:Warning: STEAM: Failed to parse setting from key 20000084 value 0
[2016.06.29-11.29.12:917][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 20000085 0
[2016.06.29-11.29.12:917][480]LogOnline:Warning: STEAM: Failed to parse setting from key 20000085 value 0
[2016.06.29-11.29.12:917][480]LogOnline:Warning: Unknown or unsupported data type from Steam key data 20000086 0
[2016.06.29-11.29.12:917][480]LogOnline:Warning: STEAM: Failed to parse setting from key 20000086 value 0


What version of the engine are you using? Can you post a screenshot of your blueprint?

Edit: I’m pretty sure friend invites are broken for now until it’s fixed in a future engine release. I got friend search and join to work.

Those warnings are because of using the generic APP ID for Steam, it is filtering out other peoples games from the returned list for you and notifying you about it. I can’t help with your finding problems without seeing your blueprints.

The engine version is 4.12.3 (I had the same problem with the 4.10.4 and just converted my project) And of course I can show you my blueprints.
Creating the game session:
bp1.jpg
Searching for game sessions (resulting array length is always zero):
8ef37afa93a978a8de643c3484bc59747e9d1e46.jpeg
And here’s inviting friend to the game:
bp3.jpg

I hope this will help you.

Where is your friend located? App ID 480 is region locked so if he is across country bounds it may be blocking you two from seeing each other.

I say this because generally your implementation looks correct and that exact same issue has come up a million times here.