I can`t create characters :( 5165

12/21/2010 10:49 denominator#1
Ok so I still have the issue of not being able to create a character but I can create an account >.<

I am lead to understand that it`s because I have added something to the OldCODB? Is there any particular place that would cause this such as itemadd.txt? Or could it be ANYWHERE in the OldCODB that would cause the problem?

Please this is really annoying me now :(
12/21/2010 11:45 Korvacs#2
Did you modify the layout of the character save files?
12/21/2010 11:47 denominator#3
Nope :( But I read somewhere that Arco had a similar problem and deleted all chars and users to restart it. I tried that and still the same problem so I readded what I had deleted just so I can actually play the thing >.<

When you say character save files do you mean as in the C# source?
12/21/2010 11:49 Korvacs#4
Are you sure you didnt modify the character save files, things like adding new functionality to the server can modify the character save files..
12/21/2010 11:50 denominator#5
Ok I`m just trying to think and I added things for a ban system etc? I should take a look in character.cs to see if I have changed anything?
12/21/2010 11:52 Korvacs#6
No, you need to check to see if you modify anything to do with character loading, or character saving in the database class.
12/21/2010 12:03 denominator#7
Code:
 public static string CreateCharacter(string Account, string Name, ushort Body, byte Job)
        {
            try
            {
                if (File.Exists(@"C:\OldCODB\Users\" + Account + ".usr") && !File.Exists(@"C:\OldCODB\Users\Characters\" + Name + ".chr"))
                {
                    try
                    {
                        FileStream FS = new FileStream(@"C:\OldCODB\Users\Characters\" + Name + ".chr", FileMode.CreateNew);
                        FileStream FS2 = new FileStream(@"C:\OldCODB\Flowers\" + Name + ".chr", FileMode.CreateNew);
                        BinaryWriter BW = new BinaryWriter(FS);
                        BinaryWriter BW2 = new BinaryWriter(FS2);

                        BW2.Write((int)0);//RedRoses
                        BW2.Write((int)0);//RedRoses2day
                        BW2.Write((int)0);//Lilies
                        BW2.Write((int)0);//Lilies2day
                        BW2.Write((int)0);//Tulips
                        BW2.Write((int)0);//Tulips2day
                        BW2.Write((int)0);//Orchads
                        BW2.Write((int)0);//Orchads2day
                        BW2.Flush();
                        FS2.Flush();
                        BW2.Close();
                        FS2.Close();
                        BW.Write(Account);
                        BW.Write((uint)Program.Rnd.Next(1000001, 19999999));

                        if (Body == 1003 || Body == 1004)
                            BW.Write((ushort)1);//Avatar
                        else
                            BW.Write((ushort)201);//Avatar

                        BW.Write(Body);
                        BW.Write((ushort)(410 + (Program.Rnd.Next(5) * 100)));//Hair
                        BW.Write((ushort)1010);//Map
                        BW.Write((ushort)61);//X
                        BW.Write((ushort)109);//Y
                        BW.Write((ushort)0);//Previous Map
                        BW.Write(Job);
                        BW.Write((byte)0);//Previous Job, 1st RB
                        BW.Write((byte)0);
                        BW.Write((byte)1);//Level
                        BW.Write((ulong)0);//Experience

                        ushort Str = 0, Agi = 0, Vit = 0, Spi = 0;
                        GetInitialStats(Job, ref Str, ref Agi, ref Vit, ref Spi);

                        BW.Write(Str);
                        BW.Write(Agi);
                        BW.Write(Vit);
                        BW.Write(Spi);
                        BW.Write((ushort)0);//Stat Points
                        ushort HP = (ushort)(Vit * 24 + Str * 3 + Agi * 3 + Spi * 3);
                        BW.Write(HP);
                        BW.Write((ushort)(Spi * 5));//MP
                        BW.Write((ulong)0);//Donation
                        BW.Write((uint)100);//Silvers
                        BW.Write((uint)0);//CPs
                        BW.Write((uint)0);//Warehouse Silvers
                        BW.Write((ulong)0);//Virtue Points
                        BW.Write((ushort)0);//PK Points
                        BW.Write((ushort)0);//Guild
                        BW.Write((uint)0);//Guild Donation
                        BW.Write((byte)0);//Guild Rank
                        Game.Equipment Eq = new NewestCOServer.Game.Equipment();
                        Eq.Open();
                        Eq.WriteThis(BW);
                        BW.Write((byte)5);//Inventory Count
                        #region Beginner Items
                        if (Job == 100)
                        {
                            Game.Item I = new NewestCOServer.Game.Item();
                            I.ID = 421301;
                            I.MaxDur = ((DatabaseItem)DatabaseItems[(uint)421301]).Durability;
                            I.CurDur = I.MaxDur;
                            I.UID = (uint)Program.Rnd.Next(10000000);
                            I.WriteThis(BW);
                        }
                        else if (Job == 50)
                        {
                            Game.Item I = new NewestCOServer.Game.Item();
                            I.ID = 601301;
                            I.MaxDur = ((DatabaseItem)DatabaseItems[(uint)601301]).Durability;
                            I.CurDur = I.MaxDur;
                            I.UID = (uint)Program.Rnd.Next(10000000);
                            I.WriteThis(BW);
                        }
                        else
                        {
                            Game.Item I = new NewestCOServer.Game.Item();
                            I.ID = 410301;
                            I.MaxDur = ((DatabaseItem)DatabaseItems[(uint)410301]).Durability;
                            I.CurDur = I.MaxDur;
                            I.UID = (uint)Program.Rnd.Next(10000000);
                            I.WriteThis(BW);
                        }
                        Game.Item Armor = new NewestCOServer.Game.Item();
                        Armor.ID = 132004;
                        Armor.Color = (Game.Item.ArmorColor)(Program.Rnd.Next(3, 9));
                        Armor.MaxDur = ((DatabaseItem)DatabaseItems[(uint)132004]).Durability;
                        Armor.CurDur = Armor.MaxDur;
                        Armor.UID = (uint)Program.Rnd.Next(10000000);
                        Armor.WriteThis(BW);
                        Game.Item Stancher = new NewestCOServer.Game.Item();
                        Stancher.ID = 1000000;
                        Stancher.UID = (uint)Program.Rnd.Next(10000000);
                        Stancher.WriteThis(BW);
                        Stancher.UID = (uint)Program.Rnd.Next(10000000);
                        Stancher.WriteThis(BW);
                        Stancher.UID = (uint)Program.Rnd.Next(10000000);
                        Stancher.WriteThis(BW);
                        #endregion
                        for (int n = 0; n < 5; n++)
                        {
                            BW.Write((byte)0);//WH[n] Count
                            //Warehouse[n]
                        }
                        BW.Write((byte)0);//WH[5] Count
                        //Warehouse[5]

                        BW.Write((byte)0);//Prof Count

                        if (Job != 100)
                            BW.Write((byte)0);//SkillCount
                        else
                        {
                            BW.Write((byte)2);//SkillCount
                            Game.Skill S = new Game.Skill() { ID = 1000 };
                            S.WriteThis(BW);
                            S = new Game.Skill() { ID = 1005 };
                            S.WriteThis(BW);
                        }

                        BW.Write((byte)0);//Friend Count
                        BW.Write((byte)0);//Enemy Count


                        BW.Write(false);
                        BW.Write((int)0);
                        BW.Write((int)0);
                        BW.Write((long)0);
                        BW.Write((int)0);
                        BW.Write((byte)0);
                        BW.Write((byte)0);
                        BW.Write((byte)1);//Merchant
                        BW.Write(0);//  
                        BW.Write(DateTime.Now.Ticks);
                        BW.Write((ushort)0);
                        BW.Write(false);
                        BW.Write((byte)0);//lottery uses today
                        BW.Write("0");//WH Pass
                        BW.Write("None");//Spouse Name
                        BW.Write((uint)0);//Quiz Pts                    
                        BW.Flush();
                        FS.Flush();

                        BW.Close();
                        FS.Close();
                        FS = new FileStream(@"C:\OldCODB\Users\" + Account + ".usr", FileMode.Append);
                        BW = new BinaryWriter(FS);
                        BW.Write((byte)Name.Length);
                        BW.Write(Encoding.ASCII.GetBytes(Name));
                        BW.Flush();
                        FS.Flush();
                        BW.Close();
                        FS.Close();
                        Game.Character C = LoadCharacter(Name, ref Account);
                        if (C != null)
                        {
                            C.UniversityPoints = 0;
                            SaveCharacter(C, Account);
                        }
                    }
                    catch { return "Error! Try again."; }
                    return "ANSWER_OK";
                }
                return "Error: Character already exists!";

            }
            catch (Exception Exc) { Console.WriteLine(Exc); return "Failed to create the character."; }
        }
It`s got to be something in that part? Because I see the "error try again" thing that I keep getting >.<

Hang on I don`t see the Flowers folder in OldCODB anymore o.0 Would that cause it?
12/21/2010 12:09 Korvacs#8
Beats me, you could create it and see if that helps.
12/21/2010 12:11 denominator#9
Yeah am going to try that then try create a char lol.

ROFL LOL LMFAO can you believe that because I didn`t have a folder called "Flowers" in there that`s why it wasn`t creating characters lmfao. Now I see how friggin tempermental it is >.<

Thank you for inspiring me to look in the right place I love you in a non gay way lol.