public static INIFile Legacy(String filename) { if (Legacy_INI_Root == null) { String result_buf = new String(' ', 256); //char[] result_buf = new char[256]; StringBuilder INI_Root = new StringBuilder(); INI_Root.Length = 256; GetProfileString("Fortunet", "System Path", "c:/ftn3000/working/ftnsys.ini", INI_Root, result_buf.Length); Legacy_INI_FtnSys = INI_Root.ToString(); Legacy_INI_Root = INI.File(INI_Root.ToString())["System"]["INI Path", "c:/ftn3000/working"].Value; } if (filename == null) { filename = Legacy_INI_FtnSys; } if (filename[1] == ':' || filename[0] == '/' || filename[0] == '\\') { ; } else { filename = Legacy_INI_Root + "/" + filename; } foreach (INIFile file in files) { if (file.file == filename) { return(file); } } INIFile result = new INIFile(); result.file = filename; files.Add(result); result.OpenFile(filename); return(result); }
public static INIFile File(String filename) { bool checknull = false; if (filename == INIFile.system_base_file) { checknull = true; } foreach (INIFile file in files) { if ((checknull && file.file == null) || (file.file != null && String.Compare(filename, file.file, true) == 0)) { return(file); } } INIFile result = new INIFile(); files.Add(result); result.OpenFile(filename); return(result); }
void PopulateTree() { treeView1.Nodes.Clear(); if (map == null) { map = INI.Default; // Default; } if (map == null) { return; } foreach (INISection s in map) { TreeNode node; this.treeView1.Nodes.Add(node = new INITreeNode(s)); foreach (INIEntry e in s) { this.treeView1.Nodes.Add(node = new INITreeNode(e)); node.Collapse(); node.Nodes.Add("blank"); } } }
static BingoDealers( ) { #if use_legacy_config // 32 packs. ( this should come from an ini option... but I don't know what it is right now. cardset_deals_from = new List<int>(); xperdex.classes.INIFile mini_ini = xperdex.classes.INI.LegacyFile( "mini.ini" ); xperdex.classes.INIFile ftnsys = xperdex.classes.INI.Default;//"c:/ftn3000/working/sams/caller/ftnsys.ini" ); xperdex.classes.INIFile bingo = xperdex.classes.INI.File( xperdex.classes.INI.Default["DATA FILES"]["Cardset INI","c:/ftn3000/working/bingo.ini"] ); //int sets = Convert.ToInt32( bingo["CARDS"]["Max Ranges"] ); int pos_count = ftnsys["SYSTEM"]["POS Count","5"]; int card_game_skip = ftnsys["CARDS"]["Game Step"]; for( int pack = 1; pack <= 32; pack++ ) { cardset_deals_from[pack - 1] = ftnsys["CARDS"]["pack " + pack + " deals from cardset","0"]; //for( int set = 0; set < sets; set++ ) { //String line = bingo["CARDS"]["set" + set]; //String[] parts = line.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); //if( parts[4].Substring( 0, 1 ).ToUpper() == "E" ) { // expect a dealer set for this cardset... int cardset = cardset_deals_from[pack - 1]; if( cardset_deals_from[pack - 1] >= dealers.Count ) { int card_base = ftnsys["cardset " + cardset]["Card Base"]; int card_base_old = mini_ini["CARDS"]["Base"]; if( card_base_old != card_base && ( cardset_deals_from[pack-1] == 0 ) ) { xperdex.classes.Log.log( "Notice, configuration error has happeend between ftnsys cardset 0 and mini.ini base." ); //card_base = card_base_old; } int card_skip = ftnsys["cardset " + cardset]["Card Skip"]; // voted nastiest line this month. String line = bingo["CARDS"]["SET"+ftnsys["cardset "+cardset]["bingo.ini card set"]]; BingoCardset bingo_cardset; if( line != null ) { xperdex.classes.Log.log( "set = " + line ); String[] parts = line.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); xperdex.classes.Log.log( "set = " + line ); bingo_cardset = new BingoCardset( parts[1] ); } else bingo_cardset = new BingoCardset(); bingo_cardset.card_skip = card_skip; bingo_cardset.game_skip = card_game_skip; bingo_cardset.range_base = card_base; bingo_cardset.card_offset = ftnsys["cardset " + cardset]["Eltanin Card Offset (CV2)"]; dealers.Add( bingo_cardset ); for( int pos = 0; pos < pos_count; pos++ ) { String range = ftnsys["cardset " + cardset]["Range on POS " + (pos+1),"1,12000000"]; String[] ranges = range.Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); Int32 min = Convert.ToInt32( ranges[0] ); Int32 max = Convert.ToInt32( ranges[1] ); BingoDealer dealer = new BingoDealer(); dealer.min_range = min; dealer.max_range = max; dealer.packs_db_base = card_base_old; dealer.group_wrap_games = false; dealer.cardset = bingo_cardset; bingo_cardset.Add( dealer ); } } } } } #endif /* [Cardset 1] Card Base=200000 bingo.ini card set=1
public INISection(INIFile ini, string s) { this.ini = ini; this.s = s; }
public INIEditor(INIFile map) { InitializeComponent(); this.map = map; }