when i try to open my file arcadia.conents.sql i get an error message saying not enough room available? im new and have no clue what im doing i just want to open the database up for my first time :(
class NFS
{
static NFS instance;
public static NFS Instance
{
get
{
if (instance == null)
{
instance = new NFS();
}
return instance;
}
}
struct location
{
public int left { get; set; }
public int top { get; set; }
public int right { get; set; }
public int bottom { get; set; }
}
struct locationScript
{
public int regionIndex { get; set; }
public int propCount { get; set; }
public int trigger { get; set; }
public int scriptSize { get; set; }
public string script { get; set; }
}
struct actor
{
public short id { get; set; }
public int x { get; set; }
public int y { get; set; }
public short modelId { get; set; }
public int scriptCount { get; set; }
}
struct actorScript
{
public short actorId { get; set; }
public int trigger { get; set; }
public int scriptSize { get; set; }
public string script { get; set; }
}
PropertyInfo[] locationProperties = typeof(location).GetProperties();
PropertyInfo[] locationScriptProperties = typeof(locationScript).GetProperties();
PropertyInfo[] actorProperties = typeof(actor).GetProperties();
PropertyInfo[] actorScriptProperties = typeof(actorScript).GetProperties();
string fileSignature = null;
int fileVersion = 0;
int locationOffset = 0;
int scriptOffset = 0;
int actorOffset = 0;
BinaryReader br;
BinaryWriter bw;
string errorMessage = null;
public DataSet PrepareTables()
{
DataSet ds = new DataSet();
bool hasData = false;
try
{
DataTable locationTable = new DataTable();
locationTable.TableName = "locations";
DataTable functionTable = new DataTable();
functionTable.TableName = "locationScripts";
DataTable actorTable = new DataTable();
actorTable.TableName = "actors";
DataTable actorScriptTable = new DataTable();
actorScriptTable.TableName = "actorScripts";
foreach (PropertyInfo property in locationProperties)
{
locationTable.Columns.Add(property.Name, property.PropertyType);
}
hasData = locationTable.Columns.Count > 0;
if (hasData)
ds.Tables.Add(locationTable);
foreach (PropertyInfo property in locationScriptProperties)
{
functionTable.Columns.Add(property.Name, property.PropertyType);
}
hasData = functionTable.Columns.Count > 0;
if (hasData)
ds.Tables.Add(functionTable);
foreach (PropertyInfo property in actorProperties)
{
actorTable.Columns.Add(property.Name, property.PropertyType);
}
hasData = actorTable.Columns.Count > 0;
if (hasData)
ds.Tables.Add(actorTable);
foreach (PropertyInfo property in actorScriptProperties)
{
actorScriptTable.Columns.Add(property.Name, property.PropertyType);
}
hasData = actorScriptTable.Columns.Count > 0;
if (hasData)
ds.Tables.Add(actorScriptTable);
if (ds.Tables.Count > 0)
{
return ds;
}
else
{
return null;
}
}
catch (Exception ex)
{
errorMessage = ex.Message;
return null;
}
}
public DataSet Read(string loadPath)
{
br = new BinaryReader(File.Open(loadPath, FileMode.Open, FileAccess.Read, FileShare.Read));
DataSet tableCollection = PrepareTables();
//Read Signature
fileSignature = Encoding.Default.GetString(br.ReadBytes(16));
fileVersion = br.ReadInt32();
locationOffset = br.ReadInt32();
scriptOffset = br.ReadInt32();
actorOffset = br.ReadInt32();
//Read Locations
int locationCount = br.ReadInt32();
for (int currentLocation = 0; currentLocation < locationCount; currentLocation++)
{
tableCollection.Tables[0].Rows.Add(readLocation(tableCollection.Tables[0].NewRow(), br));
br.ReadInt32();
}
//Read Location Scripts
locationCount = br.ReadInt32();
for (int currentLocation = 0; currentLocation < locationCount; currentLocation++)
{
tableCollection.Tables[1].Rows.Add(readLocationScript(tableCollection.Tables[1].NewRow(), br));
}
//Read Props
int propCount = br.ReadInt32();
if (propCount > 0)
{
for (int currentFunction = 0; currentFunction < propCount; currentFunction++)
{
DataRow propRow = readActor(tableCollection.Tables[2].NewRow(), br);
tableCollection.Tables[2].Rows.Add(propRow);
short propId = (short)propRow["id"];
int propScriptCount = (int)propRow["scriptCount"];
if (propScriptCount > 0)
{
List<DataRow> rowCollection = readActorScript(propId, propScriptCount, tableCollection.Tables[3].NewRow(), br);
foreach (DataRow row in rowCollection)
{
tableCollection.Tables[3].Rows.Add(row);
}
}
}
}
return tableCollection;
}
public DataRow readLocation(DataRow newRow, BinaryReader br)
{
bool brInitialized = br != null;
if (brInitialized)
{
for (int currentProperty = 0; currentProperty < locationProperties.Length; currentProperty++)
{
PropertyInfo property = locationProperties[currentProperty];
if (property.PropertyType == typeof(int) || property.PropertyType == typeof(Int32))
{
newRow[currentProperty] = br.ReadInt32();
}
}
return newRow;
}
else
{
//br init error
return null;
}
}
public DataRow readLocationScript(DataRow newRow, BinaryReader br)
{
bool brInitialized = br != null;
int scriptSize = 0;
if (brInitialized)
{
for (int currentProperty = 0; currentProperty < locationScriptProperties.Length; currentProperty++)
{
PropertyInfo property = locationScriptProperties[currentProperty];
if (property.PropertyType == typeof(int) || property.PropertyType == typeof(Int32))
{
if (property.Name == "scriptSize")
{
scriptSize = br.ReadInt32();
newRow[currentProperty] = scriptSize;
}
else
{
newRow[currentProperty] = br.ReadInt32();
}
}
if (property.PropertyType == typeof(string))
{
newRow[currentProperty] = Encoding.Default.GetString(br.ReadBytes(scriptSize));
}
}
return newRow;
}
else
{
//br init error
return null;
}
}
public DataRow readActor(DataRow newRow, BinaryReader br)
{
bool brInitialized = br != null;
if (brInitialized)
{
for (int currentProperty = 0; currentProperty < actorProperties.Length; currentProperty++)
{
PropertyInfo property = actorProperties[currentProperty];
if (property.PropertyType == typeof(short))
{
if (property.Name == "id")
{
newRow[currentProperty] = br.ReadInt16();
br.ReadInt16();
}
else
{
newRow[currentProperty] = br.ReadInt16();
}
}
if (property.PropertyType == typeof(int))
{
if (property.Name == "x" || property.Name == "y")
{
newRow[currentProperty] = (int)(br.ReadSingle() / 5.25f);
}
else
{
newRow[currentProperty] = br.ReadInt32();
}
}
}
return newRow;
}
else
{
return null;
}
}
public List<DataRow> readActorScript(int actorId, int scriptCount, DataRow newRow, BinaryReader br)
{
bool brInitialized = br != null;
int scriptSize = 0;
if (brInitialized)
{
List<DataRow> rowCollection = new List<DataRow>();
for (int currentScript = 0; currentScript < scriptCount; currentScript++)
{
DataRow outRow = newRow.Table.NewRow();
for (int currentProperty = 0; currentProperty < actorScriptProperties.Length; currentProperty++)
{
PropertyInfo property = actorScriptProperties[currentProperty];
if (property.PropertyType == typeof(short))
{
if (property.Name == "actorId")
{
outRow[currentProperty] = actorId;
}
}
if (property.PropertyType == typeof(int))
{
if (property.Name == "scriptSize")
{
scriptSize = br.ReadInt32();
outRow[currentProperty] = scriptSize;
}
else
{
outRow[currentProperty] = br.ReadInt32();
}
}
if (property.PropertyType == typeof(string))
{
outRow[currentProperty] = Functions.byteConverter.BytesToString(br.ReadBytes(scriptSize));
}
}
rowCollection.Add(outRow);
}
return rowCollection;
}
return null;
}
public bool Save(string savePath)
{
return false;
}
}
yes i add the resource files from the repack to the resource folder of rappelzQuote:
Are you using the resources that came with the repack?
What client did you happen to pick to run with the repack?