void TaskGetCharactersForDelete::onComplete() { bool success=true; AvatarList const & theList = getAvatars(); for (AvatarList::const_iterator i=theList.begin(); i!=theList.end(); ++i) { if (!LoginServer::getInstance().deleteCharacter(i->m_clusterId, i->m_networkId, getStationId())) success=false; } PurgeManager::onAllCharactersDeleted(getStationId(), success); }
// New station list from a glob structure stations *newStationList(glob_t *glb) { stations *ss; int j, file; ss = malloc(sizeof(stations)); ss->n = 0; ss->slist = NULL; /* Prepare stations table */ for (j = 0; j < glb->gl_pathc; j++) { glob_t *glbs = filelist(glb->gl_pathv[j], "*Z.SAC"); for (file = 0; file < glbs->gl_pathc; file++) { station *s = loadStation(glbs->gl_pathv[file]); int Id = getStationId(ss, s->name, s->net); if (Id == -1) { addss(ss, s); } else { killStation(s); } } glbs = killGlob(glbs); } qsort(&ss->slist[0], ss->n, sizeof(ss->slist[0]), cmpstation); return ss; }
// Create a pick from a sacfile pick *loadPick(char *filename, stations * ss) { char *name = NULL; char *net = NULL; int Id; pick *p = NULL; SACHEAD *h = io_readSacHead(filename); if (h == NULL) { fprintf(stderr, "On pick file %s not found.\n", filename); return p; } /* Check if the file is picked */ if (h->f == -12345. || h->a == -12345.) { h = io_freeData(h); return p; } hdu_getValueFromChar("KSTNM", h, NULL, NULL, &name); hdu_getValueFromChar("KNETWK", h, NULL, NULL, &net); Id = getStationId(ss, name, net); if (Id == -1) { fprintf(stderr, "Station for pick %s not found.\n", filename); h = io_freeData(h); name = io_freeData(name); net = io_freeData(net); return p; } p = malloc(sizeof(pick)); p->station = Id; p->phase = 1; p->tobs = h->f - h->o; p->tref = h->a - h->o; p->difference = p->tobs - p->tref; p->residual = -999.9; p->gcarc = h->gcarc; p->baz = h->baz; h = io_freeData(h); name = io_freeData(name); net = io_freeData(net); return p; }