Advanced Sessions Plugin

[QUOTE=JJGG117;751804]
1.

So I can get it to work by opening up what two files?? Or is it just one like in your above post? … in VS and changing it to:


		// Don't respond to query if the session is not a joinable LAN match.
		if (Session)



	const bool bAreSpacesAvailable = Session.NumOpenPublicConnections > 0;

	// LAN matches don't care about private connections / invites.
	// LAN matches don't care about presence information.
	return bIsAdvertised && bJoinableFromProgress;

Then save the two files. Right click .uproject and GenerateProjectFiles, run the new .sln and rebuild the Game?

**2. **
And thanks for your response to this:

So in this case ^^ I don’t use SessionResult->GetCurrentPlayers, instead I use the ExtraSettings and UpdateSession (making sure to connect everything to that node so it doesn’t update some settings to “empty”)?

How should I go about updating this on EventTick…is there a way to run this on the Host? How can I get the Host of a server?

**3. **
Oh and one more thing: does this Plugin automatically work with Steam Global Stats? And Leaderboard nodes will load and save and unlock achievements?

Leaderboard support is built into the engine already, there is a non related plugin called (I think) Advanced Steam something that adds more to the leaderboards support, I haven’t checked it out (as much as it has a similar naming convention).

Hi

First of all, really great job for the plugin, it’s awesome and very useful, so thanks :slight_smile: Plus you’re really reactive, that’s pretty nice!
I downloaded your plugin for my blueprint project (4.13.2), which includes a dedicated server that must register itself on Steam.
First of all, I got the “Server setting overflows Steam SetGameTags call” warning, but I managed to fix it with your help, by renaming hardcoded defines in the source. Now, I only have 1 warning left:


[2017.08.19-01.31.48:995][460]LogScriptCore:Warning: Script Msg: StartSessionCallback - Invalid player state
[2017.08.19-01.31.48:996][460]LogScriptCore:Warning:

Since my server is a dedicated one, I do not pass any player controller while registering it (the server logs “Server registered on Steam”, and I can join it with FindSessions):

It appears that this warning is triggered by the “QueryIDFromPlayerController” function, called from the “UCreateSessionCallbackProxyAdvanced::OnStartCompleted” function. Here, you pass “PlayerControllerWeakPtr.Get()” as argument, but since (I think) I use a dedicated server, the player controller is probably equal to NULL. And then, in the “QueryIDFromPlayerController”, you use this:


if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
{
	UserID = PlayerState->UniqueId.GetUniqueNetId();
	if (!UserID.IsValid())
	{
		FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Cannot map local player to unique net ID"), FunctionContext), ELogVerbosity::Warning);
	}
}
else
{
	FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Invalid player state"), FunctionContext), ELogVerbosity::Warning);
}

Since the player controller you pass is equals to NULL, the warning is triggered.

So, here are my questions:

  • Is it normal that my “PlayerControllerWeakPtr.Get()” is NULL, if I try to register a dedicated server?
  • Is it a problem to not pass through the “QueryIDFromPlayerController” function? What if I just skip that?
  • How can I get rid of this warning, and do I need to?

If I’m asking you all of this, that’s because I have a problem in my game with Steam achievements and leaderboards (see here if interested), and my only warning is this one, due to this plugin. I know you may don’t know that, but do you think this warning can interfere with Steam achievements, and cause the warning I describe in my other post?

Really thank you for all the job you did, pretty awesome :slight_smile:

Thanks for the detailed answer.

[QUOTE=Syalen;751922]
Hi

First of all, really great job for the plugin, it’s awesome and very useful, so thanks :slight_smile: Plus you’re really reactive, that’s pretty nice!
I downloaded your plugin for my blueprint project (4.13.2), which includes a dedicated server that must register itself on Steam.
First of all, I got the “Server setting overflows Steam SetGameTags call” warning, but I managed to fix it with your help, by renaming hardcoded defines in the source. Now, I only have 1 warning left:


[2017.08.19-01.31.48:995][460]LogScriptCore:Warning: Script Msg: StartSessionCallback - Invalid player state
[2017.08.19-01.31.48:996][460]LogScriptCore:Warning:

Since my server is a dedicated one, I do not pass any player controller while registering it (the server logs “Server registered on Steam”, and I can join it with FindSessions):

