-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router don't work if there is no extension (Normally added automatically by the server) #3
Comments
The way that this is intended to work is any PHP scripts (either with an
extension or not) are supposed to go in cgi-bin. Files in cgi-bin are
always served as scripts, files in htdocs are always served statically. The
load file in question should've been included with your Flashpoint Infinity.
…On Fri, Dec 4, 2020, 2:14 PM Matthieu ***@***.***> wrote:
On the Casual Collective games (specially The Space Game) the flash call
php files without their extension. (widget.casualcollective.com/load for
widget.casualcollective.com/load.php). So at least on windows it doesn't
work.
I've make a dirty thing that work for this game only (I'm not high skilled
with php):
Rapidly on the function router_route_pathname($pathname) I test if the
file has an extension and if not I add ".php" to the end of $pathname. Yes
it's dirty, but it works.
Maybe the solution is to search the scripting tag like '<?php' in the file
and add the right extension.
Or add the server configuration on the game database.
Thanks for your works.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAH52Y4FDDOHTXEYUFHWNDSTFGMJANCNFSM4UN62NHA>
.
|
Yes, but the problem comes before the router can route it thru cgi-bin, it cannot take decision because the game call the file without the extension, see logs extract:
As you see the flash game call the file widget.casualcollective.com/load without the php extension. I think the extension is added automatically by the server with a rewrite rule. So I've add this (shitty) piece of code just before the comment (// in situations ...) :
And this game work. see the log :
On the logs, it seems to miss some files (levelStart, start and the mochiads.com one) but the games seems to works fine with savegames too. |
No, you don't understand. The Router will check if the file is in cgi-bin
first with or without the extension. If it's there it will not go to
checking Base URLs.
…On Sat, Dec 5, 2020, 3:14 AM Matthieu ***@***.***> wrote:
Yes, but the problem comes before the router can route it thru cgi-bin, it
cannot take decision because the game call the file without the extension,
see logs extract:
INFO [10:39:52] The Space Game: The Space Game has been started
INFO [10:39:52] Game Launcher: Launch Game "The Space Game" (PID: 11480) [
applicationPath: "FPSoftware\Flash\flashplayer_32_sa.exe",
launchCommand: "http://storage.cloud.casualcollective.com/games/thespacegamehacked.swf",
command: ""d:/Flashpoint/FPSoftware/Flash/flashplayer_32_sa.exe" http://storage.cloud.casualcollective.com/games/thespacegamehacked.swf" ]
INFO [10:39:55] Server: [Sat Dec 5 10:39:55 2020] 127.0.0.1:55614 Accepted
INFO [10:39:55] Routing Pathname: widget.casualcollective.com/**load**
INFO [10:39:55] Serving File From Base URLs: /widget.casualcollective.com/load
INFO [10:39:55] Using Base: Dri0m
INFO [10:39:55] Creating File Pointer Resource From URL: http://infinity.unstable.life/Flashpoint/Legacy/htdocs/widget.casualcollective.com/load
INFO [10:39:55] Failed to Open File
INFO [10:39:55] Using Base: Archive.org
INFO [10:39:55] Creating File Pointer Resource From URL: http://archive.org/download/FP90Data/FP90Data.zip/htdocs/widget.casualcollective.com/load
INFO [10:39:56] Empty File
INFO [10:39:56] Serving File From Base URLs: /widget.casualcollective.com/load
INFO [10:39:56] Using Base: Dri0m
INFO [10:39:56] Creating File Pointer Resource From URL: http://infinity.unstable.life/Flashpoint/Legacy/htdocs/widget.casualcollective.com/load/index.html
INFO [10:39:56] Failed to Open File
INFO [10:39:56] Using Base: Archive.org
INFO [10:39:56] Creating File Pointer Resource From URL: http://archive.org/download/FP90Data/FP90Data.zip/htdocs/widget.casualcollective.com/load/index.html
INFO [10:39:58] Empty File
INFO [10:39:58] Serving File From Base URLs: /widget.casualcollective.com/load
INFO [10:39:58] Using Base: Dri0m
INFO [10:39:58] Creating File Pointer Resource From URL: http://infinity.unstable.life/Flashpoint/Legacy/htdocs/widget.casualcollective.com/load/index.htm
INFO [10:39:58] Failed to Open File
INFO [10:39:58] Using Base: Archive.org
INFO [10:39:58] Creating File Pointer Resource From URL: http://archive.org/download/FP90Data/FP90Data.zip/htdocs/widget.casualcollective.com/load/index.htm
INFO [10:39:59] Empty File
INFO [10:39:59] Serving File From Base URLs: /widget.casualcollective.com/load
INFO [10:39:59] Failed to Route Pathname
INFO [10:39:59] [Sat Dec 5 10:39:59 2020] 127.0.0.1:55614 Closing
As you see the flash game call the file widget.casualcollective.com/*load*
without the php extension. I think the extension is added automatically by
the server with a rewrite rule.
So I've add this (shitty) piece of code just before the comment (// in
situations ...) :
$temp = pathinfo($pathname);
if($temp['extension'] == false) {
$pathname = $pathname . '.php';
router_output('Routing Pathname: ' . $pathname);
}
// in situations where we need a trailing slash, this will be appended to the pathname
And this game work. see the log :
INFO [11:02:55] Game Launcher: Launch Game "The Space Game" (PID: 7224) [
applicationPath: "FPSoftware\Flash\flashplayer_32_sa.exe",
launchCommand: "http://storage.cloud.casualcollective.com/games/thespacegamehacked.swf",
command: ""d:/Flashpoint/FPSoftware/Flash/flashplayer_32_sa.exe" http://storage.cloud.casualcollective.com/games/thespacegamehacked.swf" ]
INFO [11:02:55] Server: [Sat Dec 5 11:02:55 2020] 127.0.0.1:55672 Accepted
INFO [11:02:55] Routing Pathname: widget.casualcollective.com/load
INFO [11:02:55] Routing Pathname: /widget.casualcollective.com/load.php
INFO [11:02:55] Serving File From CGI-BIN: cgi-bin/widget.casualcollective.com/load.php
INFO [11:02:55] [Sat Dec 5 11:02:55 2020] 127.0.0.1:55672 Closing
INFO [11:02:55] [Sat Dec 5 11:02:55 2020] 127.0.0.1:55673 Accepted
INFO [11:02:55] Routing Pathname: widget.casualcollective.com/pub/session/setup
INFO [11:02:55] Routing Pathname: /widget.casualcollective.com/pub/session/setup.php
INFO [11:02:55] Serving File From CGI-BIN: cgi-bin/widget.casualcollective.com/pub/session/setup.php
INFO [11:02:55] [Sat Dec 5 11:02:55 2020] 127.0.0.1:55673 Closing
INFO [11:02:55] [Sat Dec 5 11:02:55 2020] 127.0.0.1:55674 Accepted
INFO [11:02:55] Routing Pathname: sessions.casualcollective.com/session/start
INFO [11:02:55] Routing Pathname: /sessions.casualcollective.com/session/start.php
INFO [11:02:55] [Sat Dec 5 11:02:55 2020] 127.0.0.1:55674 Closing
INFO [11:02:55] Not A File From CGI-BIN: cgi-bin/sessions.casualcollective.com/session/start.php
INFO [11:02:55] Failed to Route Pathname
INFO [11:02:55] [Sat Dec 5 11:02:55 2020] 127.0.0.1:55675 Accepted
INFO [11:02:55] Routing Pathname: sessions.casualcollective.com/session/levelStart
INFO [11:02:55] Routing Pathname: /sessions.casualcollective.com/session/levelStart.php
INFO [11:02:55] [Sat Dec 5 11:02:55 2020] 127.0.0.1:55675 Closing
INFO [11:02:55] Not A File From CGI-BIN: cgi-bin/sessions.casualcollective.com/session/levelStart.php
INFO [11:02:55] Failed to Route Pathname
INFO [11:03:03] [Sat Dec 5 11:03:03 2020] 127.0.0.1:55676 Accepted
INFO [11:03:03] Routing Pathname: x.mochiads.com/srv/1/8b88fbe9eb9f092f.swf
INFO [11:03:03] Serving File From Base URLs: /x.mochiads.com/srv/1/8b88fbe9eb9f092f.swf
INFO [11:03:03] Using Base: Dri0m
INFO [11:03:03] Creating File Pointer Resource From URL: http://infinity.unstable.life/Flashpoint/Legacy/htdocs/x.mochiads.com/srv/1/8b88fbe9eb9f092f.swf
INFO [11:03:03] Failed to Open File
INFO [11:03:03] Using Base: Archive.org
INFO [11:03:03] Creating File Pointer Resource From URL: http://archive.org/download/FP90Data/FP90Data.zip/htdocs/x.mochiads.com/srv/1/8b88fbe9eb9f092f.swf
INFO [11:03:04] Empty File
INFO [11:03:04] Failed to Route Pathname
INFO [11:03:04] [Sat Dec 5 11:03:04 2020] 127.0.0.1:55676 Closing
INFO [11:03:12] The Space Game: The Space Game exited with signal null
On the logs, it seems to miss some files (levelStart, start and the
mochiads.com one) but the games seems to works fine with savegames too.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAH526DXITR64GAMQMIO7TSTIBYRANCNFSM4UN62NHA>
.
|
Ok, so why it doesn't work ? |
Perhaps the intended behaviour became busted at some point? It's certainly
supposed to work this way - you should be able to put a file in cgi-bin and
it'll always check it exists and serve it as a PHP script if it fits, and
that's regardless of file extension (ASP or JSP etc. as well.) I'll take a
look in a bit to see if a previous update busted it.
…On Sat, Dec 5, 2020, 4:52 AM Matthieu ***@***.***> wrote:
Ok, so why it doesn't work ?
I'm pretty sure my modification isn't the right way to repair that.
But without that, the game just don't work, the first windows appear, and
then there is an error saying that it doesn't succed to access
casualcollective server.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAH5272UV4WYZBWBNBONVLSTINIVANCNFSM4UN62NHA>
.
|
Hi, I just had a look in the latest Flashpoint (9.0) and the Router is
serving files in cgi-bin as scripts correctly. However, the file for The
Space Game currently in Flashpoint is called load.php, when it should just
be called load (without an extension.) I will submit a pending fix to
Flashpoint for that.
…On Sat, Dec 5, 2020 at 9:55 AM Anthony Kleine ***@***.***> wrote:
Perhaps the intended behaviour became busted at some point? It's certainly
supposed to work this way - you should be able to put a file in cgi-bin and
it'll always check it exists and serve it as a PHP script if it fits, and
that's regardless of file extension (ASP or JSP etc. as well.) I'll take a
look in a bit to see if a previous update busted it.
On Sat, Dec 5, 2020, 4:52 AM Matthieu ***@***.***> wrote:
> Ok, so why it doesn't work ?
> I'm pretty sure my modification isn't the right way to repair that.
> But without that, the game just don't work, the first windows appear, and
> then there is an error saying that it doesn't succed to access
> casualcollective server.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#3 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ADAH5272UV4WYZBWBNBONVLSTINIVANCNFSM4UN62NHA>
> .
>
|
If you remove the extension on the file, how you will recognize the file type to route it thru the right directory (cgi-bin or htdocs) ? Maybe if the file is not found, look on htdocs and cgi-bin directory without looking the extension and if their is a match restart the routing process with the full file name. |
The location the file is served from is not determined only by file
extension.
If the file is just a regular static file with no PHP in it, it goes in
htdocs. If the file has a PHP script in it (regardless of extension: PHP,
ASP, none at all) it goes in cgi-bin.
The only important exception, and the reason why there is the list of PHP
filetypes, is that files with a PHP extension may ONLY be served from
cgi-bin. They are enforced to that location.
So, files with other extensions CAN be served from cgi-bin, if they exist
there. Files with a PHP extension MUST be served from cgi-bin, and it won't
check anywhere else.
This restriction exists to prevent PHP files from accidentally being served
statically since they should always be served as scripts.
This is why immediately after the initial call to
router_serve_file_from_cgi_bin if the file extension matches there is
another call to the same function if the file exists (checks using
is_file.) I'm on mobile so can't point out the exact line of code but the
check is there and works as intended.
…On Sun, Dec 6, 2020, 5:06 AM Matthieu ***@***.***> wrote:
If you remove the extension on the file, how you will recognize the file
type to route it thru the right directory (cgi-bin or htdocs) ?
Because when I've had a look on the router.php code, the choice is made
based on extension. :
line 26 $router_script_extensions = array('php', 'php5', 'phtml');
Maybe if the file is not found, look on htdocs and cgi-bin directory
without looking the extension and if their is a match restart the routing
process with the full file name.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAH52ZDFEI47AKZQOF3A7DSTNXVBANCNFSM4UN62NHA>
.
|
Ok. I've forgot the fact that's an human who place the file in cgi-bin or htdocs. Thanks for your time. It is to me to closed this issue ? |
On the Casual Collective games (specially The Space Game) the flash call php files without their extension. (widget.casualcollective.com/load for widget.casualcollective.com/load.php). So at least on windows it doesn't work.
I've make a dirty thing that work for this game only (I'm not high skilled with php):
Rapidly on the function router_route_pathname($pathname) I test if the file has an extension and if not I add ".php" to the end of $pathname. Yes it's dirty, but it works.
Maybe the solution is to search the scripting tag like '<?php' in the file and add the right extension.
Or add the server configuration on the game database.
Thanks for your works.
The text was updated successfully, but these errors were encountered: