Skip to content

Commit bea2658

Browse files
committed
Sync to Steamworks.NET f82cca35fcb19b63acafa97d39838759bae7d104
1 parent c16fc9f commit bea2658

File tree

230 files changed

+5331
-3666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+5331
-3666
lines changed

Assets/Editor/Steamworks.NET.meta

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/Steamworks.NET/RedistCopy.cs

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// This file is provided under The MIT License as part of Steamworks.NET.
2-
// Copyright (c) 2013-2017 Riley Labrecque
2+
// Copyright (c) 2013-2018 Riley Labrecque
33
// Please see the included LICENSE.txt for additional information.
44

5+
#if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
6+
#define DISABLESTEAMWORKS
7+
#endif
8+
9+
#if !DISABLESTEAMWORKS
10+
511
// Add 'DISABLEREDISTCOPY' to your custom platform defines to disable automatic copying!
612
#if UNITY_5_3_OR_NEWER
713
#define DISABLEREDISTCOPY
@@ -10,20 +16,59 @@
1016
using UnityEngine;
1117
using UnityEditor;
1218
using UnityEditor.Callbacks;
19+
using Steamworks;
1320
using System.IO;
1421

1522
public class RedistCopy {
1623
[PostProcessBuild]
1724
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) {
18-
#if !DISABLEREDISTCOPY
19-
if (target != BuildTarget.StandaloneWindows && target != BuildTarget.StandaloneWindows64 &&
20-
target != BuildTarget.StandaloneOSXIntel && target != BuildTarget.StandaloneOSXIntel64 && target != BuildTarget.StandaloneOSXUniversal &&
21-
target != BuildTarget.StandaloneLinux && target != BuildTarget.StandaloneLinux64 && target != BuildTarget.StandaloneLinuxUniversal) {
25+
string baseDir;
26+
string pluginsDir;
27+
switch(target)
28+
{
29+
case BuildTarget.StandaloneWindows:
30+
case BuildTarget.StandaloneWindows64:
31+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
32+
pluginsDir = Path.Combine(baseDir, "Plugins");
33+
break;
34+
case BuildTarget.StandaloneLinux:
35+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
36+
pluginsDir = Path.Combine(Path.Combine(baseDir, "Plugins"), "x86");
37+
break;
38+
case BuildTarget.StandaloneLinux64:
39+
case BuildTarget.StandaloneLinuxUniversal:
40+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data");
41+
pluginsDir = Path.Combine(Path.Combine(baseDir, "Plugins"), "x86_64");
42+
break;
43+
#if UNITY_2017_3_OR_NEWER
44+
case BuildTarget.StandaloneOSX:
45+
#else
46+
case BuildTarget.StandaloneOSXIntel:
47+
case BuildTarget.StandaloneOSXIntel64:
48+
case BuildTarget.StandaloneOSXUniversal:
49+
#endif
50+
baseDir = Path.Combine(Path.GetDirectoryName(pathToBuiltProject), Path.GetFileNameWithoutExtension(pathToBuiltProject) + ".app");
51+
baseDir = Path.Combine(baseDir, "Contents");
52+
pluginsDir = Path.Combine(baseDir, "Plugins");
53+
break;
54+
default:
2255
return;
2356
}
2457

25-
string strProjectName = Path.GetFileNameWithoutExtension(pathToBuiltProject);
58+
string[] DebugInfo = {
59+
"Steamworks.NET created by Riley Labrecque",
60+
"http://steamworks.github.io",
61+
"",
62+
"Steamworks.NET Version: " + Steamworks.Version.SteamworksNETVersion,
63+
"Steamworks SDK Version: " + Steamworks.Version.SteamworksSDKVersion,
64+
"Steam API DLL Version: " + Steamworks.Version.SteamAPIDLLVersion,
65+
"Steam API DLL Size: " + Steamworks.Version.SteamAPIDLLSize,
66+
"Steam API64 DLL Size: " + Steamworks.Version.SteamAPI64DLLSize,
67+
""
68+
};
69+
File.WriteAllLines(Path.Combine(pluginsDir, "Steamworks.NET.txt"), DebugInfo);
2670

71+
#if !DISABLEREDISTCOPY
2772
if (target == BuildTarget.StandaloneWindows64) {
2873
CopyFile("steam_api64.dll", "steam_api64.dll", "Assets/Plugins/x86_64", pathToBuiltProject);
2974
}
@@ -33,12 +78,7 @@ public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProj
3378

3479
string controllerCfg = Path.Combine(Application.dataPath, "controller.vdf");
3580
if (File.Exists(controllerCfg)) {
36-
string dir = "_Data";
37-
if (target == BuildTarget.StandaloneOSXIntel || target == BuildTarget.StandaloneOSXIntel64 || target == BuildTarget.StandaloneOSXUniversal) {
38-
dir = ".app/Contents";
39-
}
40-
41-
string strFileDest = Path.Combine(Path.Combine(Path.GetDirectoryName(pathToBuiltProject), strProjectName + dir), "controller.vdf");
81+
string strFileDest = Path.Combine(baseDir, "controller.vdf");
4282

4383
File.Copy(controllerCfg, strFileDest);
4484
File.SetAttributes(strFileDest, File.GetAttributes(strFileDest) & ~FileAttributes.ReadOnly);
@@ -78,3 +118,5 @@ static void CopyFile(string filename, string outputfilename, string pathToFile,
78118
}
79119
}
80120
}
121+
122+
#endif // !DISABLESTEAMWORKS

Assets/Editor/Steamworks.NET/RedistCopy.cs.meta

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/Steamworks.NET/RedistInstall.cs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is provided under The MIT License as part of Steamworks.NET.
2-
// Copyright (c) 2013-2017 Riley Labrecque
2+
// Copyright (c) 2013-2018 Riley Labrecque
33
// Please see the included LICENSE.txt for additional information.
44

55
// Uncomment this out or add it to your custom platform defines to disable checking the plugin platform settings.
@@ -70,7 +70,7 @@ static void CopyFile(string path, string filename, bool bCheckDifference) {
7070
}
7171
}
7272

