Advanced Sessions Plugin

[QUOTE=;632672]
altnabla passed me along a link about the 9999 ping problem. http://www.aclockworkberry.com/ping-9999-issue-on-unreal-engine-steam-session-results/ He did fix the issue for another project but isn’t allowed to share the code. Maybe this will interest someone here? Have you seen this before ?

No I haven’t seen that, but it makes sense, that would be why when Epic tested sessions they got ping. They must have been testing over LAN instead of internet.

That being said, his manual handshake in there isn’t going to be implemented with this plugin considering how it would have to be done.

1 Like

Can anyone tell me how the host can get the session result?

When a client searches for a session, they get a list of session results and can join one of them. The client can then keep a reference to that session result and use it to query any extra settings on the session. However, when the host creates a session, they don’t get a session result returned back to them and from what I can tell, there doesn’t appear to be any nodes that the host can use to get the current session they are in. So how can the host query extra settings about their own session that they set when originally creating the session?

1 Like

[QUOTE=wilberolive;633569]
Can anyone tell me how the host can get the session result?

When a client searches for a session, they get a list of session results and can join one of them. The client can then keep a reference to that session result and use it to query any extra settings on the session. However, when the host creates a session, they don’t get a session result returned back to them and from what I can tell, there doesn’t appear to be any nodes that the host can use to get the current session they are in. So how can the host query extra settings about their own session that they set when originally creating the session?

The GetSessionSettings node may do what you are looking for.

1 Like

On the matter of friend invites:

  • Player 1 is located on a dedicated server at the time of sending the request while Player2 is sitting in the entry screen of the game.
  • Using the SteamOnlineSubModule and the SendSessionInviteToFriend player 1 sends a session invite to a Steam friend (player 2)
  • Player 2 sees the invite through the Steam Overlay
  • Player 1’s SendSessionInviteToFriend’s OnFailure fires
  • Player 2 attempts to join session through steam overlay
  • Player 2 this gets logged: LogOnline:Warning: STEAM: Invalid session or search already in progress when accepting invite. Ignoring invite request.

In my PlayerController class I’ve implemented the OnPlayerLoginStatusChanged function from the Advanced Friends Interface however I don’t think it ever gets called. Any suggestions?

1 Like

[QUOTE=Dr_Jerm;633580]
The GetSessionSettings node may do what you are looking for.

Indeed it is. Thank you kind sir.

I note however that it does not appear to work in PIE. Always hits the Failure pin when running in PIE. Only ever gives a result when running in standalone. I assume this is expected behaviour.

1 Like

I decided to investigate an easy way around the Steam listen server ping 9999 issue. I got pings working. I’ll release it with the Cardinal Menu System once some plugin issues with UE4.14 are ironed out.

What I did: Basically, I used VaRest to fetch the external IP of the host using REST and ipify.org and then I told Steam to broadcast the fetched IP with the server information. When the clients receive the list of the servers, they then use Descendent Studios’ PingPlugin to get the ping from the router of the host. (I don’t think PingPlugin supports 4.14 yet. I’ll release it once I get PingPlugin working with the new engine version.)

If ping response is disabled on the host’s router, the ping will display as a ?. Also, if the ping fails for some reason it will park the ping as a -.

If someone wants to work on a better method, I’m all ears. I’m using this way as an easy fix for now.

f3084611f6ed64ef4d3bca1f3c4cd55a7adea126.jpeg

1 Like

Ug, it creates a subclass and FRunnable for every detected server and the suggested method is to tick a timer and check each until resolve?

I like that one less than the mass packet mailer that averaged out response times and required subsystem changes.

1 Like

[QUOTE=;634382]
Ug, it creates a subclass and FRunnable for every detected server and the suggested method is to tick a timer and check each until resolve?

I like that one less than the mass packet mailer that averaged out response times and required subsystem changes.

Me too, but I don’t want to change a whole lot of things. I don’t want to put a lot of work into it only to run the risk of Epic putting the feature into the engine in the near future.