It appears that this warning is triggered by the “QueryIDFromPlayerController” function, called from the “UCreateSessionCallbackProxyAdvanced::OnStartCompleted” function. Here, you pass “PlayerControllerWeakPtr.Get()” as argument, but since (I think) I use a dedicated server, the player controller is probably equal to NULL. And then, in the “QueryIDFromPlayerController”, you use this:


if (APlayerState* PlayerState = (PlayerController != NULL) ? PlayerController->PlayerState : NULL)
{
	UserID = PlayerState->UniqueId.GetUniqueNetId();
	if (!UserID.IsValid())
	{
		FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Cannot map local player to unique net ID"), FunctionContext), ELogVerbosity::Warning);
	}
}
else
{
	FFrame::KismetExecutionMessage(*FString::Printf(TEXT("%s - Invalid player state"), FunctionContext), ELogVerbosity::Warning);
}

Since the player controller you pass is equals to NULL, the warning is triggered.

So, here are my questions:

  • Is it normal that my “PlayerControllerWeakPtr.Get()” is NULL, if I try to register a dedicated server?
  • Is it a problem to not pass through the “QueryIDFromPlayerController” function? What if I just skip that?
  • How can I get rid of this warning, and do I need to?

If I’m asking you all of this, that’s because I have a problem in my game with Steam achievements and leaderboards (see here if interested), and my only warning is this one, due to this plugin. I know you may don’t know that, but do you think this warning can interfere with Steam achievements, and cause the warning I describe in my other post?

Really thank you for all the job you did, pretty awesome :slight_smile:

It has nothing to do with an achievements problem, and is actually an ignorable message with dedicated servers.

Thanks for the heads up though, I should really be bypassing the player controller check there entirely if it is a dedicated server, there is no reason to go through it since there is no player controller on a dedicated server. I’ll make a change that will roll in with the next update at some point since it is a log message and not an actual bug.

Edit actually removed the call entirely, not using a player controller in that function anyway.

[QUOTE=JJGG117;752120]
But I was checking to see if Read/Write Leaderboard nodes is all I need? No C++ even for Steam to list a game’s stats globally? Where do they list game’s global stats – I’m wondering.

And can you tell me exactly what .cpp or .h files I must edit and where in order to get full servers to show up on a findSession search?

p.s. Do you have a known way I can constantly update session players thru an extra setting?

1: Don’t ask me, I don’t touch leaderboards currently as they were more complete when I took up this plugin and at the time I didn’t feel they needed the support. Obviously people have found parts of them lacking and have been adding to them since then.

2: OnValidQueryPacketReceived function inside of OnlineSessionInterfaceNull.cpp, make the changes I listed in the post above.

3: Would have to keep calling UpdateSession over and over, I wouldn’t do it every tick, or even very often at all.

[QUOTE=JJGG117;752164]
I don’t have OnlineSessionInterfaceNULL.cpp, I’m using 4.16. Is there any reason why I don’t have it?

I downloaded it very recently. The only file with “Online” in it is called: OnlineSubSystemHeader.h

Its not in my plugin…its in the ENGINE source.

Hey guys! Can you help me with something? :smiley: So, I am going to make a button that activates the Steam Invite UI. But I do not really know how I should do this. I thought it was the Show Invite UI node, but that does nothing? Can you give me a hint? Thanks.

[QUOTE=JJGG117;752183]
Ahhh my bad.

I edited that line in .cpp however I cannot create a session now. I saved then rebuilt UE4 and my game…any reason why it doesn’t work now?

I thought UpdateSession “Public Connections” was how many total public connections is possible? Not showing how many public connections there are on the server (i.e. num of current players?)

Am I wrong?

Also, finally, I’m having trouble updating my session. I can’t do it from controller or game instance, or game mode. Where do I do it from???

Settign the custom setting for that…not public connections

and it should work from anywhere, look for log entries

[QUOTE=JJGG117;752207]
I edited this line and can’t go back…It fails to create a session now. I did so much work after editing this line. I tried updating this line, even deleting binaries and intermediate and rebuilding with new .sln

Nothing works and I can’t go back!

does it fail to create? or fail to find?

Because re-building will make it a different build number and the client needs to match in order to find it.

