|
You last visited: Today at 04:09
Advertisement
[Request]Loading Guilds
Discussion on [Request]Loading Guilds within the CO2 Private Server forum part of the Conquer Online 2 category.
11/11/2008, 19:54
|
#1
|
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
|
[Request]Loading Guilds
Someone can help me with loading guils from Ini files? And creating them on Ini files?
|
|
|
11/11/2008, 22:21
|
#2
|
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
|
I'd help you if you actually knew stuff about .ini files..
And didn't just want to teh leach.
|
|
|
11/12/2008, 08:29
|
#3
|
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
|
Quote:
Originally Posted by tao4229
I'd help you if you actually knew stuff about .ini files..
And didn't just want to teh leach.
|
Lol, well,,, I'f got this :
Code:
uint UID = 0;
string GuildName = "";
uint GuildFund = 0;
int GWWins = 0;
int HoldingPole = 0;
uint MembersCount = 0;
string Bulletin = "";
string Allies = "";
string Enemies = "";
string GuildLeader = "";
string MemberNames = "";
string DeputyLeaders = "";
string[] DMembs = MemberNames.Split('.');
string[] DDLs = DeputyLeaders.Split('.');
string[] GFile = File.ReadAllLines(System.Windows.Forms.Application.StartupPath + @"\Others\Guilds.ini");
GUILDS = new string[GFile.Length][];
for (int i = 0; i < GFile.Length; i++)
{
string[] Splitter = GFile[i].Split('\n');
Splitter[0] = "[" + Convert.ToString(UID) + "]";
Splitter[1] = GuildName;
Splitter[2] = Convert.ToString(GuildFund);
Splitter[3] = Convert.ToString(GWWins);
Splitter[4] = Convert.ToString(HoldingPole);
Splitter[5] = Convert.ToString(MembersCount);
Splitter[6] = Bulletin;
Splitter[7] = Allies;
Splitter[8] = Enemies;
Splitter[9] = GuildLeader;
Splitter[10] = MemberNames;
Splitter[11] = DeputyLeaders;
}
Edit * : And I'f already got everything else into Ini's exept Guilds,,,,
|
|
|
11/12/2008, 08:57
|
#4
|
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
|
Question: Why would you want to store guilds in an ini file?
|
|
|
11/12/2008, 10:13
|
#5
|
elite*gold: 20
Join Date: Jun 2005
Posts: 1,489
Received Thanks: 301
|
LOL @ all the usage of strings
|
|
|
11/12/2008, 12:08
|
#6
|
elite*gold: 0
Join Date: Jun 2007
Posts: 286
Received Thanks: 409
|
Quote:
Originally Posted by YukiXian
Lol, well,,, I'f got this :
Code:
uint UID = 0;
string GuildName = "";
uint GuildFund = 0;
int GWWins = 0;
int HoldingPole = 0;
uint MembersCount = 0;
string Bulletin = "";
string Allies = "";
string Enemies = "";
string GuildLeader = "";
string MemberNames = "";
string DeputyLeaders = "";
string[] DMembs = MemberNames.Split('.');
string[] DDLs = DeputyLeaders.Split('.');
string[] GFile = File.ReadAllLines(System.Windows.Forms.Application.StartupPath + @"\Others\Guilds.ini");
GUILDS = new string[GFile.Length][];
for (int i = 0; i < GFile.Length; i++)
{
string[] Splitter = GFile[i].Split('\n');
Splitter[0] = "[" + Convert.ToString(UID) + "]";
Splitter[1] = GuildName;
Splitter[2] = Convert.ToString(GuildFund);
Splitter[3] = Convert.ToString(GWWins);
Splitter[4] = Convert.ToString(HoldingPole);
Splitter[5] = Convert.ToString(MembersCount);
Splitter[6] = Bulletin;
Splitter[7] = Allies;
Splitter[8] = Enemies;
Splitter[9] = GuildLeader;
Splitter[10] = MemberNames;
Splitter[11] = DeputyLeaders;
}
Edit * : And I'f already got everything else into Ini's exept Guilds,,,,
|
wth O.o
|
|
|
11/12/2008, 15:26
|
#7
|
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
|
Quote:
Originally Posted by unknownone
Question: Why would you want to store guilds in an ini file?
|
Cuz I want them all into Ini,
|
|
|
11/12/2008, 15:37
|
#8
|
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
|
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.
|
|
|
11/12/2008, 17:40
|
#9
|
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
|
Quote:
Originally Posted by unknownone
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...
|
|
|
11/12/2008, 18:12
|
#10
|
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
|
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)
|
|
|
11/12/2008, 18:19
|
#11
|
elite*gold: 0
Join Date: Dec 2005
Posts: 163
Received Thanks: 9
|
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
|
|
|
11/13/2008, 01:52
|
#12
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
|
@unknown:
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.
|
|
|
11/13/2008, 04:14
|
#13
|
elite*gold: 0
Join Date: Dec 2005
Posts: 163
Received Thanks: 9
|
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
|
|
|
11/14/2008, 23:19
|
#14
|
elite*gold: 0
Join Date: Jan 2007
Posts: 1,034
Received Thanks: 58
|
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
|
|
|
 |
Similar Threads
|
Guilds-Recruiting Thread (Join/Announce Guilds Here!!)
07/13/2011 - Silkroad Online - 95 Replies
Guilds-Recruiting
===
=====
=======
=========
===========
=============
|
[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
|
All times are GMT +1. The time now is 04:09.
|
|