I’m trying to keep everything simple with using only blueprints and plugins so others can modify the project or use it to learn.

*Maybe I shouldn’t be posting this in this thread. I was just sharing information on the 9999 ping issue.

1 Like

[QUOTE=;634849]
Me too, but I don’t want to change a whole lot of things. I don’t want to put a lot of work into it only to run the risk of Epic putting the feature into the engine in the near future.

I’m trying to keep everything simple with using only blueprints and plugins so others can modify the project or use it to learn.

*Maybe I shouldn’t be posting this in this thread. I was just sharing information on the 9999 ping issue.

I mean, its fine to post is here, but most projects don’t actually need ping to player hosted servers, more so if they method of doing it directly exposes the servers IP without actually joining it. There is a lot of room for mass DDOS attack exploits if you are returning the hosts WAN address with results, steam returns a host ID instead normally.

1 Like

[QUOTE=;634925]
I mean, its fine to post is here, but most projects don’t actually need ping to player hosted servers, more so if they method of doing it directly exposes the servers IP without actually joining it. There is a lot of room for mass DDOS attack exploits if you are returning the hosts WAN address with results, steam returns a host ID instead normally.

Oh wow, I didn’t know it was that easy to DDOS attack the engine. I did some research on the subject. Interesting… a server will crash with enough invalid packets? Dang…

1 Like

Has anyone had success using the Recent Players functionality? Using steam with a custom appid.

1 Like

[QUOTE=looter;635414]
Has anyone had success using the Recent Players functionality? Using steam with a custom appid.

I haven’t had much success outside of the basic features with Steam the last time I tried. (Quite a few engine versions ago.)

1 Like

Hi, i’m trying to run my dedicated server with Steam using the plugin but i’m having the “0 current players” problem on update too and also sometimes when a player logs out from the server it becomes invisible from the in-game server browser, while Steam still shows it. What could i do in order to fix that? Restarting the system or changing the ports sometimes helps with the “invisible” issue. I’m using 4.13.2, thank you in advance.

1 Like

can some one help me out and send me a non google drive link?

edit: allright i could make a direct link by using the url ID from the link like this:

https://drive.google.com/uc?export=download&id=0B5cM3oP2O4-US092REpDNk4xNHc

1 Like

So it looks like steam is not setting the rich presence info “Joinable” correctly. bIsJoinable in Presence Info is never true, despite the join game option being available on steam itself. Has anyone else worked around this yet?

Update: Turns out UE4 never sets the Joinable presence info to true and its up to us. I ended up creating delegates for all of the session events in my game instance, along with some helper functions for working with steamworks on its own and got it all working. If you throw AdvancedSessions on github I’d be more than happy to help work on some Advanced Presence stuff that’d make all of this alot easier. Here’s the helper function I made, it requires you to include Steamworks in your project build file and the relevant header files in your game instance. The basic idea is to set Joinable to true after a successful JoinSession, CreateSession or StartSession, then set it to false on End/Destroy session. You’ll probably want to periodically check if the player count is reached in the session and set it back to false for all connected players.



bool UCGameInstance::SetRichPresence(FString Key, FString Value)
{
	ISteamFriends* SteamFriendsInt = SteamFriends();
	if (SteamFriendsInt != nullptr)
	{
		if (SteamFriendsInt->SetRichPresence(TCHAR_TO_UTF8(*Key), TCHAR_TO_UTF8(*Value)))
		{
			return true;
		}
	}

	return false;
}


1 Like

Hello,
My game is crashing after the use of the node “Create Advanced Session” , here is some lines fo the log.

[2016.12.27-17.05.32:499] 0]LogProperty:Error: Struct type unknown for property ‘StructProperty /Game/LoginContent/ServerMenu.ServerMenu_C:ExecuteUbergraph_ServerMenu.CallFunc_MakeLiteralSessionPropertyString_ReturnValue’; perhaps the USTRUCT() was renamed or deleted?

The node works good on editor preview , but the game crash if is a cooked game.

