Advanced Sessions Plugin

A word to the “Add or modify extra settings”-node:

I think this node is meant to take the input at “settings array” and add the settings of the input array “New or changed settings”. But if there is a setting with the same name but different value in these arrays, It´s just logical to take the value of the “New or changed settings”-array, isn´t it? Because at the moment, it quite seems to me, that there is the one of the “settings array” taken in this case :confused:

Ofc i may be wrong with it, but taking a look at that is worth it anyway.
And sry for bad english ^^

1 Like

[QUOTE=FriendlyFire1;451759]
A word to the “Add or modify extra settings”-node:

I think this node is meant to take the input at “settings array” and add the settings of the input array “New or changed settings”. But if there is a setting with the same name but different value in these arrays, It´s just logical to take the value of the “New or changed settings”-array, isn´t it? Because at the moment, it quite seems to me, that there is the one of the “settings array” taken in this case :confused:

Ofc i may be wrong with it, but taking a look at that is worth it anyway.
And sry for bad english ^^

It takes an input array and compares it to an output array that already exists, if the key is already in it, it overwrites the value, if it is not then it adds the key/value.

It is to be used when the new/add array might not have all of the keys in it, it was made pretty much to be a faster way to add values to the settings array when changing options as you don’t have use a blueprint array loop or anything, you just throw the new key at the function and array and let it handle overwriting or adding the value depending on if it already exists or not.

For example of you have a drop down filter for searching for servers and change it from one value to another you can throw the new value with the key name into that node and let it handle changing the correct index.

It might not be useful for everyone, but it doesn’t have to be used.

1 Like

[QUOTE=;451823]
It takes an input array and compares it to an output array that already exists, if the key is already in it, it overwrites the value, if it is not then it adds the key/value.

It is to be used when the new/add array might not have all of the keys in it, it was made pretty much to be a faster way to add values to the settings array when changing options as you don’t have use a blueprint array loop or anything, you just throw the new key at the function and array and let it handle overwriting or adding the value depending on if it already exists or not.

For example of you have a drop down filter for searching for servers and change it from one value to another you can throw the new value with the key name into that node and let it handle changing the correct index.

It might not be useful for everyone, but it doesn’t have to be used.

Yeah that´s how i understood the function of this node too. But what I mean is, if a key already exists, it isn´t overwritten by the new value i think.

1 Like

[QUOTE=FriendlyFire1;451901]
Yeah that´s how i understood the function of this node too. But what I mean is, if a key already exists, it isn´t overwritten by the new value i think.

You would have to use the output array currently, I just looked at it and I was using a workaround for what I thought was a blueprint limitation that I have found a solution to recently.

I’ll remake the function to edit the original array as well.

1 Like

[QUOTE=;451990]
You would have to use the output array currently, I just looked at it and I was using a workaround for what I thought was a blueprint limitation that I have found a solution to recently.

I’ll remake the function to edit the original array as well.

That´s also not what I mean :smiley: (I doubt I can express myself right ^^)
What I want to say is, if you have an array of settings, and you want a new array with one setting changed, and you put the original array in the “settings array”-input and just this one changed setting as an array in the “New or changed settings”-input, the output-array is equal to the original one, because changing settings doesn´t work right i think.

As example:

[key/value]

Original array:

[A/1], [B/2], [C/3] -> “settings array”

changed setting:

[B/5] -> “New or changed settings”

the output should be:

[A/1], [B/5], [C/3],

but it is:

[A/1], [B/2], [C/3]

Hope, you got now, what I want to say

1 Like

Ah, I get you now, and I also found the issue, I was missing a reference designation when iterating over the keys and it wasn’t updating the original key.

Will upload a corrected version, also I did no set it to overwrite with the original array, I realized that I had it not doing that on purpose so that the filter array could be kept seperate.

Edit Ok rebuilt it with the change and uploaded.

1 Like

Nice, thank you for correcting it so fast!

1 Like

Any tutorials on how to use this ??

1 Like

Hi ,

I have a feature request for your plugin and I’m really curious if this could be easily implemented and what you guys think about it.

