[Help]Database.cs

08/07/2010 22:00 ftp4life#1
aite so lately for some reason donation has not been saving and i was looking in the database.cs and i dont really see anything wrong with it unless u count adding that fix 100% code save characters lvl and all for 5165 thread made by memo1340
would that cause the problem any helpers plz help :) ill thanks u thousands of times ahahaha lmfao... well hook da homie up.... but yea foshow... any sugestions
08/07/2010 22:43 .Beatz#2
That save might be the problem. Was the donations saving before you added it? If so I would suggest removing it. I have not looked at this code myself as I have no need for it. But just try removing the 100% code save for all characters before you try anything else. If this doesn't solve the problem write back on this thread and we can try and work something out.

Also I don't know how much you know about C# (guess that's what you using) but look in the 100% save code thing and make sure it is saving donations properly.
08/08/2010 19:38 ftp4life#3
yea i didnt look at it i will right now lol brb :)

Code:
if (File.Exists("C:\\OldCODB\\Users\\Characters\\" + Name + ".chr"))
                    return "Character already exists.";
                IniFile F = new IniFile("C:\\OldCODB\\Users\\Characters\\" + Name + ".chr");
                F.WriteString("Character", "name", Name);
                F.WriteString("Character", "spouse", "None");
                F.WriteString("Character", "whpass", "");
                F.WriteString("Character", "account", Account);
                F.WriteInteger("Character", "body", Body);
                F.WriteInteger("Character", "hair", (410 + (Program.Rnd.Next(5) * 100)));
                F.WriteInteger("Character", "map", 1010);
                F.WriteInteger("Character", "x", 61);
                F.WriteInteger("Character", "y", 110);
                F.WriteInteger("Character", "job", Job);
                F.WriteInteger("Character", "level", 1);
                F.WriteInteger("Character", "strength", 5);
                F.WriteInteger("Character", "agility", 5);
                F.WriteInteger("Character", "vitality", 5);
                F.WriteInteger("Character", "hitpoints", 33);
                F.WriteInteger("Character", "silvers", 10000);
                F.WriteInteger("Character", "merchant", 1);
                
                F.Save();
                IniFile Dr = new IniFile("C:\\OldCODB\\Users\\" + Account + ".usr");
                Dr.WriteString("User", "character", Name);
                Dr.Save();
                return "ANSWER_OK";
yea u were right i dont see anything that is actually saving the donations neither :) ty
08/09/2010 13:21 Fish*#4
I think nobility isnt saved at the characters.
It aint in my source.
Is just reading from nobility.dat, but ur using sql right?
then i dont know how it works with nobility.
08/09/2010 15:21 .Beatz#5
@ftp add me on msn. [Only registered and activated users can see links. Click Here To Register...].uk
Also are you using NewestCOServer? or Sql?
08/09/2010 16:46 killersub#6
dats cuz its only loading the "IMPORTANT" character files "EXCEPT" for nobility...if ur using a flat-file database I can help u if you dont den Ill figure out a diff load/save method for sql or u can figure dat part out...

FOR FLAT-FILE DATABASES, MAKE SURE YOU HAVE NOBILITY.DAT IN UR OLDCODB DATABASE FOLDER NOT IN ANY OTHER FOLDER:

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();
            }
        }
DAT will simply save/load the nobility for the .dat file...anyways u shuld have figured dis out as it was/is still in da source...