[QUOTE=JJGG117;752360]
I hooked up a print node to GetSessionState (which I call as it’s hooked up to CreateSession OnSuccess exec) module and I’m printing the enum called “SessionState.” There is no session (no print) until I hit my button to CreateSession. Then it will print “Creating” for ever (literally won’t ever change) and I’m stuck at my main menu. It doesn’t ACTUALLY create the game, it is just stuck at “Creating.”

It won’t end up in FindSession results because I’m not able to join a game that is stuck “Creating” itself, and my level never opens!

Did I do something wrong:

  1. open .sln
  2. find the line in OnlineSessionInterfaceNULL.cpp
  3. Rebuild UE4 which did nothing really, just built instantly.
  4. Rebuild Game which was successful.
  5. Test with standalone.

When it didn’t work I deleted Binaries and Intermediate from Game folder as well as my plugins. Generated Project files and my code was still there successfully. So I rebuilt the Game there then tested with standalone.

Both create for Editor but not any version of Standalone.

Oh! EDIT:
My CreateSession was not set to LAN or Dedicated );
I set it to LAN, it worked. I set it to Dedicated, it didn’t! Even with UsePresence turned off.
But if I return that LAN server with this line of code in a FindSession results, then it won’t have it’s ExtraSettings working (doesn’t show text) and my players is 0/0 always (Using regular CurrentPlayers node)!

…Are you actually on a custom branch of the engine for dedicated?

Or did you edit it in the source of a launcher version…

[QUOTE=JJGG117;752408]
I converted a project to C++
Running a listen dedicated server from CreateSession

I’m having a really awful time with this project now…

I reverted back to an old project and another computer can’t find any games…it did once when I created two on the same computer…both in steam…not working

I explained it to you a while ago, that you can’t run a dedicated server without downloading and fully compiling the engine. You can’t run dedicated servers off of the launcher version of the engine, and changing the source to the launcher version won’t re-compile it.

find session advanced does not find the lobbys on steam? any idea why?
i’am using steam and invites work with no problem i just cant find any sessions O.o

[QUOTE=VirtueeL;752448]
find session advanced does not find the lobbys on steam? any idea why?
i’am using steam and invites work with no problem i just cant find any sessions O.o

There are multiple possibilities.

First, check the log to see if it it throwing any warnings and to make sure that it is even loading the steam subsystem

Second, make sure you aren’t filtering by an extra setting that doesn’t exist.

Third, if this is for VR make sure that SteamVRHome isn’t conflicting with your SteamSubsystem (it causes it not to load on non steam hosted builds currently when enabled…)

Have to make sure to set your Steam Download Location to be the same as the host because the steam app ID for games that are not yet greenlit are region locked.

Hi, I’m using 4.17 VXGI version how can I use Advanced Sessions plugin? When I copy plugin files to plugins folder of project I have an error like that: missin.jpg
How can I fix this error?

[QUOTE=MASSIVE Can;752635]
Hi, I’m using 4.17 VXGI version how can I use Advanced Sessions plugin? When I copy plugin files to plugins folder of project I have an error like that: missin.jpg
How can I fix this error?

You are on a custom engine branch, I cannot pre-build binaries for custom branches as there is no official binary version of them.

You have to manually compile the plugin on that branch from visual studio.

well how can I manually compile the plugin? I’m kinda new at Visual Studio.

[QUOTE=MASSIVE Can;752670]
well how can I manually compile the plugin? I’m kinda new at Visual Studio.

Open up your project in visual studio and compile it for development editor. Then you should be able to launch as normal.

You should really familiarize yourself with the compilation process if you are going to be using a custom engine branch though.

I have a problem with my game right now and I don’t know if it has somethign to do with the plugin. And I can’t seem to fix it : (
So maybe someone can take a look at it.

I will explain the process right here.
The player makes a server, then a client joins the server when they are ready, the game starts so that is the part where the servertravel occurs. while traveling the client disconnects. I didn’t have this problem in 4.16 but in 4.17 this problem occurs.

I hope somebody can help me with this because I am stuck now : (

I have also reproduced this problem and that worked fine. Migrating also doesn’t help.
And also I have upgraded this project from 4.16 to 4.17

The gamelogdisconnecterror is the log from the client and the other one is from the server.

I can see that there is something wrong with the playerstate but i dont know what.

Regards.

[QUOTE=;752679]
Open up your project in visual studio and compile it for development editor. Then you should be able to launch as normal.

You should really familiarize yourself with the compilation process if you are going to be using a custom engine branch though.

thank you it worked