Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] SQL/PHP Fetch System

ex visor
Loyal Member
Joined
May 17, 2007
Messages
2,741
Reaction score
937
Hello,

For those of you looking for a Fetch script, and don't want to use the .ini (I don't know why you would take it into consideration), here is a script you can refer to:

PHP:
<?php
header("Content-type: text/css; charset=UTF-8"); 
include("config.php"); 
$url = $_SERVER[QUERY_STRING]; //GET URL 
$pos = strpos($url,"&"); 
$app = trim(substr($url,0,$pos)); //GET APP VERSION
$version = substr($url, $pos + 1); //GET VERSION OF CLIENT
if (!is_numeric($version) || !is_numeric($app)) { //VERSION OF APP AND CLIENT
echo "Syntax Error"; 
exit(); 
}
$query = mysql_query("SELECT * FROM applicationsetting where ApplicationId = $app"); 
$row = mysql_fetch_array($query); 
if ($version == $row[VersionLimit]) { //No Updates -> Enter
exit(); 
} 
if ($version <= $row[VersionLimit]) { //Update -> Update
echo "+$row[NoticeUrl]\n"; 
echo "=$row[BaseURL]\n"; 
$query = mysql_query("SELECT count(*) As files, sum(FileSize) As Size FROM fileinfo where FileVersion>$version"); 
$row2 = mysql_fetch_array($query); 
echo "~$row2[files];$row2[Size];$row[VersionLimit]\n"; 
$query = mysql_query("SELECT * FROM fileinfo where FileVersion>$version order by FileVersion ASC");
while ($row3 = mysql_fetch_array($query)) {
echo "$row3[Verb];$row3[LocalFileOrDir];$row3[RemoteFile];$row3[FileVersion];$row3[FileSize]\n";
}
}
else { //Stay out.
echo "Syntax Error";
}
?>
To run this script, you need to do several things. You first, need to make sure you have the following tables:

application settings and fileinfo.

Please make sure in the application settings table, your Version Limit is correct, as that's what actually PATCHES the files, once the file information has been added to fileinfo.

A few tips to adding files to FILEINFO.

VERB: M - Modify, R - Replace, E - Execute

LocalFileOrDir: The file you're editing WITHIN YOUR GUNBOUND FOLDER

Remove File: Path to the file, which is BEING patched.

File Version: Change the version via IXFS, make sure that the LimitVersion in APPLICATION SETTINGS in the version of the latest file version!

FileSize: The file size should be in BYTES ONLY!

The database buildups are posted in the section (search it up), and you can't directly copy and paste the file, because you need to create a config.php file, and connect to your database. You can follow , as well as this to learn to connect to the database if you don't know how to!

Code:
SQL:
CREATE TABLE `applicationsetting` (   `AppId` int(11) NOT NULL DEFAULT '0',   `FileUrl` varchar(255) NOT NULL,   `NoticeUrl` varchar(255) NOT NULL,   `VerLimit` int(11) NOT NULL DEFAULT '0',   PRIMARY KEY (`AppId`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;  CREATE TABLE `fileinfo` (   `AppId` int(11) NOT NULL DEFAULT '0',   `Command` enum('M','R') NOT NULL DEFAULT 'M',   `FileIns` varchar(52) NOT NULL DEFAULT '.\\',   `FileDir` varchar(51) NOT NULL,   `FileVer` int(11) NOT NULL DEFAULT '0',   `FileSize` int(11) NOT NULL DEFAULT '0',   PRIMARY KEY (`FileSize`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

If you use it, please click the "THANKS" button.

Regards, Aaron.
 
Last edited:
Newbie Spellweaver
Joined
Sep 30, 2008
Messages
44
Reaction score
0
haha awesome! havnt checked this forum in a while... hows gunbound going along o0 haha did u manage to get season 2 to work xD
 
ex visor
Loyal Member
Joined
May 17, 2007
Messages
2,741
Reaction score
937
Hey there, and no.
I eventually went to TH, then back to Season1, as Season2 was an epic failure!

- Aaron
 
Newbie Spellweaver
Joined
Sep 30, 2008
Messages
44
Reaction score
0
haha lol ok TH doesnt work with win7 though =[
 
ex visor
Loyal Member
Joined
May 17, 2007
Messages
2,741
Reaction score
937
GunBound Force is a WC client, for a TH client you should refer to either a GBC client (current, or the old one in the download section).

- Aaron
 
Experienced Elementalist
Joined
Oct 9, 2007
Messages
248
Reaction score
80
SQL Query
Code:
CREATE TABLE `applicationsetting` (
  `AppId` int(11) NOT NULL DEFAULT '0',
  `FileUrl` varchar(255) NOT NULL,
  `NoticeUrl` varchar(255) NOT NULL,
  `VerLimit` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`AppId`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `fileinfo` (
  `AppId` int(11) NOT NULL DEFAULT '0',
  `Command` enum('M','R') NOT NULL DEFAULT 'M',
  `FileIns` varchar(52) NOT NULL DEFAULT '.\\',
  `FileDir` varchar(51) NOT NULL,
  `FileVer` int(11) NOT NULL DEFAULT '0',
  `FileSize` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`FileSize`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
Back
Top