Skip to content

Commit 1ceb2fb

Browse files
authored
Release UE OSS 2.2.4 (#13)
* release UE OSS 2.2.4 * update readme
1 parent 2f346a7 commit 1ceb2fb

31 files changed

+731
-36
lines changed

.gitmodules

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
[submodule "Source/PlatformSpecific/Switch"]
22
path = Source/PlatformSpecific/Switch
33
url = https://[email protected]/PlayFabPrivate/Switch/_git/PlayFabMultiplayerUnrealSwitch
4+
5+
[submodule "Source/PlatformSpecific/PlayStation"]
6+
path = Source/PlatformSpecific/PlayStation
7+
url = https://[email protected]/PlayFabPrivate/PS5/_git/PlayFabMultiplayerUnrealPlayStation
8+

OnlineSubsystemPlayFab.uplugin

+33-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"FileVersion" : 3,
33
"FriendlyName": "Online Subsystem PlayFab Party & Multiplayer",
4-
"Version": 2.23,
5-
"VersionName": "2.2.3",
4+
"Version": 2.24,
5+
"VersionName": "2.2.4",
66
"Description": "Support for the PlayFab Party and Multiplayer platform",
77
"Category": "Networking",
88
"CreatedBy": "Microsoft Corporation",
@@ -14,7 +14,9 @@
1414
"WinGDK",
1515
"XSX",
1616
"Win64",
17-
"Switch"
17+
"Switch",
18+
"PS4",
19+
"PS5"
1820
],
1921

2022
"Modules": [
@@ -27,7 +29,9 @@
2729
"WinGDK",
2830
"XSX",
2931
"Win64",
30-
"Switch"
32+
"Switch",
33+
"PS4",
34+
"PS5"
3135
]
3236
}
3337
],
@@ -64,6 +68,31 @@
6468
[
6569
"Switch"
6670
]
71+
},
72+
{
73+
"Name": "OnlineSubsystemPS4",
74+
"Enabled": false,
75+
"WhitelistPlatforms" :
76+
[
77+
"PS4"
78+
]
79+
},
80+
{
81+
"Name": "OnlineSubsystemPS5",
82+
"Enabled": false,
83+
"WhitelistPlatforms" :
84+
[
85+
"PS5"
86+
]
87+
},
88+
{
89+
"Name": "OnlineSubsystemSony",
90+
"Enabled": false,
91+
"WhitelistPlatforms" :
92+
[
93+
"PS4",
94+
"PS5"
95+
]
6796
}
6897
]
6998
}

Platforms/PS4/nuget.config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="PS4Private" value="https://pkgs.dev.azure.com/PlayFabPrivate/PS4/_packaging/PS4General/nuget/v3/index.json" />
6+
</packageSources>
7+
</configuration>

Platforms/PS4/packages.config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.PlayFab.PlayFabParty.Cpp.PS4-10.000" version="1.7.14" targetFramework="native" />
4+
<package id="Microsoft.PlayFab.Multiplayer.Cpp.PS4-10.000" version="1.2.0" targetFramework="native" />
5+
</packages>

Platforms/PS5/nuget.config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="PS5Private" value="https://pkgs.dev.azure.com/PlayFabPrivate/PS5/_packaging/PS5General/nuget/v3/index.json" />
6+
</packageSources>
7+
</configuration>

Platforms/PS5/packages.config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.PlayFab.PlayFabParty.Cpp.PS5-6.000" version="1.7.14" targetFramework="native" />
4+
<package id="Microsoft.PlayFab.Multiplayer.Cpp.PS5-6.000" version="1.2.0" targetFramework="native" />
5+
</packages>

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ keywords: playfab, multiplayer, networking, unreal, unreal engine, unreal engine
1515

1616
The PlayFab Online Subsystem (PF OSS) v2 enables you to make use of PlayFab Multiplayer features like Lobby, Matchmaking, Party and Azure Cognitive Services in your Unreal Engine game.
1717

18-
These features include cross-platform Voice over Internet Protocol (VOIP), cross-network-play, and accessibility features like real-time text chat translation and voice transcription services. It is currently designed for use when developing PC, Xbox, Steam and Nintendo Switch games. This OSS layer works seamlessly on top of the existing base platform OSS layers (such as the base GDK OSS layer provided by Epic for Xbox and PC Game Pass). PlayFab OSS compliments the base OSS by adding support for PlayFab Lobby, Matchmaking, Party networking and Voice over Internet Protocol (VOIP).
18+
These features include cross-platform Voice over Internet Protocol (VOIP), cross-network-play, and accessibility features like real-time text chat translation and voice transcription services. It is currently designed for use when developing PC, Xbox, Steam, Nintendo Switch, and Sony PlayStation4/PlayStation5 games. This OSS layer works seamlessly on top of the existing base platform OSS layers (such as the base GDK OSS layer provided by Epic for Xbox and PC Game Pass). PlayFab OSS compliments the base OSS by adding support for PlayFab Lobby, Matchmaking, Party networking and Voice over Internet Protocol (VOIP).
1919