So when inviting other players via steam, at the moment the typical steam overlay is shown ingame. The invited player can accept the invitation via the steam chat. So far so good and this works like a charm :slight_smile:

But I have a suggestion: Could you implement a custom event into your “Advanced Friends Game Instance” that fires if you are getting an invitation from another player and that contains the same inputs as “Event On Session Invite Accepted”? This would be really nice because with this event we could implement our own UMG’s for accepting invitations instead of using the steam chat.

EDIT: Another thing came to my mind: Would it be possible to get the steam avatar of a friend and draw it into a UMG widget?

Thanks for your super awesome plugin and best regards,
Daniel

1 Like

Hey man,
marvelous plugin you have there, I’ll definetly use it, BUT is the 4.10 plugin compatible with the 4.11 preview?

Alternatively, can you be bothered to compile this for 4.11?

1 Like

[QUOTE=polygon;453709]
Hi ,

I have a feature request for your plugin and I’m really curious if this could be easily implemented and what you guys think about it.

So when inviting other players via steam, at the moment the typical steam overlay is shown ingame. The invited player can accept the invitation via the steam chat. So far so good and this works like a charm :slight_smile:

But I have a suggestion: Could you implement a custom event into your “Advanced Friends Game Instance” that fires if you are getting an invitation from another player and that contains the same inputs as “Event On Session Invite Accepted”? This would be really nice because with this event we could implement our own UMG’s for accepting invitations instead of using the steam chat.

EDIT: Another thing came to my mind: Would it be possible to get the steam avatar of a friend and draw it into a UMG widget?

Thanks for your super awesome plugin and best regards,
Daniel

I am pretty sure that accepting invites is not exposed to the subsystem layer or I would have already added it, I will double check though. As for the steam avatar, no, I can’t do it directly through the subsystem interface currently.

I have had a lot of various requests for things that aren’t possible directly through the subsystem interface though, I may just bite the bullet and extend the plugin to support more steam specific functions as it is the big dog of subsystems and already has a clean accessible API.

I’ll let you know if I decide to go ahead and just add more functionality for steam with steam only nodes.

[QUOTE=adipFTW;453804]
Hey man,
marvelous plugin you have there, I’ll definetly use it, BUT is the 4.10 plugin compatible with the 4.11 preview?

Alternatively, can you be bothered to compile this for 4.11?

I don’t think there are any major changes at all with the subsystems with 4.11, the last hurdle that had me changing code was when they were still half and half returning const net ids for players and were converting them over little by little each patch.

It should compile just fine with 4.11, however I stopped supporting preview releases as I had to re-compile with each patch they add. The moment that the new version comes out (comes out during a work day every time) I will batch rebuild the plugin and upload for 4.11. Turn around is usually within the hour of a new engine version.

1 Like

Ok, you opened Pandora’s box now Polygon…

I’ll start taking more advanced Steam requests now, I figured out a decent workflow for Steam Specific additions to the plugin.

However I Added this new blueprint node today:

static UTexture2D * GetSteamFriendAvatar(APlayerController *PlayerController, const FBPUniqueNetId UniqueNetId, SteamAvatarSize AvatarSize = SteamAvatarSize::SteamAvatar_Medium);

Takes in the controller with the friend, the uniquenetid of the friend, and the requested avatar size, returns a UTexture2D with the avatar. I’ll upload it for 4.10 after it finishes building.

Edit I also added the event that triggers when an invite is received, you accept it by joining the session, there got both requests done ;p. I went line by line through the subsystem before and didn’t see an InviteReceivedDelegate and the signature of it doesn’t match the others entirely so it might be a new addition that I missed in 4.10.

For testing I just made an Image on the hud widget and created the brush with the “CreateBrushFromTexture” node from the image widget using the texture2d that my node returns. Ez PZ.

1 Like

Hi ,

thank you very, very, veeery much for your effort! This is so super awesome and I will test it on monday! The possibility to display steam avatars is so extremely useful and now we can design really cool steam friend widgets! Yeeehaaa!

