-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathSetUpPrivateOSS.ps1
241 lines (232 loc) · 10.4 KB
/
SetUpPrivateOSS.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# This script downloads the private platform components of the OSS, for the platforms the user has access to.
# The binaries and header files are pulled from our NuGet feeds at https://dev.azure.com/PlayFabPrivate/. You can
# find the NuGet config files in the Platforms/[APlatform] folder.
# The private source code is pulled from our Git repositories as submodules.
# Prerequesites: download NuGet.exe and add its path to the PATH environment variable. Have git installed.
param (
[Parameter(Mandatory=$true)]
[validateset("Switch", "PlayStation")]
[string]$Platform
)
$partyNugetFileName = ""
$partyNugetVersion = ""
$mlpNugetFileName = ""
$mlpNugetVersion = ""
function Set-NuGetPackageInfo($localPath, $partyFileName, $partyVersion, $mlpFileName, $mlpVersion)
{
$packagesXml = Get-Content $localPath\packages.config".xml"
$packagesXml = $packagesXml -replace "##PARTY##", $partyFileName
$packagesXml = $packagesXml -replace "##PARTY_VERSION##", $partyVersion
$packagesXml = $packagesXml -replace "##MULTIPLAYER##", $mlpFileName
$packagesXml = $packagesXml -replace "##MULTIPLAYER_VERSION##", $mlpVersion
Set-Content -Path $localPath\packages.config -Value $packagesXml
}
if ($Platform -eq "Switch")
{
Write-Host "Select Switch SDK version..."
Write-Host " 1: SDK 14.3.0-shipping"
Write-Host " 2: SDK 14.3.0-logging"
Write-Host " 3: SDK 15.3.2-shipping"
Write-Host " 4: SDK 15.3.2-logging"
Write-Host " 5: SDK 16.2.0-shipping"
Write-Host " 6: SDK 16.2.0-logging"
Write-Host " 7: SDK 16.2.3-shippng"
Write-Host " 8: SDK 16.2.3-logging"
while($True)
{
Write-Host -NoNewline "> "
$key = $Host.UI.RawUI.ReadKey()
$Selection = $key.Character
Write-Host ""
if ($Selection -eq '1')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-14.3.0-shipping"
$partyNugetVersion = "1.8.3"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-14.3.0-shipping"
$mlpNugetVersion = "1.6.1"
break
}
elseif ($Selection -eq '2')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-14.3.0-logging"
$partyNugetVersion = "1.8.3"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-14.3.0-logging"
$mlpNugetVersion = "1.6.1"
break
}
elseif ($Selection -eq '3')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-15.3.2-shipping"
$partyNugetVersion = "1.8.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-15.3.2-shipping"
$mlpNugetVersion = "1.6.2"
break
}
elseif ($Selection -eq '4')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-15.3.2-logging"
$partyNugetVersion = "1.8.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-15.3.2-logging"
$mlpNugetVersion = "1.6.2"
break
}
elseif ($Selection -eq '5')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-16.2.0-shipping"
$partyNugetVersion = "1.8.11"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-16.2.0-shipping"
$mlpNugetVersion = "1.6.2"
break
}
elseif ($Selection -eq '6')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-16.2.0-logging"
$partyNugetVersion = "1.8.11"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-16.2.0-logging"
$mlpNugetVersion = "1.6.2"
break
}
elseif ($Selection -eq '7')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-16.2.3-shipping"
$partyNugetVersion = "1.9.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-16.2.3-shipping"
$mlpNugetVersion = "1.7.2"
break
}
elseif ($Selection -eq '8')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.Switch-16.2.3-logging"
$partyNugetVersion = "1.9.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.Switch-16.2.3-logging"
$mlpNugetVersion = "1.7.2"
break
}
Write-Host "Unknown input"
}
Write-Host "Downloading Switch Party and Multiplayer NuGet packages..."
Write-Host $partyNugetFileName". Downloaded Party SDK version="$partyNugetVersion
Write-Host $mlpNugetFileName". Downloaded Multiplayer SDK version="$mlpNugetVersion
Write-Host "If you want to use a higher version of Party and Multiplayer SDK, please checkout to our private repositories and follow https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/networking/party-unreal-engine-oss-obtaining-playfab-party-libraries"
$localPath = ".\Platforms\Switch"
Set-NuGetPackageInfo $localPath $partyNugetFileName $partyNugetVersion $mlpNugetFileName $mlpNugetVersion
nuget.exe restore $localPath -ConfigFile $localPath\nuget.config -PackagesDirectory $localPath
Write-Host "Updating git submodules for private platforms..."
git submodule update --recursive --init Source/PlatformSpecific/Switch
}
elseif ($Platform -eq "PlayStation")
{
Write-Host "Select PlayStation4 SDK version..."
Write-Host " 1: SDK 9.500"
Write-Host " 2: SDK 10.000"
Write-Host " 3: SDK 10.500"
Write-Host " 4: SDK 11.500"
while($True)
{
Write-Host -NoNewline "> "
$key = $Host.UI.RawUI.ReadKey()
$Selection = $key.Character
Write-Host ""
if ($Selection -eq '1')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS4-9.500"
$partyNugetVersion = "1.7.15"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS4-9.500"
$mlpNugetVersion = "1.4.3"
break
}
elseif ($Selection -eq '2')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS4-10.000"
$partyNugetVersion = "1.8.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS4-10.000"
$mlpNugetVersion = "1.6.1"
break
}
elseif ($Selection -eq '3')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS4-10.500"
$partyNugetVersion = "1.8.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS4-10.500"
$mlpNugetVersion = "1.6.2"
break
}
elseif ($Selection -eq '4')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS4-11.500"
$partyNugetVersion = "1.9.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS4-11.500"
$mlpNugetVersion = "1.7.2"
break
}
Write-Host "Unknown input"
}
Write-Host "Downloading PlayStation4 Party and Multiplayer NuGet packages..."
Write-Host $partyNugetFileName". Downloaded Party SDK version="$partyNugetVersion
Write-Host $mlpNugetFileName". Downloaded Multiplayer SDK version="$mlpNugetVersion
Write-Host "If you want to use a higher version of Party and Multiplayer SDK, please checkout to our private repositories and follow https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/networking/party-unreal-engine-oss-obtaining-playfab-party-libraries"
$localPath = ".\Platforms\PS4"
Set-NuGetPackageInfo $localPath $partyNugetFileName $partyNugetVersion $mlpNugetFileName $mlpNugetVersion
nuget.exe restore $localPath -ConfigFile $localPath\nuget.config -PackagesDirectory $localPath
$Selection = ''
if (-not $Version -eq '')
{
$Selection = $Version
}
Write-Host "Select PlayStation5 SDK version..."
Write-Host " 1: SDK 5.000"
Write-Host " 2: SDK 6.000"
Write-Host " 3: SDK 7.000"
Write-Host " 4: SDK 9.000"
while($True)
{
Write-Host -NoNewline "> "
$key = $Host.UI.RawUI.ReadKey()
$Selection = $key.Character
Write-Host ""
if ($Selection -eq '1')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS5-5.000"
$partyNugetVersion = "1.7.15"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS5-5.000"
$mlpNugetVersion = "1.4.3"
break
}
elseif ($Selection -eq '2')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS5-6.000"
$partyNugetVersion = "1.8.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS5-6.000"
$mlpNugetVersion = "1.6.1"
break
}
elseif ($Selection -eq '3')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS5-7.000"
$partyNugetVersion = "1.8.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS5-7.000"
$mlpNugetVersion = "1.6.2"
break
}
elseif ($Selection -eq '4')
{
$partyNugetFileName = "Microsoft.PlayFab.PlayFabParty.Cpp.PS5-9.000"
$partyNugetVersion = "1.9.5"
$mlpNugetFileName = "Microsoft.PlayFab.Multiplayer.Cpp.PS5-9.000"
$mlpNugetVersion = "1.7.2"
break
}
Write-Host "Unknown input"
}
Write-Host "Downloading PlayStation5 Party and Multiplayer NuGet packages..."
Write-Host $partyNugetFileName". Downloaded Party SDK version="$partyNugetVersion
Write-Host $mlpNugetFileName". Downloaded Multiplayer SDK version="$mlpNugetVersion
Write-Host "If you want to use a higher version of Party and Multiplayer SDK, please checkout to our private repositories and follow https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/networking/party-unreal-engine-oss-obtaining-playfab-party-libraries"
$localPath = ".\Platforms\PS5"
Set-NuGetPackageInfo $localPath $partyNugetFileName $partyNugetVersion $mlpNugetFileName $mlpNugetVersion
nuget.exe restore $localPath -ConfigFile $localPath\nuget.config -PackagesDirectory $localPath
Write-Host "Updating git submodules for private platforms..."
git submodule update --recursive --init Source/PlatformSpecific/PlayStation
Write-Host "Patching PlayStation platforms patch..."
git apply --reject --whitespace=fix Source/PlatformSpecific/PlayStation/playstation.patch
}