mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
add code to deal with Amazon, which I falsely identified as having
broken custom schemes. I'm leaving it in, unreachable, to have a record.
This commit is contained in:
parent
d7bb869a5b
commit
f82e5bd0e9
1 changed files with 71 additions and 6 deletions
|
@ -1,6 +1,31 @@
|
|||
<!-- -*- mode: sgml; -*- -->
|
||||
<?php
|
||||
|
||||
function langToString( $code ) {
|
||||
switch ( $code ) {
|
||||
case 1: return "English";
|
||||
case 2: return "French";
|
||||
case 3: return "German";
|
||||
case 4: return "Turkish";
|
||||
case 5: return "Arabic";
|
||||
case 6: return "Spanish";
|
||||
case 7: return "Swedish";
|
||||
case 8: return "Polish";
|
||||
case 9: return "Danish";
|
||||
case 0xA: return "Italian";
|
||||
case 0xB: return "Dutch";
|
||||
case 0xC: return "Catalan";
|
||||
case 0xD: return "Portuguese";
|
||||
|
||||
case 0XF: return "Russian";
|
||||
case 0x11: return "Czech";
|
||||
case 0x12: return "Greek";
|
||||
case 0x13: return "Slovak";
|
||||
default:
|
||||
return "<unknown>";
|
||||
}
|
||||
}
|
||||
|
||||
$g_androidStrings = array( "android", );
|
||||
|
||||
$scheme = "newxwgame";
|
||||
|
@ -17,6 +42,7 @@ for ( $ii = 0; $ii < count($g_androidStrings) && !$onAndroid; ++$ii ) {
|
|||
$needle = $g_androidStrings[$ii];
|
||||
$onAndroid = 0 != stripos( $agent, $needle );
|
||||
}
|
||||
$onFire = 0 != stripos( $agent, 'silk' );
|
||||
|
||||
$localurl = "$scheme://$host?room=$room&lang=$lang&np=$np";
|
||||
if ( $id != "" ) {
|
||||
|
@ -26,7 +52,7 @@ if ( $wl != "" ) {
|
|||
$localurl .= "&wl=$wl";
|
||||
}
|
||||
|
||||
if ( $onAndroid ) {
|
||||
if ( $onAndroid || $onFire ) {
|
||||
print <<<EOF
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
@ -38,7 +64,7 @@ print <<<EOF
|
|||
<body>
|
||||
|
||||
<div align="center">
|
||||
<img src="./icon48x48.png">
|
||||
<img src="./icon48x48.png"/>
|
||||
|
||||
<h1><a href="$localurl">Tap this link to launch Crosswords with
|
||||
your new game.</a>
|
||||
|
@ -47,7 +73,7 @@ print <<<EOF
|
|||
version of Crosswords installed.
|
||||
</p>
|
||||
|
||||
<img src="./icon48x48.png">
|
||||
<img src="./icon48x48.png"/>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
@ -55,6 +81,45 @@ print <<<EOF
|
|||
|
||||
EOF;
|
||||
|
||||
} else if ( $onFire ) {
|
||||
$langString = langToString($lang);
|
||||
$langText = "Make sure the language chosen is $langString";
|
||||
if ( '' != $wl ) {
|
||||
$langText .= " and the wordlist is $wl.";
|
||||
}
|
||||
$langText .= " If you don't have a[n] $langString wordlist installed you'll need to do that first.";
|
||||
print <<<EOF
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Crosswords Invite redirect</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>It appears you're running on a Kindle Fire, whose non-standard (from
|
||||
an Android perspective) OS doesn't support the custom schemes on which
|
||||
Crosswords invitations depend. If you want to accept this invitation
|
||||
you'll need to do it the manual way:
|
||||
|
||||
<ol>
|
||||
<li>Open Crosswords, and navigate to the main Games List screen</li>
|
||||
<li>Choose "Add game", either from the menu or the button at the bottom.</li>
|
||||
<li>Under "New Networked game", choose "Configure first".</li>
|
||||
<li>$langText</li>
|
||||
<li>As the room name, enter "$room".</li>
|
||||
<li>Make sure the total number of players shown is $np and that only one of them is not an "Off-device player".</li>
|
||||
<li>Now tap the "Play game" button at the bottom (above the keyboard). Your new game should open and connect.</li>
|
||||
</ol></p>
|
||||
<p>I'm sorry this is so complicated. I'm trying to find a
|
||||
workaround for this limitation in the Kindle Fire's operating system
|
||||
but for now this is all I can offer.</p>
|
||||
|
||||
<p>(Just in case Amazon's fixed the
|
||||
problem, <a href="$localurl">here is the link</a> that should open
|
||||
your new game.)</p>
|
||||
</body>
|
||||
</html>
|
||||
EOF;
|
||||
} else {
|
||||
$subject = "Android device not identified";
|
||||
|
||||
|
@ -70,11 +135,11 @@ print <<<EOF
|
|||
</head>
|
||||
<body>
|
||||
<div align="center">
|
||||
<img src="./icon48x48.png">
|
||||
<img src="./icon48x48.png"/>
|
||||
</div>
|
||||
<p>This page is meant to be viewed on a browser on your Android
|
||||
device. Please open the email that sent you here on that device to
|
||||
complete the invitation process.
|
||||
device. Please open the email that sent you here on that device and
|
||||
revisit this link to complete the invitation process.
|
||||
</p>
|
||||
|
||||
<p>(If you <em>are</em> viewing this on an Android device, you've
|
||||
|
|
Loading…
Reference in a new issue