当前位置: 首页>>代码示例>>C++>>正文


C++ WUser::GetFirstOn方法代码示例

本文整理汇总了C++中WUser::GetFirstOn方法的典型用法代码示例。如果您正苦于以下问题:C++ WUser::GetFirstOn方法的具体用法?C++ WUser::GetFirstOn怎么用?C++ WUser::GetFirstOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WUser的用法示例。


在下文中一共展示了WUser::GetFirstOn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: downloaded

void downloaded(char *pszFileName, long lCharsPerSecond) {
  uploadsrec u;

  for (int i1 = 0; i1 < GetSession()->numbatch; i1++) {
    if (wwiv::strings::IsEquals(pszFileName, batch[i1].filename) &&
        batch[i1].sending) {
      dliscan1(batch[i1].dir);
      int nRecNum = recno(batch[i1].filename);
      if (nRecNum > 0) {
        WFile file(g_szDownloadFileName);
        file.Open(WFile::modeReadWrite | WFile::modeBinary | WFile::modeCreateFile,
                  WFile::shareUnknown, WFile::permReadWrite);
        FileAreaSetRecord(file, nRecNum);
        file.Read(&u, sizeof(uploadsrec));
        GetSession()->GetCurrentUser()->SetFilesDownloaded(GetSession()->GetCurrentUser()->GetFilesDownloaded() + 1);
        GetSession()->GetCurrentUser()->SetDownloadK(GetSession()->GetCurrentUser()->GetDownloadK() +
            static_cast<int>(bytes_to_k(u.numbytes)));
        ++u.numdloads;
        FileAreaSetRecord(file, nRecNum);
        file.Write(&u, sizeof(uploadsrec));
        file.Close();
        if (lCharsPerSecond) {
          sysoplogf("Downloaded \"%s\" (%ld cps)", u.filename, lCharsPerSecond);
        } else {
          sysoplogf("Downloaded \"%s\"", u.filename);
        }
        if (syscfg.sysconfig & sysconfig_log_dl) {
          WUser user;
          GetApplication()->GetUserManager()->ReadUser(&user, u.ownerusr);
          if (!user.IsUserDeleted()) {
            if (date_to_daten(user.GetFirstOn()) < static_cast<signed int>(u.daten)) {
              ssm(u.ownerusr, 0, "%s downloaded|#1 \"%s\" |#7on %s",
                  GetSession()->GetCurrentUser()->GetUserNameAndNumber(GetSession()->usernum), u.filename, fulldate());
            }
          }
        }
      }
      delbatch(i1);
      return;
    }
  }
  sysoplogf("!!! Couldn't find \"%s\" in DL batch queue.", pszFileName);
}
开发者ID:bhaggerty,项目名称:wwiv,代码行数:43,代码来源:batch.cpp

示例2: valscan

void valscan() {
  // Must be local cosysop or better
  if (!lcs()) {
    return;
  }

  int ac = 0;
  int os = GetSession()->GetCurrentMessageArea();

  if (uconfsub[1].confnum != -1 && okconf(GetSession()->GetCurrentUser())) {
    ac = 1;
    tmp_disable_conf(true);
  }
  bool done = false;
  for (int sn = 0; sn < GetSession()->num_subs && !hangup && !done; sn++) {
    if (!iscan(sn)) {
      continue;
    }
    if (GetSession()->GetCurrentReadMessageArea() < 0) {
      return;
    }

    uint32_t sq = qsc_p[sn];

    // Must be sub with validation "on"
    if (!(xsubs[GetSession()->GetCurrentReadMessageArea()].num_nets)
        || !(subboards[GetSession()->GetCurrentReadMessageArea()].anony & anony_val_net)) {
      continue;
    }

    GetSession()->bout.NewLine();
    GetSession()->bout.Color(2);
    GetSession()->bout.ClearEOL();
    GetSession()->bout << "{{ ValScanning " << subboards[GetSession()->GetCurrentReadMessageArea()].name << " }}\r\n";
    lines_listed = 0;
    GetSession()->bout.ClearEOL();
    if (okansi() && !newline) {
      GetSession()->bout << "\r\x1b[2A";
    }

    for (int i = 1; i <= GetSession()->GetNumMessagesInCurrentMessageArea() && !hangup && !done; i++) {    // was i = 0
      if (get_post(i)->status & status_pending_net) {
        CheckForHangup();
        GetSession()->localIO()->tleft(true);
        if (i > 0 && i <= GetSession()->GetNumMessagesInCurrentMessageArea()) {
          bool next;
          int val;
          read_message(i, &next, &val);
          GetSession()->bout << "|#4[|#4Subboard: " << subboards[GetSession()->GetCurrentReadMessageArea()].name << "|#1]\r\n";
          GetSession()->bout <<  "|#1D|#9)elete, |#1R|#9)eread |#1V|#9)alidate, |#1M|#9)ark Validated, |#1Q|#9)uit: |#2";
          char ch = onek("QDVMR");
          switch (ch) {
          case 'Q':
            done = true;
            break;
          case 'R':
            i--;
            continue;
          case 'V': {
            open_sub(true);
            resynch(&i, nullptr);
            postrec *p1 = get_post(i);
            p1->status &= ~status_pending_net;
            write_post(i, p1);
            close_sub();
            send_net_post(p1, subboards[GetSession()->GetCurrentReadMessageArea()].filename,
                          GetSession()->GetCurrentReadMessageArea());
            GetSession()->bout.NewLine();
            GetSession()->bout << "|#7Message sent.\r\n\n";
          }
          break;
          case 'M':
            if (lcs() && i > 0 && i <= GetSession()->GetNumMessagesInCurrentMessageArea() &&
                subboards[GetSession()->GetCurrentReadMessageArea()].anony & anony_val_net &&
                xsubs[GetSession()->GetCurrentReadMessageArea()].num_nets) {
              open_sub(true);
              resynch(&i, nullptr);
              postrec *p1 = get_post(i);
              p1->status &= ~status_pending_net;
              write_post(i, p1);
              close_sub();
              GetSession()->bout.NewLine();
              GetSession()->bout << "|#9Not set for net pending now.\r\n\n";
            }
            break;
          case 'D':
            if (lcs()) {
              if (i > 0) {
                open_sub(true);
                resynch(&i, nullptr);
                postrec p2 = *get_post(i);
                delete_message(i);
                close_sub();
                if (p2.ownersys == 0) {
                  WUser tu;
                  GetApplication()->GetUserManager()->ReadUser(&tu, p2.owneruser);
                  if (!tu.IsUserDeleted()) {
                    if (static_cast<unsigned long>(date_to_daten(tu.GetFirstOn())) < p2.daten) {
                      GetSession()->bout.NewLine();
                      GetSession()->bout << "|#2Remove how many posts credit? ";
//.........这里部分代码省略.........
开发者ID:bhaggerty,项目名称:wwiv,代码行数:101,代码来源:valscan.cpp


注:本文中的WUser::GetFirstOn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。