1 Like

I’m running into the same issue as before, where I can access your instance and all the BP nodes and such. However, Steam won’t launch along with the game whatsoever when I launch it as standalone. I’ve tried removing the Saved folder which has worked before, but to no avail. And yes, I’ve enabled the Steam Online Subsystem plugin.

Is there something else we need to do to get it to work?

Edit: Not quite sure if or how I fixed it, but now it automagically decided to work. :rolleyes:

1 Like

[QUOTE=looter;638673]
So it looks like steam is not setting the rich presence info “Joinable” correctly. bIsJoinable in Presence Info is never true, despite the join game option being available on steam itself. Has anyone else worked around this yet?

Update: Turns out UE4 never sets the Joinable presence info to true and its up to us. I ended up creating delegates for all of the session events in my game instance, along with some helper functions for working with steamworks on its own and got it all working. If you throw AdvancedSessions on github I’d be more than happy to help work on some Advanced Presence stuff that’d make all of this alot easier. Here’s the helper function I made, it requires you to include Steamworks in your project build file and the relevant header files in your game instance. The basic idea is to set Joinable to true after a successful JoinSession, CreateSession or StartSession, then set it to false on End/Destroy session. You’ll probably want to periodically check if the player count is reached in the session and set it back to false for all connected players.



bool UCGameInstance::SetRichPresence(FString Key, FString Value)
{
	ISteamFriends* SteamFriendsInt = SteamFriends();
	if (SteamFriendsInt != nullptr)
	{
		if (SteamFriendsInt->SetRichPresence(TCHAR_TO_UTF8(*Key), TCHAR_TO_UTF8(*Value)))
		{
			return true;
		}
	}

	return false;
}


I would take it into the plugin if required but that sounds more like something you should submit to the Epic Github as a patch to the engine instead, sounds like an oversite.

The plugin is now up on bitbucket btw (that is were i was hosting it for personal use).

1 Like

Hey guys.
I’m currently working on a multiplayer prototype and we are using this plugin. It’s doing great so far.

So because my old laptop was pretty slow, I switched my second device to an MacBook Pro. I just found out that the downloadable version does not work on it (after searching this thread).

Is there any advise you can give me or some steps I can follow, to recompile the source to also work on my Mac? As I would love to not always Build the whole Game to test if my code is working.

EDIT:
Could it compiled for Mac now, but when getting the Steam User Avatar the Game crashes with the following log:
#0 at 0x11468f702

Unknown() Address = 0x11468f702 (filename not found) [in ???]
Unknown() Address = 0x11468f178 (filename not found) [in ???]
Unknown() Address = 0x11466a6d3 (filename not found) [in ???]
Unknown() Address = 0x11466a7de (filename not found) [in ???]
dyld_stub_binder Address = 0x7fffdeda548e (filename not found) [in libdyld.dylib]
Unknown() Address = 0x16b0d4888 (filename not found) [in ???]
UAdvancedFriendsLibrary::execGetSteamFriendAvatar(FFrame&, void*) Address = 0x16b0658c6 …/…/…/…/…/drommedar/Documents/Unreal Projects/Builder/Plugins/AdvancedSessions/Source/AdvancedSessions/Classes/AdvancedFriendsLibrary.h, line 35] [in UE4Editor-AdvancedSessions.dylib]
UFunction::Invoke(UObject*, FFrame&, void*) Address = 0x10757db22 (filename not found) [in UE4Editor-CoreUObject.dylib]

Do you have an idea why this happens? Some other methods work without a problem (like checking for a connection to the online subsystem).

EDIT2:
Just found out that it doesn’t really use Steam at all. Could be that the crash is because of that.

1 Like

Hey , I’m having troubles with the plugin. Everytime I make an ‘Advanced Session’ I’m noticing significant FPS Drop. I’ve tried work arounds in the UE, but I’m basically stumped at this point. (I’m using 4.13.1). Any solutions or any fixes you can think of?

1 Like