[DiscordArchive] Yeah, but what is LookupFileID doing?
[DiscordArchive] Yeah, but what is LookupFileID doing?
Archived author: Skarn • Posted: 2019-01-31T12:55:38.244000+00:00
Original source
Yeah, but what is LookupFileID doing?
Archived author: Kallar • Posted: 2019-01-31T12:55:46.774000+00:00
Original source
yeah
Archived author: Kallar • Posted: 2019-01-31T12:55:49.691000+00:00
Original source
was about to say that
Archived author: MaxtorCoder • Posted: 2019-01-31T12:55:57.031000+00:00
Original source
```csharp
private static void LookupFileID(uint id)
{
using (StreamReader sr = new StreamReader(Program.CSVFile))
{
while (!sr.EndOfStream)
{
string str;
string[] arr;
str = sr.ReadLine();
arr = str.Split(';');
CsvData data = new CsvData();
int dataid = int.Parse(arr[0]);
string filename = arr[1];
data.ID = dataid;
if (data.ID == id)
{
uint length = (uint)filename.Length;
M2Reader.TextureList.Add(filename, length);
}
}
}
}``` It's slow as fuck but it works.
Archived author: MaxtorCoder • Posted: 2019-01-31T12:56:12.583000+00:00
Original source
Have to make it faster at some point
Archived author: Skarn • Posted: 2019-01-31T12:56:15.911000+00:00
Original source
Okay
Archived author: Skarn • Posted: 2019-01-31T12:56:17.478000+00:00
Original source
That's good
Archived author: Skarn • Posted: 2019-01-31T12:56:25.138000+00:00
Original source
But that assumes that CSV contains all file names
Archived author: MaxtorCoder • Posted: 2019-01-31T12:56:26.859000+00:00
Original source
It is iterating through the CSV file and looking for the id provided in TXID
Archived author: Skarn • Posted: 2019-01-31T12:56:29.255000+00:00
Original source
But it does not