Character creation issue 5900

08/06/2014 06:04 denominator#1
Account creation seems okay because I can log in to create a character, however I try to create character but it doesn't actually create it? It continues on but the bar gets like a quarter of the way and just stays there.

What am I missing?
08/06/2014 06:24 Spirited#2
Quote:
Originally Posted by denominator View Post
Account creation seems okay because I can log in to create a character, however I try to create character but it doesn't actually create it? It continues on but the bar gets like a quarter of the way and just stays there.

What am I missing?
I don't know.

08/06/2014 06:45 denominator#3
LOL neither did I so I deleted that client and started afresh, using loader v5.2 but I'm getting an error saying invalid username or password but I know I'm not so I'm thinking a communication breakdown >.<


Server config
Code:
[Configuration]
IP=My external IP ports are open
GamePort=9999
AuthPort=9958
ServerName=Anarchy
SourceOwner=HaMdY
Forum=HaMdY-Co

[MySql]
Host=localhost
Username=root
Password=MyPassword
Database=cq

[SourceAccount]
IP=my external IP although not sure what this part is for?

;192.168.1.100
;unknownpassword
My loader settings
Code:
[Loader]
IPAddress=My external IP
LoginPort=9958
GamePort=9999
Website=http://www.mysite.com/
Force=TRUE
08/06/2014 08:19 Spirited#4
Quote:
Originally Posted by denominator View Post
LOL neither did I so I deleted that client and started afresh, using loader v5.2 but I'm getting an error saying invalid username or password but I know I'm not so I'm thinking a communication breakdown >.<
Hmm... I don't think there's a communication breakdown on my end. If there's any miscommunication, it's probably misinterpretation on your end due to an ignorance of Conquer Online's server model. If you knew anything about how clients log into your server, you would have known what I was talking about almost immediately. Also, the reason why you can't use ConquerLoader 5.2 is because you require a special hook to detour the password cipher used in the newer clients.
08/06/2014 08:29 denominator#5
You misunderstand me I was talking about a communication between client/server :) So if 5.2 doesn't work then is there a loader to use? I'm assuming the lower version will not work?
08/06/2014 08:50 Spirited#6
Quote:
Originally Posted by denominator View Post
You misunderstand me I was talking about a communication between client/server :) So if 5.2 doesn't work then is there a loader to use? I'm assuming the lower version will not work?
No, trust me. You misunderstand me, and I don't think I can make myself much clearer than I already am. Is there an actual developer from your server team that I can talk to? Someone who understands how to program a Conquer Online server?
08/06/2014 09:08 denominator#7
Never felt so insulted in all my life.
08/06/2014 09:55 Spirited#8
Quote:
Originally Posted by denominator View Post
Never felt so insulted in all my life.
So... you're saying you're a Conquer Online server programmer... and you don't know how your players even log into your server? You should definitely feel insulted because that's embarrassing. Fix that - read your source code. We can't help people who can't help themselves.

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
08/06/2014 10:01 denominator#9
Code:
public static bool CreateEntity(Network.GamePackets.EnitityCreate eC, Client.GameClient client, ref string message)
        {
            if (eC.Name.Length > 16)
                eC.Name = eC.Name.Substring(0, 16);
            if (eC.Name == "")
                return false;

            if (InvalidCharacters(eC.Name))
            {
                message = "Invalid characters inside the name.";
                return false;
            }
            using (var rdr = new MySqlReader(new MySqlCommand(MySqlCommandType.SELECT).Select("entities").Where("name", eC.Name)))
            {
                if (rdr.Read())
                {
                    message = "The chosen name is already in use.";
                    return false;
                }
            }
            client.Entity = new Game.Entity(Game.EntityFlag.Player, false);
            client.Entity.Name = eC.Name;
            DataHolder.GetStats(eC.Class, 1, client);
            client.CalculateStatBonus();
            client.CalculateHPBonus();
            client.Entity.Hitpoints = client.Entity.MaxHitpoints;
            client.Entity.Mana = (ushort)(client.Entity.Spirit * 5);
            client.Entity.Class = eC.Class;
            client.Entity.Body = eC.Body;
            if (eC.Body == 1003 || eC.Body == 1004)
                client.Entity.Face = (ushort)Kernel.Random.Next(1, 50);
            else
                client.Entity.Face = (ushort)Kernel.Random.Next(201, 250);
            byte Color = (byte)Kernel.Random.Next(4, 8);
            client.Entity.HairStyle = (ushort)(Color * 100 + 10 + (byte)Kernel.Random.Next(4, 9));
            client.Entity.UID = Program.EntityUID.Next;
            client.Entity.JustCreated = true;

            while (true)
            {
                using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("entities").Where("uid", client.Entity.UID))
                using (var reader = cmd.CreateReader())
                {
                    if (reader.Read())
                        client.Entity.UID = Program.EntityUID.Next;
                    else
                        break;
                }
            }
            while (true)
            {
                try
                {
                    using (var cmd = new MySqlCommand(MySqlCommandType.INSERT))
                        cmd.Insert("entities").Insert("Name", eC.Name).Insert("Owner", client.Account.Username).Insert("Class", eC.Class).Insert("UID", client.Entity.UID)
                            .Insert("Hitpoints", client.Entity.Hitpoints).Insert("Mana", client.Entity.Mana).Insert("Body", client.Entity.Body)
                            .Insert("Face", client.Entity.Face).Insert("HairStyle", client.Entity.HairStyle).Insert("Strength", client.Entity.Strength)
                            .Insert("WarehousePW", "").Insert("Agility", client.Entity.Agility).Insert("Vitality", client.Entity.Vitality).Insert("Spirit", client.Entity.Spirit)
                            .Execute();
                    Database.MySqlCommand com = new Database.MySqlCommand(MySqlCommandType.INSERT);
                    com.Insert("achievement").Insert("UID", (long)client.Entity.UID).Insert("Owner", client.Account.Username).Insert("Name", client.Entity.Name);
                    message = "ANSWER_OK";
                    break;
                }
                catch
                {
                    client.Entity.UID = Program.EntityUID.Next;
                }
            }

            using (var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("configuration").Set("EntityID", client.Entity.UID).Where("Server", Constants.ServerName))
                cmd.Execute();
            client.Account.EntityID = client.Entity.UID;
            client.Account.Save();
            return true;
        }