2020
## Getting Started
2121

@@ -27,14 +27,14 @@ The quickstart guide for OnlineSubsystemPlayFab can be found at:
2727

2828
|OSS version
2929
|-|
30-
|2.2.3
30+
|2.2.4
3131

3232
## Compatibility
3333

3434
|Unreal Engine version|4.27|
3535
|-|-|
3636
Multiplayer SDK|v1.1.5+
37-
Platforms|GDK (June 2021), Win64+Steam, Nintendo Switch
37+
Platforms|GDK (June 2021), Win64+Steam, Nintendo Switch, Sony PlayStation4/PlayStation5
3838

3939
|Unreal Engine version|5.0|
4040
|-|-|

SetUpPrivateOSS.ps1

+28-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,33 @@
55

66
# Prerequesites: download NuGet.exe and add its path to the PATH environment variable. Have git installed.
77

8-
Write-Host "Downloading Party and Multiplayer NuGet packages..."
8+
param (
9+
[Parameter(Mandatory=$true)]
10+
[validateset("Switch", "PlayStation")]
11+
[string]$Platform
12+
)
913

10-
$localPath = ".\Platforms\Switch"
11-
nuget.exe restore $localPath -ConfigFile $localPath\nuget.config -PackagesDirectory $localPath
14+
if ($Platform -like "Switch")
15+
{
16+
Write-Host "Downloading Party and Multiplayer NuGet packages..."
17+
$localPath = ".\Platforms\Switch"
18+
nuget.exe restore $localPath -ConfigFile $localPath\nuget.config -PackagesDirectory $localPath
1219

13-
Write-Host "Updating git submodules for private platforms..."
14-
git submodule update --recursive --init
20+
Write-Host "Updating git submodules for private platforms..."
21+
git submodule update --recursive --init Source/PlatformSpecific/Switch
22+
}
23+
24+
if ($Platform -like "PlayStation")
25+
{
26+
Write-Host "Downloading Party and Multiplayer NuGet packages..."
27+
$localPath = ".\Platforms\PS4"
28+
nuget.exe restore $localPath -ConfigFile $localPath\nuget.config -PackagesDirectory $localPath
29+
$localPath = ".\Platforms\PS5"
30+
nuget.exe restore $localPath -ConfigFile $localPath\nuget.config -PackagesDirectory $localPath
31+
32+
Write-Host "Updating git submodules for private platforms..."
33+
git submodule update --recursive --init Source/PlatformSpecific/PlayStation
34+
35+
Write-Host "Patching PlayStation platforms patch..."
36+
git apply --quiet Source/PlatformSpecific/PlayStation/playstation.patch
37+
}

Source/OnlineSubsystemPlayFab.Build.cs

+159-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public class OnlineSubsystemPlayFab : ModuleRules
1818

1919
private void SetupPlatformDefine(UnrealTargetPlatform TargetPlatform)
2020
{
21+
if (TargetPlatform == UnrealTargetPlatform.PS4 || TargetPlatform == UnrealTargetPlatform.PS5)
22+
{
23+
PublicDefinitions.Add("OSS_PLAYFAB_PLAYSTATION=1");
24+
}
2125
PublicDefinitions.Add(String.Format("OSS_PLAYFAB_{0}=1", TargetPlatform.ToString().ToUpper()));
2226
System.Console.WriteLine("OnlineSubsystemPlayFab: building for platform {0}", TargetPlatform.ToString().ToUpper());
2327
}
@@ -128,7 +132,9 @@ private enum PlayFabOSSSupportedPlatformType
128132
Undefined,
129133
GDK,
130134
Windows,
131-
Switch
135+
Switch,
136+
PS4,
137+
PS5
132138
}
133139

134140
private PlayFabOSSSupportedPlatformType DeterminePlatformType()
@@ -154,8 +160,18 @@ private PlayFabOSSSupportedPlatformType DeterminePlatformType()
154160
if (Target.Platform == UnrealTargetPlatform.Win64)
155161
{
156162
return PlayFabOSSSupportedPlatformType.Windows;
157-
}
163+
}
158164

