I don't understand why this doesn't work. Application dies with unhandled exception?
Code:
for(i=1;i<=serverpak.totalFiles();i++)
{
if(C PakFile *pf1=serverpak.find(serverpak.file(i).name))
{
pf1->data_size;
if(C PakFile *pf2=clientpak.find(serverpak.file(i).name))
{
pf2->data_size;
if((pf2->data_size)!=(pf1->data_size))
addfile(pf1->name);
}
else
{
addfile(pf1->name);
}
}
else
{
}
}
Nevermind, i fixed it. I went over the total number of files in serverpak.
Code:
i<=serverpak.totalFiles()-1
I have a small problem. This works but it only compares the files in the root of the 2 paks and ignores directories. How can i change this so it accounts for its folders too?
Code:
for(i=1;i<=serverpak.totalFiles()-1;i++)
{
if(C PakFile *pf1=serverpak.find(serverpak.file(i).name))
{
pf1->data_size;
if(C PakFile *pf2=clientnodata.find(serverpak.file(i).name))
{// compare pf2(client) with pf1(server). If data_size != server add file to download in mem container
pf2->data_size;
if((pf2->data_size)!=(pf1->data_size))
addfile(pf1->name);
}
else
{// if pf2(client) missing file from pf1(server) add file to other mem container
addmissing(pf1->name);
}
}
else
{
}
}
Nevermind again, i had to use serverpak.fileName(i) instead of serverpak.file(i).name
______________________________________________________________________________________________
Another small problem
How do i make it so it also adds the full directory of said file and modify it to not add the names of folders into memory?
I just had to replace
with
Code:
addfile(serverpak.fileName(i))