I need help! :D

07/19/2009 19:04 AndreaCo#1
Hello i really need help with sumthing.. im trying to code in sumthing that will save server information in ini. but i cant seem to get sum stuff to get the information.. here is the definistions for the code

Code:
      #region npccosts
        public static ushort lottonpccost = 20000;
        public static ushort upgradeing120U = 30000;
        public static ushort upgradeing120H = 25000;
        public static ushort itemsoc = 20000;
        public static ushort Conductress = 10000;
        #endregion 

        #region npcowners
        public static string LottoOwner = "";
        public static string U120UOwner = "";
        public static string U120HOwner = "";
        public static string ItemSocowner = "";
        public static string ConductressOwner = "";
        #endregion
and here is the code for getting the info (the save works fine)

Code:
    public static void GetServerInfo()
        {
            try
            {
                Ini Cli = new Ini(System.Windows.Forms.Application.StartupPath + @"\database\\serverinfo.ini");
                General.ItemSocowner = Cli.ReadValue("ServerInfo", "SocItemOwner");
                
                
                General.LottoOwner = Cli.ReadValue("ServerInfo", "LottoOwner");
                
                General.U120UOwner = Cli.ReadValue("ServerInfo", "UpgradeUOwner");
                General.U120HOwner = Cli.ReadValue("ServerInfo", "UpgradeHOwner");
                General.ConductressOwner = Cli.ReadValue("ServerInfo", "ConductressOwner");
                Console.WriteLine("Server information loaded succesfully");
                
                General.itemsoc = ushort.Parse(Cli.ReadValue("ServerInfo", "SocItemCost"));
                General.upgradeing120H = ushort.Parse(Cli.ReadValue("ServerInfo", "UpgradeHcost"));
                General.upgradeing120U = ushort.Parse(Cli.ReadValue("ServerInfo", "UpgradeUCost"));
                General.Conductress = ushort.Parse(Cli.ReadValue("ServerInfo", "ConductressCost"));
                General.lottonpccost = ushort.Parse(Cli.ReadValue("ServerInfo", "LottoCost"));
                Console.WriteLine("Server information loaded succesfully");
                
                 
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
anyways ur help is appriciated :D


EDIT: THE ONLY THING THAT I CANT GET TO LOAD IS THE COSTS !!
07/19/2009 19:23 damianpesta#2
Quote:
Originally Posted by AndreaCo View Post
Hello i really need help with sumthing.. im trying to code in sumthing that will save server information in ini. but i cant seem to get sum stuff to get the information.. here is the definistions for the code

Code:
      #region npccosts
        public static ushort lottonpccost = 20000;
        public static ushort upgradeing120U = 30000;
        public static ushort upgradeing120H = 25000;
        public static ushort itemsoc = 20000;
        public static ushort Conductress = 10000;
        #endregion 

        #region npcowners
        public static string LottoOwner = "";
        public static string U120UOwner = "";
        public static string U120HOwner = "";
        public static string ItemSocowner = "";
        public static string ConductressOwner = "";
        #endregion
and here is the code for getting the info (the save works fine)

Code:
    public static void GetServerInfo()
        {
            try
            {
                Ini Cli = new Ini(System.Windows.Forms.Application.StartupPath + @"\database\\serverinfo.ini");
                General.ItemSocowner = Cli.ReadValue("ServerInfo", "SocItemOwner");
                
                
                General.LottoOwner = Cli.ReadValue("ServerInfo", "LottoOwner");
                
                General.U120UOwner = Cli.ReadValue("ServerInfo", "UpgradeUOwner");
                General.U120HOwner = Cli.ReadValue("ServerInfo", "UpgradeHOwner");
                General.ConductressOwner = Cli.ReadValue("ServerInfo", "ConductressOwner");
                Console.WriteLine("Server information loaded succesfully");
                
                General.itemsoc = ushort.Parse(Cli.ReadValue("ServerInfo", "SocItemCost"));
                General.upgradeing120H = ushort.Parse(Cli.ReadValue("ServerInfo", "UpgradeHcost"));
                General.upgradeing120U = ushort.Parse(Cli.ReadValue("ServerInfo", "UpgradeUCost"));
                General.Conductress = ushort.Parse(Cli.ReadValue("ServerInfo", "ConductressCost"));
                General.lottonpccost = ushort.Parse(Cli.ReadValue("ServerInfo", "LottoCost"));
                Console.WriteLine("Server information loaded succesfully");
                
                 
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
anyways ur help is appriciated :D


EDIT: THE ONLY THING THAT I CANT GET TO LOAD IS THE COSTS !!

1.Whats the point of saving it in Ini?You could save it with character , unless you're using grabage INI's.
2.I guess its a useless thing to be done really.
07/19/2009 19:29 AndreaCo#3
not if u know what im coding.. and i asked for help.. not dumn suggestions by an idiot..
07/19/2009 19:35 damianpesta#4
Quote:
Originally Posted by AndreaCo View Post
not if u know what im coding.. and i asked for help.. not dumn suggestions by an idiot..
You know what? Die , cause nobody's gonna help you.So buzz off mangina.I gave you a better & faster way of doing it , and I was called an Idiot.LOL b*tch
07/19/2009 19:38 AndreaCo#5
why would i do a whole new thing once i have this all done with just one bug.. and im sure a lot of people can help me so please dont post in this thread anymore
07/19/2009 19:40 damianpesta#6
Quote:
Originally Posted by AndreaCo View Post
why would i do a whole new thing once i have this all done with just one bug.. and im sure a lot of people can help me so please dont post in this thread anymore
Because LOTF's Ini class sucks.
07/19/2009 19:45 AndreaCo#7
my source is in mysql and i just want to save this ONE thing in ini caus i find it faster then mysql..