165+
if (Target.Platform == UnrealTargetPlatform.PS4)
166+
{
167+
return PlayFabOSSSupportedPlatformType.PS4;
168+
}
169+
170+
if (Target.Platform == UnrealTargetPlatform.PS5)
171+
{
172+
return PlayFabOSSSupportedPlatformType.PS5;
173+
}
174+
159175
throw new PlatformNotSupportedException(Target.Platform.ToString() + " is not supported.");
160176
}
161177

@@ -175,13 +191,73 @@ private IPlayFabOSSPlatformConfigurator GetConfiguratorForPlatform(PlayFabOSSSup
175191
{
176192
return new WindowsPlatformConfigurator();
177193
}
194+
case PlayFabOSSSupportedPlatformType.PS4:
195+
{
196+
return new PlayStation4PlatformConfigurator();
197+
}
198+
case PlayFabOSSSupportedPlatformType.PS5:
199+
{
200+
return new PlayStation5PlatformConfigurator();
201+
}
178202
default:
179203
{
180204
throw new PlatformNotSupportedException(Target.Platform.ToString() + " is not supported.");
181205
}
182206
}
183207
}
184208

209+
private class NuGetPackageLoader
210+
{
211+
public class NuGetPackageInformation
212+
{
213+
public string PartyPackagePath = string.Empty;
214+
public string MultiplayerPackagePath = string.Empty;
215+
}
216+
217+
// If want specific version to use, can specify the version in the packages.config file.
218+
public void ParsingNuGetPackage(ref string PlatformDir, ref NuGetPackageInformation PackageInfo)
219+
{
220+
string[] Lines = System.IO.File.ReadAllLines(Path.Combine(PlatformDir, "packages.config"));
221+
foreach (string Line in Lines)
222+
{
223+
Int32 BeginOfString = Line.IndexOf("Microsoft.PlayFab", 0);
224+
if (BeginOfString > -1)
225+
{
226+
Int32 EndOfString = Line.IndexOf("\"", BeginOfString);
227+
string Id = Line.Substring(BeginOfString, EndOfString - BeginOfString);
228+
229+
const string versionString = "version=\"";
230+
BeginOfString = Line.IndexOf(versionString, 0);
231+
if (BeginOfString > -1)
232+
{
233+
BeginOfString += versionString.Length;
234+
EndOfString = Line.IndexOf("\"", BeginOfString);
235+
string Version = Line.Substring(BeginOfString, EndOfString - BeginOfString);
236+
237+
if (Id.IndexOf("Party", 0) > -1)
238+
{
239+
PackageInfo.PartyPackagePath = Id + "." + Version;
240+
}
241+
else if (Id.IndexOf("Multiplayer", 0) > -1)
242+
{
243+
PackageInfo.MultiplayerPackagePath = Id + "." + Version;
244+
}
245+
else
246+
{
247+
throw new BuildException("Unknown package id in package.config file.");
248+
}
249+
}
250+
}
251+
}
252+
if (PackageInfo.PartyPackagePath.Length == 0 && PackageInfo.MultiplayerPackagePath.Length == 0)
253+
{
254+
throw new BuildException("Can't find Party and Multiplayer package infomation in package.config file.");
255+
}
256+
System.Console.WriteLine("OnlineSubsystemPlayFab: Party={0}", PackageInfo.PartyPackagePath);
257+
System.Console.WriteLine("OnlineSubsystemPlayFab: Multiplayer={0}", PackageInfo.MultiplayerPackagePath);
258+
}
259+
}
260+
185261
public interface IPlayFabOSSPlatformConfigurator
186262
{
187263
bool IsPCPlatform(ReadOnlyTargetRules Target);
@@ -372,4 +448,85 @@ public void ConfigurePlayFabDependencies(ReadOnlyTargetRules Target, ModuleRules
372448
ThisModule.RuntimeDependencies.Add("$(TargetOutputDir)/PlayFabMultiplayerWin.pdb", Path.Combine(PlayFabPartyRedistPath, "PlayFabMultiplayerWin.pdb"), StagedFileType.DebugNonUFS);
373449
}
374450
}
451+
452+
private class PlayStationPlatformConfigurator : IPlayFabOSSPlatformConfigurator
453+
{
454+
protected string PlatformDir;
455+
protected NuGetPackageLoader NuGetLoader;
456+
protected NuGetPackageLoader.NuGetPackageInformation NugetPackageInfo;
457+
458+
public virtual bool IsPCPlatform(ReadOnlyTargetRules Target)
459+
{
460+
return false;
461+
}
462+
463+
public virtual void AddModuleDependencies(ModuleRules ThisModule)
464+
{
465+
//No common playstation module dependencies.
466+
}
467+
468+
public virtual void SetPlatformDefinitions(ModuleRules ThisModule)
469+
{
470+
ThisModule.bAllowConfidentialPlatformDefines = true;
471+
}
472+
473+
public virtual void ConfigurePlayFabDependencies(ReadOnlyTargetRules Target, ModuleRules ThisModule)
474+
{
475+
//No common playstation platform definitions.
476+
}
477+
}
478+
479+
private class PlayStation4PlatformConfigurator : PlayStationPlatformConfigurator
480+
{
481+
public PlayStation4PlatformConfigurator()
482+
{
483+
NugetPackageInfo = new NuGetPackageLoader.NuGetPackageInformation();
484+
NuGetLoader = new NuGetPackageLoader();
485+
PlatformDir = Path.Combine(Directory.GetCurrentDirectory(), "..", "Plugins", "Online", "OnlineSubsystemPlayFab", "Platforms", "PS4");
486+
NuGetLoader.ParsingNuGetPackage(ref PlatformDir, ref NugetPackageInfo);
487+
}
488+
489+
public override void AddModuleDependencies(ModuleRules ThisModule)
490+
{
491+
ThisModule.PublicDependencyModuleNames.Add("OnlineSubsystemPS4");
492+
}
493+
494+
public override void SetPlatformDefinitions(ModuleRules ThisModule)
495+
{
496+
base.SetPlatformDefinitions(ThisModule);
497+
498+
//No PlayStation4 specific platform definitions.
499+
}
500+
501+
public override void ConfigurePlayFabDependencies(ReadOnlyTargetRules Target, ModuleRules ThisModule)
502+
{
503+
}
504+
}
505+
506+
private class PlayStation5PlatformConfigurator : PlayStationPlatformConfigurator
507+
{
508+
public PlayStation5PlatformConfigurator()
509+
{
510+
NugetPackageInfo = new NuGetPackageLoader.NuGetPackageInformation();
511+
NuGetLoader = new NuGetPackageLoader();
512+
PlatformDir = Path.Combine(Directory.GetCurrentDirectory(), "..", "Plugins", "Online", "OnlineSubsystemPlayFab", "Platforms", "PS5");
513+
NuGetLoader.ParsingNuGetPackage(ref PlatformDir, ref NugetPackageInfo);
514+
}
515+
516+
public override void AddModuleDependencies(ModuleRules ThisModule)
517+
{
518+
ThisModule.PublicDependencyModuleNames.Add("OnlineSubsystemPS5");
519+
}
520+
521+
public override void SetPlatformDefinitions(ModuleRules ThisModule)
522+
{
523+
base.SetPlatformDefinitions(ThisModule);
524+
525+
//No PlayStation5 specific platform definitions.
526+
}
527+
528+
public override void ConfigurePlayFabDependencies(ReadOnlyTargetRules Target, ModuleRules ThisModule)
529+
{
530+
}
531+
}
375532
}

