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
When something is added to the dictionary its like this.
Now when saving to the guild.dat file, its saved like this.
And when loading, it loads like this.
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?
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>();
Code:
Allies.Add(GuildID, GuildName);
Code:
BW.Write((int)Allies.Count);
foreach (KeyValuePair<uint, string> kvp in Allies)
{
BW.Write(kvp.Key);
BW.Write(kvp.Value);
}
Code:
int a = BR.ReadInt32();
{
for (int i = 0; i < a; i++)
Allies.Add(BR.ReadUInt32(), BR.ReadString());
}
Unable to read beyond the end of the stream.
is the error I get.
Any help?