コード例 #1
0
ファイル: binkp_config.cpp プロジェクト: wwivbbs/wwiv
// For testing
BinkConfig::BinkConfig(int callout_node_number, const wwiv::sdk::Config& config, const string& network_dir)
  : config_(config), callout_network_name_("wwivnet"), callout_wwivnet_node_(callout_node_number), 
    networks_({ test_net(network_dir) }) {
  binkp_.reset(new Binkp(network_dir));
  system_name_ = config.config()->systemname;
  sysop_name_ = config.config()->sysopname;
  gfiles_directory_ = config.config()->gfilesdir;
}
コード例 #2
0
ファイル: binkp_config.cpp プロジェクト: TellarHK/wwiv
// For testing
BinkConfig::BinkConfig(int callout_node_number, const wwiv::sdk::Config& config, const string& network_dir)
  : callout_network_name_("wwivnet"), callout_node_(callout_node_number), 
    networks_({ test_net(network_dir) }) {
  ParseAddressesFile(&node_config_, network_dir);
  system_name_ = config.config()->systemname;
  sysop_name_ = config.config()->sysopname;
  gfiles_directory_ = config.config()->gfilesdir;
}
コード例 #3
0
ファイル: sysop_account.cpp プロジェクト: TRI0N/wwiv
void create_sysop_account(wwiv::sdk::Config& config) {
  out->Cls(ACS_CKBOARD);
  unique_ptr<CursesWindow> window(out->CreateBoxedWindow("System Configuration", 8, 54));

  uint8_t newuser_colors[10];
  uint8_t newuser_bwcolors[10];

  IniFile ini(FilePath(config.root_directory(), "wwiv.ini"), {"WWIV"});
  if (ini.IsOpen()) {
    for (int i = 0; i < 10; i++) {
      {
        const string key_name = StringPrintf("%s[%d]", "NUCOLOR", i);
        uint8_t num = ini.value<uint8_t>(key_name);
        if (num != 0) {
          newuser_colors[i] = num;
        }
      }
      {
        const string key_name = StringPrintf("%s[%d]", "NUCOLORBW", i);
        uint8_t num = ini.value<uint8_t>(key_name);
        if (num != 0) {
          newuser_bwcolors[i] = num;
        }
      }
    }

  }
  UserManager usermanager(config.datadir(), sizeof(userrec), config.config()->maxusers);

  int y = 1;

  User u = {};
  u.ZeroUserData();
  User::CreateNewUserRecord(&u, syscfg.newusersl, syscfg.newuserdsl,
    syscfg.newuser_restrict, syscfg.newusergold,
    newuser_colors, newuser_bwcolors);
  window->PrintfXY(COL1_LINE, y++, "Sysop Name/Handle: ");
  window->PrintfXY(COL1_LINE, y++, "Sysop Real Name  : ");
  window->PrintfXY(COL1_LINE, y++, "Sysop Password   : "******"Sysop phone      : ");
  EditItems items{
    new StringEditItem<unsigned char*>(COL1_POSITION, 1, 30, u.data.name, true),
    new StringEditItem<unsigned char*>(COL1_POSITION, 2, 20, u.data.realname, true),
    new StringEditItem<char*>(COL1_POSITION, 3, 8, u.data.pw, true),
    new StringEditItem<char*>(COL1_POSITION, 4, 12, u.data.phone, true),
  };

  items.set_curses_io(out, window.get());
  items.Run();

  u.data.sl = 255;
  u.data.dsl = 255;
  u.data.restrict = 0;
  u.SetStatusFlag(User::ansi);
  u.SetStatusFlag(User::color);
  usermanager.WriteUser(&u, 1);

  if (read_status()) {
    statusrec.users++;
    save_status();
  }

}