//#############################################################################
//# Gamereader - version 1.0
//#
//# -------------------------------------------------------------------------
//#
//# $Rev: 0 $
//# $Date: 2011-04-20 03:41:30 +0000 (Wed, 04 Apr 2011) $
//# $Author: Deathranger $
//# $URL: N/A $
//#
//# $Id: System_Gamereader.cs 0 2011-04-20 03:41:30Z Deathranger $
//#
//# -------------------------------------------------------------------------
//#
//# Game Handling
//#
//#############################################################################
//*********************************************************
//* Searching
//*********************************************************
if(!isObject(System_Gamereadercontrol))
{
function Search(%file, %line, %this, %client)
{
{
%file.openForRead("Add-Ons");
if(isFile("Add-Ons/Game_*/") == true) {
%file.openForRead("Add-Ons/Game_*/Game/Add-Ons");
%file.selectall();
%file.copy();
%file.close();
}
%file.openForWrite("Add-Ons");
%file.paste();
%file.close();
while(!%file.isEOF())
{
if(!isObject(%file)) {return;}
%line = %file.readLine();
if(%line $= "-1")
{
%this.variableFalse(%client);
} else {
if(getWord(%line, 0) $= %client.BL_ID)
{
%this.variableTrue(%client);
}
}
};
//I know I said "Search" but it is kind of an instalation type of thing too, the above function part was for Add-Ons.
%file.openForRead("Add-Ons/Game_*/Game/Build");
%file.selectall();
%file.copy();
%file.close();
}
%file.openForWrite("Saves/Slate");
%file.paste();
%file.close();
while(!%file.isEOF())
{
if(!isObject(%file)) {return;}
%line = %file.readLine();
if(%line $= "-1")
{
%this.variableFalse(%client);
} else {
if(getWord(%line, 0) $= %client.BL_ID)
{
%this.variableTrue(%client);
}
}
};
%file.openForRead("Add-Ons/Game_*/Game/Minigame");
%file.selectall();
%file.copy();
%file.close();
{
%file.openForWrite("config/client/MiniGameFavorites");
%file.paste();
%file.close();
while(!%file.isEOF())
{
if(!isObject(%file)) {return;}
%line = %file.readLine();
if(%line $= "-1")
{
%this.variableFalse(%client);
} else {
if(getWord(%line, 0) $= %client.BL_ID)
{
%this.variableTrue(%client);
}
}
//This is only version one, there seems to be a small bug below, I will have to try to fix.
}
}