From: Marc-Andre R. C. <kx...@us...> - 2002-06-22 07:22:01
|
Update of /cvsroot/planeshift/planeshift/src/updater/client In directory usw-pr-cvs1:/tmp/cvs-serv27452/client Modified Files: main.cpp uclient.cpp Log Message: Fixed small bug with the progress bars. Fixed problem with the file compare under linux. Index: main.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/updater/client/main.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.cpp 21 Jun 2002 21:40:50 -0000 1.9 --- main.cpp 22 Jun 2002 07:21:58 -0000 1.10 *************** *** 51,55 **** // display program info ! printf("PlaneShift MMORPG - %s [%s (%s)]\n\n", UC_NAME, UC_VERSION, U_BUILD); // get commandline options --- 51,55 ---- // display program info ! cout << "PlaneShift MMORPG - " << UC_NAME << "[" << UC_VERSION "(" << U_BUILD << ")]" << endl << endl; // get commandline options Index: uclient.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/updater/client/uclient.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** uclient.cpp 21 Jun 2002 18:36:21 -0000 1.10 --- uclient.cpp 22 Jun 2002 07:21:58 -0000 1.11 *************** *** 467,473 **** int list_length = fil.Length(); char *buffer; ! csString abs_path = "./"; ! cout << "Comparing local files with server file list..." << endl << "\tProgress -[ "; cout.flush(); --- 467,473 ---- int list_length = fil.Length(); char *buffer; ! csString abs_path; ! cout << "Comparing local files with server file list..." << list_length << endl << "\tProgress -[ "; cout.flush(); *************** *** 475,479 **** hashesPrinted = 0; int i,j=1; ! for(i=0;i<list_length;i++,j++) { #if defined(OS_LINUX) --- 475,479 ---- hashesPrinted = 0; int i,j=1; ! for(i=0;j<list_length;i++,j++) { #if defined(OS_LINUX) *************** *** 481,491 **** else if(fil[i].module == MODULE_PS) abs_path.Append(config->PSPath); abs_path.Append("/"); #endif abs_path.Append(fil[i].name); ! if(U_DEBUG) cout << "Checking " << abs_path.GetData() << ": "; ! // XXX FIXME no support for nocreate in c++ standard... ! is.open(abs_path.GetData(), ios::in|ios::binary /*|ios::nocreate*/); ! if(is) { // get the size of the file --- 481,492 ---- else if(fil[i].module == MODULE_PS) abs_path.Append(config->PSPath); abs_path.Append("/"); + #else + abs_path.Append("./"); #endif abs_path.Append(fil[i].name); ! if(U_DEBUG) cout << "(" << j << "|" << i << ") " << "Checking " << abs_path.GetData() << ": "; ! is.open(abs_path.GetData(), ios::in|ios::binary); ! if(is.is_open()) { // get the size of the file *************** *** 494,497 **** --- 495,499 ---- is.seekg(0, ios::beg); + cout << "filesize=" << filesize; buffer = new char[filesize]; is.read(buffer, filesize); *************** *** 519,523 **** } abs_path.Clear(); - abs_path += "./"; // show progress --- 521,524 ---- *************** *** 540,544 **** if (hashesPrinted != hashesTotal) { ! hashesNeeded = hashesTotal * (total ? (unsigned long)(((float)amount) / total) : 1); while (hashesNeeded > hashesPrinted) --- 541,545 ---- if (hashesPrinted != hashesTotal) { ! hashesNeeded = hashesTotal * (total ? (((float)amount) / total) : 1); while (hashesNeeded > hashesPrinted) *************** *** 554,558 **** { progressCurrent++; - fprintf(stdout, "\n"); cout << endl; } --- 555,558 ---- |