Nava2
2009-02-09 21:37:28
So, lordsaturn and I created a system to update the hooks much easier! :)
I think in the next revision, dependent on your opinions, we will be adding this feature. If added, it will be required, no choice when it comes to updating hooks, as they SVN will not be updated for each and every hook update.
It will not slow scripts, but will call for another procedure to be called at the beginning of a script.
Here is the code:
If the hooks are out, the script will try to update them. The script will terminate regardless of whether new hooks are available or not. The function will return what occured! :)
Please post your opinions.
Also, check the Development SVN for new updates :)
BIG POINT: There will not be a commit for every hook update, instead, the reflection include will update automatically when there are hooks available.
I think in the next revision, dependent on your opinions, we will be adding this feature. If added, it will be required, no choice when it comes to updating hooks, as they SVN will not be updated for each and every hook update.
It will not slow scripts, but will call for another procedure to be called at the beginning of a script.
Here is the code:
{*******************************************************************************
procedure UpdateHooks;
By: lordsaturn, Nava2 & Narcle
Description: Updates hooks using online file.
*******************************************************************************}
procedure UpdateHooks;
var
page, v: string;
Hooks: integer;
begin
Writeln('Attempting to update Hooks...');
v := GetPage('http://scardevreflection.googlecode.com/svn/trunk/RSBuild.txt');
if v = '' then
SRL_Warn('SetupReflection', 'Hooks Server down, please notify a Reflection Developer of this issue.', Warn_AllVersions)
else
if not (RSBuild = StrToInt(GetNumbers(v))) then
Page := GetPage('http://scardevreflection.googlecode.com/svn/trunk/Hooks.Scar')
else
Writeln('New Hooks are not uploaded yet - please try later...');
if Page <> '' then
begin
Hooks := RewriteFile(AppPath+'includes\SRL\SRL\reflection\Hooks.Scar', False);
WriteFileString(Hooks, Page);
Writeln('Reflection Hooks Updated! Please restart script!');
CloseFile(Hooks);
end;
TerminateScript;
end;
{*******************************************************************************
procedure SetupReflection;
By: The Reflection Development Team
Description: Sets up the reflection include for use.
*******************************************************************************}
procedure SetupReflection;
begin
// If this returns -1, then the hooks are out.
if SmartGetFieldInt(0, LoginIndex) = -1 then
UpdateHooks;
end;If the hooks are out, the script will try to update them. The script will terminate regardless of whether new hooks are available or not. The function will return what occured! :)
Please post your opinions.
Also, check the Development SVN for new updates :)
BIG POINT: There will not be a commit for every hook update, instead, the reflection include will update automatically when there are hooks available.