Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 21:33

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

Advertisement



[Problem]Guild Allies and Enemies

Discussion on [Problem]Guild Allies and Enemies within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,785
Received Thanks: 5,304
[Problem]Guild Allies and Enemies

Well after two days of having a go at this, and one day of asking people for help, I finally decided it was time to ask the community for help.
Well I am trying to load allies from the Guilds.dat file.
They are defined as
Code:
public Dictionary<uint, string> Allies = new Dictionary<uint, string>();
When something is added to the dictionary its like this.
Code:
Allies.Add(GuildID, GuildName);
Now when saving to the guild.dat file, its saved like this.
Code:
            BW.Write((int)Allies.Count);
            foreach (KeyValuePair<uint, string> kvp in Allies)
            {
                BW.Write(kvp.Key);
                BW.Write(kvp.Value);
            }
And when loading, it loads like this.
Code:
            int a = BR.ReadInt32();
            {
                for (int i = 0; i < a; i++)
                    Allies.Add(BR.ReadUInt32(), BR.ReadString());
                
            }
I get an error at Allies.Add(BR.ReadUInt32(), BR.ReadString()); when loading.
Unable to read beyond the end of the stream.
is the error I get.
Any help?
Arcо is offline  
Old 08/16/2010, 11:06   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
When using ReadString() I think it looks for a null value to signify the end of the string, so you'll need to make sure you write that in somewhere, or you could specify a string length value in the file and have it read a string which is String_Length long.
Korvacs is offline  
Thanks
1 User
Old 08/16/2010, 17:14   #3


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Arco, when you will be on MSN, if you want ask me, I will check with you.
CptSky is offline  
Reply


Similar Threads Similar Threads
Save Guild Enemies/Allies
12/07/2010 - CO2 PServer Guides & Releases - 131 Replies
First and foremost this is for 5165 Tanel source. NewestCOServer. Well first define this in features/guilds.cs under public class Guild public Dictionary<uint, string> Allies = new Dictionary<uint, string>(); public Dictionary<uint, string> Enemies = new Dictionary<uint, string>(); public static void CreateNewGuild(string GName, ushort GID, Character Creator) And at the bottom of this void, put this
allies and enemies
03/31/2010 - CO2 Private Server - 1 Replies
Anybody know if Guild Allie and Enemy code is released for LOTF? The status are added, but not codes for npc. And im to lazy to make it, so if is not released ill just leave it untill i got time to make it ^^ Thanks
[Help]Guild Allies
02/14/2010 - CO2 Private Server - 9 Replies
could someone help me with allies this is what i have so far if (MyChar.GuildPosition == 100) { if (MyChar.MyGuild.Allies.Count <= 6) { string Allies = ""; for (int i = 14; i < 14 + Data; i++) { Allies +=...
[Question]Guild Allies
02/02/2010 - CO2 Private Server - 0 Replies
could someone help me with adding allies its for 5017
guild and allies
12/29/2007 - CO2 Weapon, Armor, Effects & Interface edits - 0 Replies
hi all i was thinking does anyone know if its possible to make allie colors yellow and guild green cause i like the green more grtz



All times are GMT +1. The time now is 21:35.


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.