Register for your free account! | Forgot your password?

You last visited: Today at 07:38

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



I need help! :D

Discussion on I need help! :D within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
AndreaCo's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 510
Received Thanks: 104
I need help! :D

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


EDIT: THE ONLY THING THAT I CANT GET TO LOAD IS THE COSTS !!
AndreaCo is offline  
Old 07/19/2009, 19:23   #2
 
damianpesta's Avatar
 
elite*gold: 0
Join Date: Jan 2007
Posts: 1,034
Received Thanks: 58
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


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.
damianpesta is offline  
Old 07/19/2009, 19:29   #3
 
AndreaCo's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 510
Received Thanks: 104
not if u know what im coding.. and i asked for help.. not dumn suggestions by an idiot..
AndreaCo is offline  
Old 07/19/2009, 19:35   #4
 
damianpesta's Avatar
 
elite*gold: 0
Join Date: Jan 2007
Posts: 1,034
Received Thanks: 58
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
damianpesta is offline  
Old 07/19/2009, 19:38   #5
 
AndreaCo's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 510
Received Thanks: 104
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
AndreaCo is offline  
Old 07/19/2009, 19:40   #6
 
damianpesta's Avatar
 
elite*gold: 0
Join Date: Jan 2007
Posts: 1,034
Received Thanks: 58
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.
damianpesta is offline  
Old 07/19/2009, 19:45   #7
 
AndreaCo's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 510
Received Thanks: 104
my source is in mysql and i just want to save this ONE thing in ini caus i find it faster then mysql..
AndreaCo is offline  
Reply




All times are GMT +1. The time now is 07:38.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.