EDIT: A very small request came to my mind recently: Would it be possible to get your own Steam ID? (In order to place your own avatar on the home screen of the main menu for example)

Best regards,
Daniel

1 Like

I’ve made a slight change to the AdvancedSessionsLibrary.cpp , because otherwise it crashes for me if I don’t have started the steam-client beforehand:



void UAdvancedSessionsLibrary::UniqueNetIdToString(const FBPUniqueNetId& UniqueNetId, FString &String)
{
	const FUniqueNetId * ID = UniqueNetId.GetUniqueNetId();

	if ( !ID )
	{
		UE_LOG(AdvancedSessionsLog, Warning, TEXT("UniqueNetIdToString received a bad UniqueNetId!"));
		String = "ERROR, BAD UNIQUE NET ID";
	}
	else
	{
		String = ID->ToString();
	}
}


Thanks for this great plugin!

1 Like

[QUOTE=Braindrain85;455108]
I’ve made a slight change to the AdvancedSessionsLibrary.cpp , because otherwise it crashes for me if I don’t have started the steam-client beforehand:



void UAdvancedSessionsLibrary::UniqueNetIdToString(const FBPUniqueNetId& UniqueNetId, FString &String)
{
	const FUniqueNetId * ID = UniqueNetId.GetUniqueNetId();

	if ( !ID )
	{
		UE_LOG(AdvancedSessionsLog, Warning, TEXT("UniqueNetIdToString received a bad UniqueNetId!"));
		String = "ERROR, BAD UNIQUE NET ID";
	}
	else
	{
		String = ID->ToString();
	}
}


Thanks for this great plugin!

Whoops! Good catch, will fix.

[QUOTE=polygon;454491]
Hi ,

thank you very, very, veeery much for your effort! This is so super awesome and I will test it on monday! The possibility to display steam avatars is so extremely useful and now we can design really cool steam friend widgets! Yeeehaaa!

EDIT: A very small request came to my mind recently: Would it be possible to get your own Steam ID? (In order to place your own avatar on the home screen of the main menu for example)

Best regards,
Daniel

There is already a node “GetUniqueNetID(APlayerController *PlayerController, FBPUniqueNetId &UniqueNetId)”, pass in the player controller (0 for default player) and then use that unique net id to pass into the get steam avatar node.

I am uploading a newer version of the plugin with the ToString fix and a speed up to the get avatar node.

Edit Uploaded

1 Like

Question ,

how do you take the UniqueNetId for another player?

It seems that it require PlayerController and they only exist on server and owning client.
Hence , only server can get the UniqueNetIdfor everyone. And you can only get your own UniqueNetId.
There is no way for client to get the uniqueID of another player. I try forcefully passing the controller over . resulting in bad unique ID.

So if you can’t get UniqueNetId, how then are you going to mute another player ( i’m developing a team-based game and is needing to unregister/mute opposing team )
I also cannot get steam avatar of another player.
It seems that a lot cannot be done without UniqueNetId

Is there a way to get UniqueNetIdfrom Playerstate , this is where i believe the actual UniqueNetIdis being stored isn’t it?
Please share an ideal solution if you know any. thanks

1 Like

[QUOTE=Frozenfire;457878]
Question ,

how do you take the UniqueNetId for another player?

It seems that it require PlayerController and they only exist on server and owning client.
Hence , only server can get the UniqueNetIdfor everyone. And you can only get your own UniqueNetId.
There is no way for client to get the uniqueID of another player. I try forcefully passing the controller over . resulting in bad unique ID.

So if you can’t get UniqueNetId, how then are you going to mute another player ( i’m developing a team-based game and is needing to unregister/mute opposing team )
I also cannot get steam avatar of another player.
It seems that a lot cannot be done without UniqueNetId

Is there a way to get UniqueNetIdfrom Playerstate , this is where i believe the actual UniqueNetIdis being stored isn’t it?
Please share an ideal solution if you know any. thanks