08/06/2014 10:55 abdoumatrix#10
Quote:
Originally Posted by denominator View Post
Code:
                catch
                {
                    client.Entity.UID = Program.EntityUID.Next;
                }
just breakpoint here or just but Console.Writeline(e);
08/06/2014 12:19 Yupmoh#11
Quote:
Originally Posted by denominator View Post
Never felt so insulted in all my life.
Don't let what fang said put you down, We don't learn outa the blue. My advice to you is to never let anyone put you down.. Just keep on trying you'll get there with time. Back to your account creation issue, you can start by breakpointing it and following your server step by step while it executes the account creation code, Find out where it goes wrong and do some research, Also checking your Database to see if your server is really creating a character file or w.e type of db you're using.
08/06/2014 14:30 12k#12
@denominator shoot me a PM if ud like some assistance.


[SourceAccount]
IP=my external IP although not sure what this part is for?

I assume if a user logs in with that IP, they are automatically granted PM commands, possibly doesnt even require correct password to login? (I havent looked at the source code)

Also, fang, im pretty sure you did misunderstand him initially. He was saying there was a communication issue between the server and client (not between you and him). He could know how to program and not know a thing about conquer online and not know the answer to this.

I bet his client is disconnecting after creating the character as it should, but when he goes to log back in, it goes back to character creation as if the character isnt being created?
08/06/2014 17:45 Spirited#13
Why are you using while true like that? Why are you trying to get entity ids like that? What horrible source is this even?! >< This is so painful to read - it's so wrong. It's probably not your fault - you probably just downloaded it - but whoever modified that method from what it originally was needs to uninstall Visual Studio.

PS: It's as I said. You're not sending ANSWER_OK.
08/06/2014 17:51 12k#14
Quote:
Originally Posted by Spirited View Post
Why are you using while true like that? Why are you trying to get entity ids like that? What horrible source is this even?! >< This is so painful to read - it's so wrong. It's probably not your fault - you probably just downloaded it - but whoever modified that method from what it originally was needs to uninstall Visual Studio.

PS: It's as I said. You're not sending ANSWER_OK.
It is responding with an ANSWER_OK as far as that code goes. Its possible its not getting sent, but from the code shown, its fine. (Although agreed the while true is awful)

#edit if im not mistaken, even if it wasnt sending the ANSWER_OK, its still adding the character etc, so on the next login it should fix itself. My guess is that its not updating the field that checks if it has a character or not.
08/06/2014 18:05 Spirited#15
Quote:
Originally Posted by 12k View Post
It is responding with an ANSWER_OK as far as that code goes. Its possible its not getting sent, but from the code shown, its fine. (Although agreed the while true is awful)

#edit if im not mistaken, even if it wasnt sending the ANSWER_OK, its still adding the character etc, so on the next login it should fix itself. My guess is that its not updating the field that checks if it has a character or not.
Oh, you're right. Me looking quickly over it shows that... message = "ANSWER_OK"... alright. @OP: Debug the project if you're a programmer. I gave you links to help yourself - here's another one.
[Only registered and activated users can see links. Click Here To Register...]