Donations
|
If you wish to make a donation you can by clicking the image below.
|
|
|
|
|
5th April, 2007, 02:37 PM
|
Forum Newcomer
|
|
Join Date: Apr 2007
Posts: 6
|
|
Multiple redirect mutator
I don't know if this is possible, but it would be great.
My store is, I have my own server, I use uz.gameservers.net as redirect server. The other day I found another redirect server, uz.unrealadmin.org, yours (of this site) So I've been trying to find a way of using multiple redirect server, seems that it's not possible.
Could you make one or it that impossible?
Last edited by Taboen : 5th April, 2007 at 02:38 PM.
Reason: misstype
|
5th April, 2007, 02:46 PM
|
|
out of order
|
|
Join Date: Sep 2003
Posts: 3,383
|
|
First of all: uz.unrealadmin.org is not "my" redirect, just as unrealadmin.org is not "my" site. Secondly, I think the UnrealAdmin redirect already includes the GameServers.net redirect.
|
6th April, 2007, 01:01 PM
|
Forum Newcomer
|
|
Join Date: Apr 2007
Posts: 6
|
|
With yours I ment of this site. About the redirect, I didn't know, thank you!
|
21st March, 2012, 03:39 AM
|
|
Holy Shit!!
|
|
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
|
|
just wondering here but what would be involved in making ut capable of having multiple redirect capabilities?.. anyone?
surely it is possible.. what does someone have to do ?.. edit the ipdrv.dll and or some other core file?
|
21st March, 2012, 08:01 AM
|
Holy Shit!!
|
|
Join Date: Nov 2006
Location: France
Posts: 1,845
|
|
which would be cool to It's allocated to the player can set to somes redirections on his UT :
If missing uz on the server the UT player can take on others redirections.With no mismatch.
Last edited by medor : 21st March, 2012 at 08:11 PM.
|
21st March, 2012, 01:26 PM
|
Unstoppable
|
|
Join Date: Mar 2007
Posts: 208
|
|
In UT2004 it is possible to use multiple redirects by writing a mutator which overrides the OverrideDownload function.
This option doesn't exist in UT99 though (afaik).
__________________
(Clanmember-/Admin-enter-messages, Clantag-Protection, Clanchat, Player-Logging, AFK-Detector, WhoIs, "second" private server to keep non-clanmembers out and much more.) Source included.
|
21st March, 2012, 03:05 PM
|
|
Holy Shit!!
|
|
Join Date: Jun 2004
Location: Bergen - Norway
Posts: 2,389
|
|
Quote:
Originally Posted by back4more
just wondering here but what would be involved in making ut capable of having multiple redirect capabilities?.. anyone?
|
You can work around it with a php script.. just remember that every file will be downloaded via the web server where the script is installed.
Here is something {OCA}INSANEroba made for my servers many years ago:
Code:
<?
// Setup your sources here (do NOT put ending / in any location)
// L for local files - path to directory with .uz files relative to script position
// H for http files - complete url of directory with .uz files
// F for ftp files - complete url of directory with .uz files (un/pw as part of url)
// $sources[X] - start with 0 as X and add +1 for each new source
// lower X = higher priority
$sources[0] = array('http://uz.gameservers.net','H');
$sources[1] = array('http://uz.ut-files.com','H');
$sources[2] = array('http://www.snakeservers-redirect.net','H');
// $sources[X] = array('ftp://username:[email protected]/path_to_remote_dir','F');
// ==============================
$file = $_SERVER["QUERY_STRING"];
$sent = false;
foreach ($sources as $source) {
if (SendFile($source[0],$source[1])) {
$sent = true;
break;
}
else continue;
}
if (!$sent) header('HTTP/1.1 404 Not Found');
exit();
function SendFile($location,$type) {
global $file,$urlsize;
$fileok = false;
if ($type == "L" and file_exists($location."/".$file.".uz")) $fileok = true;
elseif ($type == "H" and url_exists($location."/".$file.".uz")) $fileok = true;
elseif ($type == "F" and ftp_exists($location."/".$file.".uz")) $fileok = true;
if ($fileok) {
header("HTTP/1.1 200 OK");
header("Status: 200 OK");
header("Content-Type: text/plain; charset=UTF-8");
if ($type == "L") header('Content-Length: '.filesize($location."/".$file.".uz"));
elseif ($type == "H" or $type == "F") header('Content-Length: '.$urlsize);
$fp1 = fopen($location."/".$file.".uz","r");
while(!feof($fp1)) echo fgets($fp1, 500000);
fclose($fp1);
return true;
}
else return false;
}
function url_exists($url) {
global $urlsize;
$urlsize = 0;
$a_url = parse_url($url);
if (!isset($a_url['port'])) $a_url['port'] = 80;
$errno = 0;
$errstr = '';
$timeout = 30;
if(isset($a_url['host']) && $a_url['host']!=gethostbyname($a_url['host'])){
$fid = fsockopen($a_url['host'], $a_url['port'], $errno, $errstr, $timeout);
if (!$fid) return false;
$page = isset($a_url['path']) ?$a_url['path']:'';
$page .= isset($a_url['query'])?'?'.$a_url['query']:'';
fputs($fid, 'HEAD '.$page.' HTTP/1.0'."\r\n".'Host: '.$a_url['host']."\r\n\r\n");
$head = fread($fid, 8192);
fclose($fid);
if (preg_match('#^HTTP/.*\s+[200|302]+\s#i', $head)) {
preg_match('/Content-Length:\s([0-9].+?)\s/', $head, $matches);
$urlsize = $matches[1];
return true;
}
}
else {
return false;
}
}
function ftp_exists($url) {
global $urlsize;
$urlsize = 0;
$a_url = parse_url($url);
if (!isset($a_url['port'])) $a_url['port'] = 21;
$ftp = ftp_connect($a_url['host'],$a_url['post'],10);
if (!$ftp) return false;
if (!ftp_login($ftp, $a_url['user'], $a_url['pass'])) return false;
$ftpsize = ftp_size($ftp, $a_url['path']);
if ($ftpsize <= 0) return false;
else {
$urlsize = $ftpsize;
return true;
}
}
?>
Stuff it in a file, and point your UT server to it. I used it for years with no problems.
|
21st March, 2012, 04:49 PM
|
|
Godlike
|
|
Join Date: Nov 2011
Posts: 339
|
|
Very nice! It would be great if some of the larger UT groups would share linking into their redirects through something like this. We could effectively end the redirect problem forever.
__________________
Retired.
|
21st March, 2012, 08:21 PM
|
|
Holy Shit!!
|
|
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
|
|
Quote:
Originally Posted by PizzaMan
You can work around it with a php script.. just remember that every file will be downloaded via the web server where the script is installed.
Here is something {OCA}INSANEroba made for my servers many years ago:
.
.
.
Stuff it in a file, and point your UT server to it. I used it for years with no problems.
|
Thanks Man! , Really appreciate your contribution. Yes I read that there was a way of doing this through php and this could be the script that others have mentioned about the web.
perhaps if it was setup on say ut.files.com / unrealtournament.ut99.fr.free somewhere with a bunch of Redirect servers implemented it would save other less web savvy users the problem of setting it up?.. (just a thought)
Again Thanks
Last edited by back4more : 21st March, 2012 at 09:07 PM.
|
21st March, 2012, 08:33 PM
|
|
Holy Shit!!
|
|
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
|
|
Quote:
Originally Posted by PizzaMan
Stuff it in a file, and point your UT server to it. I used it for years with no problems.
|
Just a Quick Query PizzaMan ;
what would be the RedirectToURL= (String) be in order to get this script to kick-in?
Cheers.
|
21st March, 2012, 08:59 PM
|
|
Holy Shit!!
|
|
Join Date: Jun 2004
Location: Bergen - Norway
Posts: 2,389
|
|
Quote:
Originally Posted by back4more
what would be the RedirectToURL= (String) be in order to get this script to kick-in?
|
URL of the php script. Just paste the above code in a text file named "get.php" and host the file on a php enabled web server with the necessary permissions.
You probably also need a .htaccess file:
Code:
Options +FollowSymlinks All -Indexes
order deny,allow
RewriteEngine on
RewriteRule ^(.*)\.uz$ get.php?$1 [PT]
|
21st March, 2012, 09:00 PM
|
|
Holy Shit!!
|
|
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
|
|
Also ... one other small question , how does this fair in regards to File Mismatches and such.. just browsing the code now , and am wondering if it first checks the version of FileX.xxx on the server against FileX.xxx on the Redirect before downloading ... or?.
Cheers.
Last edited by back4more : 21st March, 2012 at 09:03 PM.
|
21st March, 2012, 09:02 PM
|
|
Holy Shit!!
|
|
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
|
|
Quote:
Originally Posted by PizzaMan
URL of the php script. Just paste the above code in a text file named "get.php" and host the file on a php enabled web server with the necessary permissions.
You probably also need a .htaccess file:
Code:
Options +FollowSymlinks All -Indexes
order deny,allow
RewriteEngine on
RewriteRule ^(.*)\.uz$ get.php?$1 [PT]
|
Wicked
Awesome Man.
|
21st March, 2012, 09:31 PM
|
|
Holy Shit!!
|
|
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
|
|
Now Fully Functional.
Note: Made important Change , now works!
ok .. have done a quick info.txt and zipped it all up , hopefully this is the complete package with enough info to help anyone wishing to utilize this script;
info.txt
Quote:
UT99 Multi-Redirect Checker V1.0 {OCA}INSANEroba
Originally Posted by PizzaMan;
http://www.unrealadmin.org/forums/sh...834#post164834
This script allows the Admin of a server to utilize multiple redirect servers for clients to download files
from. If the file is not on sources[1] then it will proceed to check the next sources[x] in sequence and
retrieve files from there.
To add redirect URL's to script append to ;
$sources[0] = array('http://uz.gameservers.net','H');
$sources[1] = array('http://uz.ut-files.com','H');
$sources[2] = array('http://www.snakeservers-redirect.net','H');
$sources[3] = array('http://www.redirect_Server.com','X'); 'X' denotes [L]ocal, [H]ttp or [F]tp
for [F]tp un-comment ;
// $sources[X] = array('ftp://username:[email protected]/path_to_remote_dir','F');
and make changes as neccassary.
1. Make Changes above
2. Upload MultiRedir.php to your webserver
3. You may need to make a few changes to your .htaccess file below;
4. Make Changes to Unrealtournament.ini below;
UnrealTournament.ini;
RedirectToURL=http://www.redirect_server.com/
^Actual Path to MultiRedir Script also ending '/' is a must
You will also need a .htaccess file:
.htaccess
#---start---
Options +FollowSymlinks All -Indexes
order deny,allow
RewriteEngine on
RewriteRule ^(.*)\.uz$ MultiRedir.php?$1 [PT]
#----end----
^ create a file in the new directory named .htaccess
* copy and paste the code between the "#---start---" & "#---end---"
> and save to the same Directory as the MultiRedir.php file.
for example ;
www.myhost.com/ut
|- MultiRedir.php
|- .htaccess
small writeup by BFM.
Note: Atm does not contain fix for MisMatched Files
Gtr33tz/Thanks , {OCA}INSANEroba, PizzaMan, www.unrealadmin.org
|
Download MultiRedir.zip Mediafire.com
hopefully covered all the bases.
Last edited by back4more : 28th March, 2012 at 06:21 AM.
Reason: updated... info.txt (ready for use)
|
21st March, 2012, 10:00 PM
|
|
Holy Shit!!
|
|
Join Date: Jun 2004
Location: Bergen - Norway
Posts: 2,389
|
|
The file name must be the same as the one in the .htaccess file.
And yes you are still fucked if there is a mismatch.
|
21st March, 2012, 10:50 PM
|
|
Holy Shit!!
|
|
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
|
|
Quote:
Originally Posted by PizzaMan
The file name must be the same as the one in the .htaccess file.
And yes you are still fucked if there is a mismatch.
|
Updated..
Last edited by back4more : 22nd March, 2012 at 05:18 AM.
|
23rd March, 2012, 06:09 AM
|
Super Moderator
|
|
Join Date: Jan 2004
Location: North Carolina
Posts: 2,245
|
|
I suppose I could host this for everyone; I'd need a list of redirects willing to participate though.
|
23rd March, 2012, 06:09 PM
|
Unstoppable
|
|
Join Date: Oct 2010
Posts: 207
|
|
That would be awesome skillz.
|
23rd March, 2012, 06:50 PM
|
|
Holy Shit!!
|
|
Join Date: Jun 2004
Location: Bergen - Norway
Posts: 2,389
|
|
Quote:
Originally Posted by back4more
|
But how would the script know the hash for the file that you want to download, or even the size? The UT server only requests the file by name. You can see it in-game when the download is finished before it reaches 100 % (where 100 % is the size of the uncompressed file).
You would need to write a mutator that does a quick CRC on the file on the UT server, and then talks to the script which in turn downloads each possible file to the web server, then uncompresses it, then performs a CRC on them all until it finds the correct file... and finally lets the client download it *pew*
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|