changed index name

lastudp
Tom Early 7 years ago
parent 3546a93c19
commit cc47e27cdb

@ -3598,22 +3598,21 @@ bool CQnetLink::Init(const char *cfgfile)
return true; return true;
} }
speak.resize(62);
std::string index(announce_dir); std::string index(announce_dir);
index.append("/speak.index"); index.append("/index.dat");
std::ifstream voicefile(index.c_str(), std::ifstream::in); std::ifstream indexfile(index.c_str(), std::ifstream::in);
if (voicefile) { if (indexfile) {
for (int i=0; i<62; i++) { for (int i=0; i<62; i++) {
std::string name, offset, size; std::string name, offset, size;
voicefile >> name >> offset >> size; indexfile >> name >> offset >> size;
if (name.size() && offset.size() && size.size()) { if (name.size() && offset.size() && size.size()) {
unsigned long of = std::stoul(offset); unsigned long of = std::stoul(offset);
unsigned long sz = std::stoul(size); unsigned long sz = std::stoul(size);
speak[i] = 1000U * of + sz; speak.push_back(1000U * of + sz);
printf("%s at %ld, %ld long\n", name.c_str(), of, sz);
} }
} }
voicefile.close(); printf("read %ld indicies from %s\n", speak.size(), index.c_str());
indexfile.close();
} }
return false; return false;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.