First and foremost this is for 5165 Tanel source. NewestCOServer.
Well first define this in features/guilds.cs under public class Guild
And at the bottom of this void, put this
Scroll down you should see this
At the bottom, under BW.Write(Wins);
insert this,
Next scroll down to public Guild(BinaryReader BR) and under
Wins = BR.ReadUInt32();
insert this
And bam, loading and saving.
To add to the dictionary it is GuildID then GuildName.
Well first define this in features/guilds.cs under public class Guild
Code:
public Dictionary<uint, string> Allies = new Dictionary<uint, string>();
public Dictionary<uint, string> Enemies = new Dictionary<uint, string>();
Code:
public static void CreateNewGuild(string GName, ushort GID, Character Creator)
Code:
G.Allies.Add(0, "");
G.Enemies.Add(0, "");
Code:
public void SaveThis(BinaryWriter BW)
insert this,
Code:
BW.Write((int)Allies.Count);
foreach (KeyValuePair<uint, string> kvp in Allies)
{
BW.Write(Convert.ToUInt32(kvp.Key));
BW.Write(Convert.ToString(kvp.Value));
}
BW.Write((int)Enemies.Count);
foreach (KeyValuePair<uint, string> kvp in Enemies)
{
BW.Write(Convert.ToUInt32(kvp.Key));
BW.Write(Convert.ToString(kvp.Value));
}
Wins = BR.ReadUInt32();
insert this
Code:
int a = BR.ReadInt32();
{
for (int i = 0; i < a; i++)
Allies.Add(BR.ReadUInt32(), BR.ReadString());
}
int e = BR.ReadInt32();
{
for (int i = 0; i < e; i++)
Enemies.Add(BR.ReadUInt32(), BR.ReadString());
}
To add to the dictionary it is GuildID then GuildName.