diff --git a/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTBrowserVersion.cs b/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTBrowserVersion.cs new file mode 100644 index 0000000..39b5bbc --- /dev/null +++ b/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTBrowserVersion.cs @@ -0,0 +1,41 @@ +using System; +using System.Text.RegularExpressions; + +namespace HappyFunTimes { + public class HFTBrowserVersion { + static public bool IsIOS(string userAgent) + { + return m_iosRE.IsMatch(userAgent); + } + + public class Version { + public Version(int major = 0, int minor = 0) + { + Major = major; + Minor = minor; + } + public int Major = 0; + public int Minor = 0; + }; + + static public Version IOSVersion(string userAgent) + { + var m = m_versionRE.Match(userAgent); + if (m.Success) + { + return new Version( + Int32.Parse(m.Groups[1].ToString()), + Int32.Parse(m.Groups[2].ToString())); + } + return new Version(); + } + + static public bool IsIOS10(string userAgent) + { + return IsIOS(userAgent) && IOSVersion(userAgent).Major == 10; + } + + static private Regex m_iosRE = new Regex("iPad|iPhone"); + static private Regex m_versionRE = new Regex("OS (\\d+)_(\\d+)\\D"); + } +} diff --git a/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTBrowserVersion.cs.meta b/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTBrowserVersion.cs.meta new file mode 100644 index 0000000..d8ab6d1 --- /dev/null +++ b/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTBrowserVersion.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0dc9ca6a92c5849b48918ae500cb6e23 +timeCreated: 1525339343 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTCaptivePortalHandler.cs b/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTCaptivePortalHandler.cs index a96cc7a..0f77d79 100644 --- a/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTCaptivePortalHandler.cs +++ b/Assets/HappyFunTimes/HappyFunTimesCore/Server/HFTCaptivePortalHandler.cs @@ -38,6 +38,7 @@ bool Check(string path, HttpListenerRequest req, HttpListenerResponse res) bool isIndexURL = path.Equals("/index.html", StringComparison.Ordinal) || path.Equals("/", StringComparison.Ordinal) || path.Equals(m_firstPath, StringComparison.Ordinal); + bool isIOS10 = HFTBrowserVersion.IsIOS10(req.UserAgent); if (isIndexURL) { @@ -53,7 +54,7 @@ bool Check(string path, HttpListenerRequest req, HttpListenerResponse res) if (isLoginURL) { session.loggedIn = true; - return SendCaptivePortalHTML(req, res, sessionId, "/hft/captive-portal/game-login.html"); + return SendCaptivePortalHTML(req, res, sessionId, isIOS10 ? "/hft/captive-portal/game-login-manual.html" : "/hft/captive-portal/game-login.html"); } // We've seen this device before. Either it's checking that it can connect or it's asking for a normal webpage. diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/__dir__.txt b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/__dir__.txt index f05ad36..8143d8d 100644 --- a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/__dir__.txt +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/__dir__.txt @@ -1 +1 @@ -["icon-16.png","3rdparty/audiomanager-min.js","3rdparty/audiomanager.js","3rdparty/chroma.min.js","3rdparty/game-utils-min.js","3rdparty/game-utils.js","3rdparty/gyronorm.complete.min.js","controllers/camera/controller.html","controllers/camera/css/controller.css","controllers/camera/scripts/controller.js","controllers/character-select/controller.html","controllers/character-select/css/controller.css","controllers/character-select/images/cube.svg","controllers/character-select/images/cylinder.svg","controllers/character-select/images/sphere.svg","controllers/character-select/scripts/controller.js","controllers/clean/controller.html","controllers/gamepad/controller.html","controllers/gamepad/css/controller.css","controllers/gamepad/images/bird.png","controllers/gamepad/images/hft-circle-button.svg","controllers/gamepad/images/hft-down-arrow-button.svg","controllers/gamepad/images/hft-left-arrow-button.svg","controllers/gamepad/images/hft-right-arrow-button.svg","controllers/gamepad/images/hft-up-arrow-button.svg","controllers/gamepad/scripts/controller.js","controllers/gamepad/sounds/explosion.mp3","controllers/gamepad/sounds/gameover.mp3","controllers/gamepad/sounds/launch.mp3","controllers/gamepad/sounds/sounds.jsfx.txt","controllers/multi-machine/controller.html","controllers/multi-machine/css/controller.css","controllers/multi-machine/images/bird.png","controllers/multi-machine/images/hft-circle-button.svg","controllers/multi-machine/images/hft-down-arrow-button.svg","controllers/multi-machine/images/hft-left-arrow-button.svg","controllers/multi-machine/images/hft-right-arrow-button.svg","controllers/multi-machine/images/hft-up-arrow-button.svg","controllers/multi-machine/scripts/controller.js","controllers/simple/controller.html","controllers/simple/css/controller.css","controllers/simple/scripts/controller.js","controllers/syncedclock/controller.html","controllers/syncedclock/assets/clocktick.mp3","controllers/syncedclock/assets/clocktick.ogg","controllers/syncedclock/css/controller.css","controllers/syncedclock/scripts/controller.js","hft/hft-min.js","hft/hft.js","hft/missing.html","hft/assets/gear-icon.svg","hft/captive-portal/captive-portal.html","hft/captive-portal/game-login.html","hft/captive-portal/login.css","hft/captive-portal/xtra2.bin","sample-ui/sample-ui-min.js","sample-ui/sample-ui.css","sample-ui/sample-ui.js"] \ No newline at end of file +["icon-16.png","3rdparty/audiomanager-min.js","3rdparty/audiomanager.js","3rdparty/chroma.min.js","3rdparty/game-utils-min.js","3rdparty/game-utils.js","3rdparty/gyronorm.complete.min.js","controllers/camera/controller.html","controllers/camera/css/controller.css","controllers/camera/scripts/controller.js","controllers/character-select/controller.html","controllers/character-select/css/controller.css","controllers/character-select/images/cube.svg","controllers/character-select/images/cylinder.svg","controllers/character-select/images/sphere.svg","controllers/character-select/scripts/controller.js","controllers/clean/controller.html","controllers/gamepad/controller.html","controllers/gamepad/css/controller.css","controllers/gamepad/images/bird.png","controllers/gamepad/images/hft-circle-button.svg","controllers/gamepad/images/hft-down-arrow-button.svg","controllers/gamepad/images/hft-left-arrow-button.svg","controllers/gamepad/images/hft-right-arrow-button.svg","controllers/gamepad/images/hft-up-arrow-button.svg","controllers/gamepad/scripts/controller.js","controllers/gamepad/sounds/explosion.mp3","controllers/gamepad/sounds/gameover.mp3","controllers/gamepad/sounds/launch.mp3","controllers/gamepad/sounds/sounds.jsfx.txt","controllers/multi-machine/controller.html","controllers/multi-machine/css/controller.css","controllers/multi-machine/images/bird.png","controllers/multi-machine/images/hft-circle-button.svg","controllers/multi-machine/images/hft-down-arrow-button.svg","controllers/multi-machine/images/hft-left-arrow-button.svg","controllers/multi-machine/images/hft-right-arrow-button.svg","controllers/multi-machine/images/hft-up-arrow-button.svg","controllers/multi-machine/scripts/controller.js","controllers/simple/controller.html","controllers/simple/css/controller.css","controllers/simple/scripts/controller.js","controllers/syncedclock/controller.html","controllers/syncedclock/assets/clocktick.mp3","controllers/syncedclock/assets/clocktick.ogg","controllers/syncedclock/css/controller.css","controllers/syncedclock/scripts/controller.js","hft/hft-min.js","hft/hft.js","hft/missing.html","hft/assets/gear-icon.svg","hft/captive-portal/captive-portal.html","hft/captive-portal/game-login-manual.html","hft/captive-portal/game-login.html","hft/captive-portal/login.css","hft/captive-portal/xtra2.bin","sample-ui/sample-ui-min.js","sample-ui/sample-ui.css","sample-ui/sample-ui.js"] \ No newline at end of file diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login-manual.html.bytes b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login-manual.html.bytes new file mode 100644 index 0000000..b66ae26 --- /dev/null +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login-manual.html.bytes @@ -0,0 +1,59 @@ + + + + + + + + + + + + + HappyFunTimes Redirect + + + + +
+

HappyFunTimes

+

Please open your browser and go to hft.com

+ +
+ + + + diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login-manual.html.bytes.meta b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login-manual.html.bytes.meta new file mode 100644 index 0000000..4464d81 --- /dev/null +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login-manual.html.bytes.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: e184aad5e8f704ecda449fc9c9e798d7 +timeCreated: 1525338237 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login.html.bytes b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login.html.bytes index b66ae26..f5a47ad 100644 --- a/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login.html.bytes +++ b/Assets/HappyFunTimes/Resources/HappyFunTimesAutoGeneratedDoNotEdit/hft/captive-portal/game-login.html.bytes @@ -49,9 +49,7 @@

HappyFunTimes

-

Please open your browser and go to hft.com

- + Start
diff --git a/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login-manual.html b/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login-manual.html new file mode 100644 index 0000000..b66ae26 --- /dev/null +++ b/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login-manual.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + HappyFunTimes Redirect + + + + +
+

HappyFunTimes

+

Please open your browser and go to hft.com

+ +
+ + + + diff --git a/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login-manual.html.meta b/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login-manual.html.meta new file mode 100644 index 0000000..f604d75 --- /dev/null +++ b/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login-manual.html.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 964f7f7153925434584a98acbdc197dc +timeCreated: 1525338233 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login.html b/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login.html index b66ae26..f5a47ad 100644 --- a/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login.html +++ b/Assets/WebPlayerTemplates/HappyFunTimes/hft/captive-portal/game-login.html @@ -49,9 +49,7 @@

HappyFunTimes

-

Please open your browser and go to hft.com

- + Start
diff --git a/hft-server/build b/hft-server/build index f5c1791..5838bbc 100755 --- a/hft-server/build +++ b/hft-server/build @@ -9,7 +9,7 @@ cd "$script_dir/hft-server/bin/Release" export AS="as -arch i386" export CC="cc -arch i386 -framework CoreFoundation -lobjc -liconv" export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/4.2.4/lib/pkgconfig -mkbundle -z --static --deps -o hft-server.osx hft-server.exe DeJson.dll websocket-sharp.dll +mkbundle -z --static --deps --sdk /Library/Frameworks/Mono.framework/Versions/Current -o hft-server.osx hft-server.exe DeJson.dll websocket-sharp.dll cp hft-server.osx ../../../../Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.bytes shasum -b 256 hft-server.osx > ../../../../Assets/HappyFunTimes/HappyFunTimesCore/Server/Resources/HFTOSXServer.sha256.bytes diff --git a/hft-server/hft-server/hft-server.csproj b/hft-server/hft-server/hft-server.csproj index cbd386a..e4cc245 100644 --- a/hft-server/hft-server/hft-server.csproj +++ b/hft-server/hft-server/hft-server.csproj @@ -162,6 +162,9 @@ DNS\Server\MasterFile.cs + + HappyFunTimesCore\Server\HFTBrowserVersion.cs + HappyFunTimesCore\Server\HFTCaptivePortalHandler.cs