73-
#if UNITY_5 || UNITY_2017
73+
#if UNITY_5 || UNITY_2017 || UNITY_2017_1_OR_NEWER
7474
static void SetPlatformSettings() {
7575
foreach(var plugin in PluginImporter.GetAllImporters()) {
7676
// Skip any null plugins, why is this a thing?!
@@ -87,11 +87,10 @@ static void SetPlatformSettings() {
8787
string filename = Path.GetFileName(plugin.assetPath);
8888

8989
switch(filename) {
90-
case "CSteamworks.bundle":
90+
case "libsteam_api.dylib":
9191
didUpdate |= ResetPluginSettings(plugin, "AnyCPU", "OSX");
9292
didUpdate |= SetCompatibleWithOSX(plugin);
9393
break;
94-
case "libCSteamworks.so":
9594
case "libsteam_api.so":
9695
if(plugin.assetPath.Contains("x86_64")) {
9796
didUpdate |= ResetPluginSettings(plugin, "x86_64", "Linux");
@@ -102,16 +101,6 @@ static void SetPlatformSettings() {
102101
didUpdate |= SetCompatibleWithLinux(plugin, BuildTarget.StandaloneLinux);
103102
}
104103
break;
105-
case "CSteamworks.dll":
106-
if (plugin.assetPath.Contains("x86_64")) {
107-
didUpdate |= ResetPluginSettings(plugin, "x86_64", "Windows");
108-
didUpdate |= SetCompatibleWithWindows(plugin, BuildTarget.StandaloneWindows64);
109-
}
110-
else {
111-
didUpdate |= ResetPluginSettings(plugin, "x86", "Windows");
112-
didUpdate |= SetCompatibleWithWindows(plugin, BuildTarget.StandaloneWindows);
113-
}
114-
break;
115104
case "steam_api.dll":
116105
case "steam_api64.dll":
117106
if (plugin.assetPath.Contains("x86_64")) {
@@ -173,9 +162,13 @@ static bool ResetPluginSettings(PluginImporter plugin, string CPU, string OS) {
173162
static bool SetCompatibleWithOSX(PluginImporter plugin) {
174163
bool didUpdate = false;
175164

165+
#if UNITY_2017_3_OR_NEWER
166+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, true);
167+
#else
176168
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel, true);
177169
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel64, true);
178170
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXUniversal, true);
171+
#endif
179172

180173
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false);
181174
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
@@ -199,9 +192,13 @@ static bool SetCompatibleWithLinux(PluginImporter plugin, BuildTarget platform)
199192
}
200193
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, true);
201194

195+
#if UNITY_2017_3_OR_NEWER
196+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, false);
197+
#else
202198
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel, false);
203199
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel64, false);
204200
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXUniversal, false);
201+
#endif
205202
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows, false);
206203
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, false);
207204

@@ -223,9 +220,13 @@ static bool SetCompatibleWithWindows(PluginImporter plugin, BuildTarget platform
223220
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
224221
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false);
225222
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false);
223+
#if UNITY_2017_3_OR_NEWER
224+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, false);
225+
#else
226226
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel, false);
227227
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel64, false);
228228
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXUniversal, false);
229+
#endif
229230

230231
return didUpdate;
231232
}
@@ -236,9 +237,13 @@ static bool SetCompatibleWithEditor(PluginImporter plugin) {
236237
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux64, false);
237238
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinux, false);
238239
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneLinuxUniversal, false);
240+
#if UNITY_2017_3_OR_NEWER
241+
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSX, false);
242+
#else
239243
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel, false);
240244
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXIntel64, false);
241245
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneOSXUniversal, false);
246+
#endif
242247
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows, false);
243248
didUpdate |= SetCompatibleWithPlatform(plugin, BuildTarget.StandaloneWindows64, false);
244249

@@ -253,5 +258,5 @@ static bool SetCompatibleWithPlatform(PluginImporter plugin, BuildTarget platfor
253258
plugin.SetCompatibleWithPlatform(platform, enable);
254259
return true;
255260
}
256-
#endif // UNITY_5
261+
#endif // UNITY_5 || UNITY_2017 || UNITY_2017_1_OR_NEWER
257262
}

Assets/Editor/Steamworks.NET/RedistInstall.cs.meta

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Plugins/CSteamworks.bundle/Contents.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.

Assets/Plugins/CSteamworks.bundle/Contents/Info.plist.meta

Lines changed: 0 additions & 4 deletions
This file was deleted.

Assets/Plugins/CSteamworks.bundle/Contents/MacOS.meta

Lines changed: 0 additions & 5 deletions
This file was deleted.
-471 KB
Binary file not shown.

Assets/Plugins/CSteamworks.bundle/Contents/MacOS/CSteamworks.meta

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)