Well you can take the BPUniqueNetID structure that I made and replicate it to the client. However it really shouldn’t be needed, (as you said) they are already passed over with the player state, so I’ll just add a new node that is the same as “GetUniqueNetID” but takes a player state instead of a playercontroller. You can use the nodes GetGameState()->GetPlayerArray()->Player and pass it in then and it will return their BPUniqueNetID. I had named the current GetUniqueGetID as “GetUniqueNetIDFromController” in my code previously, pretty sure I intended to have both node versions anyway and forgot to implement the second one.

I’ll have the modified version uploaded shortly with the new node “GetUniqueNetIdFromPlayerState”, I had a couple of node comments that I edited for the steam avatar anyway explaining how the different sizes might not always be available and to check for a valid texture.

Edit New version uploaded for 4.10.2

1 Like

many thanks for the quick update.

UPDATE : the playerstate way seems to work fine for steamavatar. works fantastically.

However, I’m still having problem with the voice chat. I"m well aware of the INI thing. I’ve already done them
8f4dd525dbc098ecdbb375f306bb63d88a42e873.jpeg

In regards to the push to talk. I’ve found out that if I do not do register, nothing work.
Once I did register local talker. The voice will be considered on the entire time. Note that set the bRequiresPushToTalk on the ini.
I’ve also tried removing the settings. Can you double check if anything is overriding this logic?
I’ve already mapped the start/stop networked voice. I’ve also manually stop the voice. Still nothing works.
The voice is either ON all the time. Or not ON at all ( if I didn’t register )

I haven’t tried muting. I’m going to try it now.

Testing this is incredibly slow& difficult as i need to package and use another pc with steam. IF u know another way to test it locally would be awesome.

1 Like

The test project I used when I was first creating the interface nodes to the steam subsystem just has the ini entries and then I call start/stop networked voice on a button press/release.

On post login of a base gamemode the game calls an RPC:


// Tell the player to enable voice by default or use the push to talk method
NewPlayer->ClientEnableNetworkVoice(!GameSession->RequiresPushToTalk());

Which maps directly to the start/stop networked voice functions as per the toggle speaking command:


void APlayerController::ClientEnableNetworkVoice_Implementation(bool bEnable)
{
	ToggleSpeaking(bEnable);
}

Toggle speaking just calls the start/stop networked voice functions:


void APlayerController::ToggleSpeaking(bool bSpeaking)
{
	ULocalPlayer* LP = Cast<ULocalPlayer>(Player);
	if (LP != NULL)
	{
		UWorld* World = GetWorld();
		IOnlineVoicePtr VoiceInt = Online::GetVoiceInterface(World);
		if (VoiceInt.IsValid())
		{
			if (bSpeaking)
			{
				VoiceInt->StartNetworkedVoice(LP->GetControllerId());
			}
			else
			{
				VoiceInt->StopNetworkedVoice(LP->GetControllerId());
			}
		}
	}
}

The playercontroller has built in stop/stop voice functions but they also map to the same toggle speaking function that just calls start/stop networked voice:


void APlayerController::StartTalking()
{
	ToggleSpeaking(true);
}

void APlayerController::StopTalking()
{
	ToggleSpeaking(false);
}

There is some debugging information for the voice system in this post here: https://forums.unrealengine.com/showthread.php?57268-Create-Join-Session-Blueprint-Voice-Chat&p=258292&viewfull=1#post258292

It has some debugging commands that dump voice and session states that might help you out, however as far as my experience goes you should have it working WITHOUT registering the player yourself as this is already done for you as when you create or join a session both functions in the steam subsystem call “RegisterLocalPlayers(Session);” which registers ALL local players of the connecting computer with “VoiceInt->RegisterLocalTalker(Index);”.

So both registertalkers() and registerplayers() is called by default from the gamemode/playerstate or an online subsystem call, you shouldn’t ever NEED to use these functions. I included them as they where there and someone might find a use for them.

1 Like

You know, you might be having issues if you have a derived GameMode in c++ that you override “PostLogin” in. If it is missing the Super::PostLogin(player); line in it then it would never register the player for voice, or call the BP post login or update the player count for that matter.

1 Like