Source/PlatformSpecific/PlatformDefines.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ typedef FUniqueNetIdGDK PLATFORM_UNIQUE_NET_ID;
1515
typedef FUniqueNetIdGDKRef PLATFORM_UNIQUE_NET_ID_REF;
1616
#endif
1717

18-
#if defined(OSS_PLAYFAB_SWITCH) || defined(OSS_PLAYFAB_WIN64)
18+
#if defined(OSS_PLAYFAB_SWITCH) || defined(OSS_PLAYFAB_WIN64) || defined(OSS_PLAYFAB_PLAYSTATION)
1919
#include "OnlineSessionSettings.h"
2020
#include "OnlineSubsystemPlayFabTypes.h"
2121

Source/Private/MatchmakingInterfacePlayFab.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
#include "PlayFabLobby.h"
1010

1111
THIRD_PARTY_INCLUDES_START
12-
#ifdef OSS_PLAYFAB_SWITCH
12+
#if defined(OSS_PLAYFAB_SWITCH) || defined(OSS_PLAYFAB_PLAYSTATION)
13+
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
1314
#include <PFMultiplayerPal.h>
14-
#endif // OSS_PLAYFAB_SWITCH
15+
#endif // OSS_PLAYFAB_SWITCH || OSS_PLAYFAB_PLAYSTATION
1516
#include <PFEntityKey.h>
1617
#include <PFMultiplayer.h>
1718
#include <PFMatchmaking.h>

0 commit comments

Comments
 (0)