Yeah, I figured from the question that you want to, I'm asking WHY?
What advantage are you trying to gain from doing so?
I could probably easily list 20 reasons why not to use an ini file for this purpose. Only trying to give advice.
Yeah, I figured from the question that you want to, I'm asking WHY?
What advantage are you trying to gain from doing so?
I could probably easily list 20 reasons why not to use an ini file for this purpose. Only trying to give advice.
Because I'm using Ini's for everything else too. So I only need the Ini Guilds.
I made them Ini's so I don't have that stupid MySQL Frozen thingy.
And in my opinion a Ini file is easyr to edit...
You should only use plain text files for data that doesn't need constant accessing, i.e. certain server settings, or data that is only loaded into memory on server startup and doesn't change while the server is running. Having data like guilds, which needs constant updating is really going to slow you down. While it might seem quick enough now, as the data in those files builds up, it'll take increaingly longer to find or edit something.
Plain text files are a major slowdown when modifying, because you can't just insert your few bytes of data where they need to be, instead, you need to copy the whole content of the file just to insert a small amount of data. Imagine now, you have a few hundred/thousand entries in that file - it's going to take an awful long time to modify. Your server will become unplayable in no time.
Reading from ini files isn't exactly quick either - you need to do a full on search every time. While you might be able to come up with a decent search algorithm, I doubt it'll match the performance an stability of MySQL or other DB. You're just going to be giving yourself an awful lot of work for no gain.
Now, the "easy editing" idea of ini files you have is a blatant misjudgement. Firstly, how do you find entries to edit? Sure you can find a guild by name, but what about finding guilds that have a certain number of members, or a negative fund etc. It's not going to be very simple.
Once you have found your data, what if you accidentally make a typo, for example, sticking an special character where it shouldn't be. Your code will cry, your server will crash. There's no validation checking on such things, unless you code it yourself - not worth the effort.
Now, you have your ini file, but you decide one day that, you need to add an extra field to guilds (ie, a patch adds something). Now you're fucked, because you're gonna have to do a rewrite of code, write a script that will convert the old format to the new one and copy all the data accross. It's an unmaintainable format.
Now, I'm not saying "use MySQL", although I'd reccomend it, but ini files are not the solution. Have you considered using PostgreSQL for example? It's much more stable than MySQL when handling multiple connections, timeouts etc, but has significantly slower access time (still quick enough for a game server).
Another solution might be to use SQLLite, which doesn't require a server, it just uses a plain file for the database.
Or, if you really do believe you should do everything yourself, a text file is definitely not the solution. What you need, is a random access/binary file, which, rather than inserting data at an arbitrary location, you can append it at the end, or insert into empty space, and you have a "table" saying where everything is. This is essentially what a database is doing, only a DB is much more verbose.
Not sure how you convinced yourself that using ini's would be a good idea, or if someone else convinced you, I think they were probably taking the piss. Stop while your ahead - MySQL is stable enough, you just need to fix what's wrong with it. (Official servers run on MySQL, they don't freeze up)
If He wants to put it into ini files dont flame him for it. Dont come in here tao and flame ppl for leeching and other stuff when u dont have the right cause i can rember some stupid questions you have asked many times. Tho my project is in vb.net i cant help with c# but i hope Yuki hope u can get it done.
As u may know the popular server HCO was all flat files.
And i am sure Acid is again all flat files cause Hybrid is the main coder
Like I said, nobody wants to figure out the problem with it because LOTF is garbage and anyone still using LOTF isn't and will not be competent enough to do so. The people competent enough to not make MySQL freeze aren't using LOTF and are most likely making their own source.
Like I said though on MSN, I'm really probably the only person who can use ini's without the performance loss of not using a SQL instead.
Quote:
If He wants to put it into ini files dont flame him for it. Dont come in here tao and flame ppl for leeching and other stuff when u dont have the right cause i can rember some stupid questions you have asked many times. Tho my project is in vb.net i cant help with c# but i hope Yuki hope u can get it done.
As u may know the popular server HCO was all flat files.
And i am sure Acid is again all flat files cause Hybrid is the main coder
Sparkie (unknown) wasn't flaming him, just enlightening him about the horrors of using ini's when used incorrectly. Yes HCO was flat-files, but as many people know, and as I've stated, I'm the exception to the SQL > INI rule, nobody else (atleast nobody in the conquer community trying to use ini's right now) will beable to become exempt to this rule -- it's highly unlikely, which is why even I suggest to use a SQL over inis.
Lol very true MySQL would be at this time much more effecint i would have to agree. Thanks for you input on this i forgot to mention that only u have succed in the ini's without the performance loss.
Well I guess thats all to be said on the matter. Long Live Hybrid
I Am Trying To Get My Server Working With Ini's o.o NPC's Mobs and Mob Spawns r in ini's so far Trying to Solve Auth And Few others but im still noob in coding
[Request] Making ally and enemy guilds 03/30/2010 - CO2 Private Server - 0 Replies can anyone release or give me a guide making ally and enemy guild in 5165? or just give me the code? please i need it please..
thanks in advance if anyone give's me hehehhehe.
coemu ( fixed guilds but not loading when i reset server... 03/01/2010 - CO2 Private Server - 0 Replies the guilds work perfectly u can log off and log back on and it works but now when i reset the server. then it doesnt work and it comes up with this on my cmd when anyone whos supposed to have a guild logs in...
System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at CoEmu_v2_GameServer.Packets.ConquerPacket.GuildInf o(ClientSocket CSocket)
at CoEmu_v2_GameServer.PacketProcessor.ProcessPacket( Byte data, ClientSocke
t CSocket)
any help :P???
[Request] Guilds, Friends, Marriage, Auto Restart 07/02/2009 - CO2 Private Server - 8 Replies Hi everyone!
I'd like some help fixing my code for these sections. I use PowerSource. I would appreciate any code given, and any explanations on how to figure it out would be great.
Guilds - The name 'DataBase' does not exist in the current context in Guild.cs, line 32, 156, 179, 192, 236 Character.cs, line 1646
Friends - I can only find code for LOTF source. As is, friends will randomly disappear off the friend list. I think it's a problem packing or unpacking the list.
...
[Request]guilds and gw 08/31/2008 - CO2 Private Server - 3 Replies hey all
does anyone know how to let the guilds and guild war work in the tcwnn source i tried a few things first but i can't let it work
so if anyone can help ty