okay so my plan is to save the Halos (i assume you all know what that is) in OldCODB same as the other things such as, Nobility. Nobility saves the names of people inside the Nobility.dat in OldCODB. So I found out where it sends the info save to OldCODB which is in Database.cs. So I'm trying to make something similar to saving Halos. (so that when you log out it gets saved so that when you re-log you still have it.)
So I'm taking this as an example. But I noticed It's only 1 of these (starting with public static void, sorry if i don't use C# Words lol i'm still learning)
And so then I look at the Nobility and then it has SaveEmpire and LoadEmpire. So, I'm assuming that it means that it saves the Nobility rank and then when you login it loads it right? How can I do this for the Halos? (sorry if I've confused you).
#edit- To make things easier, this is what I have to make a "definition" or w\e for right?
This is the one I'm trying to make, I took it as an example for Nobility's SaveEmpire:
So I'm taking this as an example. But I noticed It's only 1 of these (starting with public static void, sorry if i don't use C# Words lol i'm still learning)
Code:
}
public static void SaveKOs()
{
FileStream FS = new FileStream(@"C:\OldCODB\KOBoard.dat", FileMode.OpenOrCreate);
BinaryWriter BW = new BinaryWriter(FS);
for (int i = 0; i < Game.World.KOBoard.Length; i++)
Game.World.KOBoard[i].WriteThis(BW);
BW.Close();
FS.Close();
}
And so then I look at the Nobility and then it has SaveEmpire and LoadEmpire. So, I'm assuming that it means that it saves the Nobility rank and then when you login it loads it right? How can I do this for the Halos? (sorry if I've confused you).
Code:
public static void SaveEmpire()
{
FileStream FS = new FileStream(@"C:\OldCODB\Nobility.dat", FileMode.OpenOrCreate);
BinaryWriter BW = new BinaryWriter(FS);
for (int i = 0; i < Game.World.EmpireBoard.Length; i++)
Game.World.EmpireBoard[i].WriteThis(BW);
BW.Close();
FS.Close();
}
public static void LoadEmpire()
{
if (System.IO.File.Exists(@"C:\OldCODB\Nobility.dat"))
{
FileStream FS = new FileStream(@"C:\OldCODB\Nobility.dat", FileMode.Open);
BinaryReader BR = new BinaryReader(FS);
for (int i = 0; i < Game.World.EmpireBoard.Length; i++)
Game.World.EmpireBoard[i].ReadThis(BR);
BR.Close();
FS.Close();
}
#edit- To make things easier, this is what I have to make a "definition" or w\e for right?
Code:
for (int i = 0; i < Game.World.[B]Halo[/B].Length; i++)
Game.World.[B]HaloBoard[/B][i].ReadThis(BR);
Code:
for (int i = 0; i < Game.World.[B]EmpireBoard[/B].Length; i++)
Game.World.[B]EmpireBoard[/B][i].WriteThis(BW);