[HELP] Error Login after create account in 5375

06/28/2011 15:50 aloisioXD#1
Hi "elite". My source has a problem, when I create the account after selecting the character, the client is loading and loading and nothing happens!

step by step:

1 - I select the character

[Only registered and activated users can see links. Click Here To Register...]

after select the account.

passo 2-

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]


and finally the part that bug ... I'm trying to fix, however had no success. my client is not charging and not of error and not move on.

[Only registered and activated users can see links. Click Here To Register...]

I was hoping that someone posted a solution
it is possible to give error when creating the account and go to the login area again. I hope someone helps!

I'll post here some parts of my source who is allegedly the problem. there following here in the beginning of the post PacketHandler.cs
Code:
                                #region LoginPacket (1052)
                case 1052:
                    {
                        if (client.Action == 1)
                        {
                            Connect connect = new Connect();
                            connect.Deserialize(packet);
                            AppendConnect(connect, client);
                        }
                        else client.Disconnect();
                        break;
                    }
                #endregion
Code:
                #region AuthPacket (1001)
                case 1001:
                    {
                        if (client.Action == 1)
                        {
                            EnitityCreate EC = new EnitityCreate();
                            EC.Deserialize(packet);
                            string Message = "";
                            bool created = (Database.EntityTable.CreateEntity(EC, client, ref Message));
                            client.Send(new Message(Message, "ALLUSERS", System.Drawing.Color.Orange, GamePackets.Message.PopUP));
                        }
                        else client.Disconnect();
                        break;
                    }
                #endregion
in the GameState.cs :
Code:
public void Disconnect()
        {
            if (_socket.Connected)
            {
                SocketDisposed = true;
                _socket.Disconnect(false);
                _socket.Shutdown(SocketShutdown.Both);
                _socket.Close();
            }
            ShutDown();
        }
Code:
        private void ShutDown()
        {
            if (Disconnected)
                return;
            if (Logger != null)
                Logger.Close();
            if (this != null && this.Entity != null)
            {
                if (this.JustCreated)
                    return;

                Database.EntityTable.UpdateOnlineStatus(this, false);
                Database.EntityTable.SaveEntity(this);
                if (ServerBase.Kernel.GamePool.ContainsKey(this.Entity.UID))
                    ServerBase.Kernel.GamePool.Remove(this.Entity.UID);

                if (Booth != null)
                {
                    Booth.Remove();
                }
                Database.SkillTable.SaveProficiencies(this);
                Database.SkillTable.SaveSpells(this);
                Database.ArenaTable.SaveArenaStatistics(this.ArenaStatistic);

                if (Companion != null)
                {
                    Map.RemoveEntity(Companion);
                    Data data = new Data(true);
                    data.UID = Companion.UID;
                    data.ID = Data.RemoveEntity;
                    Companion.MonsterInfo.SendScreen(data);
                }
                if (QualifierGroup != null)
                    QualifierGroup.End(this);


                if (ArenaStatistic.Status != Network.GamePackets.ArenaStatistic.NotSignedUp)
                    Game.ConquerStructures.Arena.QualifyEngine.DoQuit(this);

                RemoveScreenSpawn(this.Entity, false);

                if (!Disconnected)
                    Console.WriteLine(this.Entity.Name + " has logged off. {" + this.Account.IP + "}");

                Disconnected = true;

                #region Friend/TradePartner/Apprentice
                Message msg = new Message("Your friend, " + Entity.Name + ", has logged off.", System.Drawing.Color.Red, Message.TopLeft);
                if (Friends == null)
                    Friends = new SafeDictionary<uint, Conquer_Online_Server.Game.ConquerStructures.Society.Friend>(100);
                foreach (Game.ConquerStructures.Society.Friend friend in Friends.Values)
                {
                    if (friend.IsOnline)
                    {
                        var packet = new KnownPersons(true)
                        {
                            UID = Entity.UID,
                            Type = KnownPersons.RemovePerson,
                            Name = Entity.Name,
                            Online = false
                        };
                        friend.Client.Send(packet);
                        packet.Type = KnownPersons.AddFriend;
                        if (friend != null)
                        {
                            if (friend.Client != null)
                            {
                                friend.Client.Send(packet);
                                friend.Client.Send(msg);
                            }
                        }
                    }
                }
                Message msg2 = new Message("Your partner, " + Entity.Name + ", has logged off.", System.Drawing.Color.Red, Message.TopLeft);

                foreach (Game.ConquerStructures.Society.TradePartner partner in Partners.Values)
                {
                    if (partner.IsOnline)
                    {
                        var packet = new TradePartner(true)
                        {
                            UID = Entity.UID,
                            Type = TradePartner.BreakPartnership,
                            Name = Entity.Name,
                            HoursLeft = (int)(new TimeSpan(partner.ProbationStartedOn.AddDays(3).Ticks).TotalHours - new TimeSpan(DateTime.Now.Ticks).TotalHours),
                            Online = false
                        };
                        partner.Client.Send(packet);
                        packet.Type = TradePartner.AddPartner;
                        if (partner != null)
                        {
                            if (partner.Client != null)
                            {
                                partner.Client.Send(packet);
                                partner.Client.Send(msg2);
                            }
                        }
                    }
                }
                MentorInformation Information = new MentorInformation(true);
                Information.Mentor_Type = 1;
                Information.Mentor_ID = Entity.UID;
                Information.Mentor_Level = Entity.Level;
                Information.Mentor_Class = Entity.Class;
                Information.Mentor_PkPoints = Entity.PKPoints;
                Information.Mentor_Mesh = Entity.Mesh;
                Information.Mentor_Online = false;
                Information.String_Count = 3;
                Information.Mentor_Name = Entity.Name;
                Information.Mentor_Spouse_Name = Entity.Spouse;
                foreach (var appr in Apprentices.Values)
                {
                    if (appr.IsOnline)
                    {
                        Information.Apprentice_ID = appr.ID;
                        Information.Enrole_Date = appr.EnroleDate;
                        Information.Apprentice_Name = appr.Name;
                        appr.Client.Send(Information);
                        appr.Client.ReviewMentor();
                    }
                }
                if (Mentor != null)
                {
                    if (Mentor.IsOnline)
                    {
                        ApprenticeInformation AppInfo = new ApprenticeInformation();
                        AppInfo.Apprentice_ID = Entity.UID;
                        AppInfo.Apprentice_Level = Entity.Level;
                        AppInfo.Apprentice_Name = Entity.Name;
                        AppInfo.Apprentice_Online = false;
                        AppInfo.Apprentice_Spouse_Name = Entity.Spouse;
                        AppInfo.Enrole_date = Mentor.EnroleDate;
                        AppInfo.Mentor_ID = Mentor.Client.Entity.UID;
                        AppInfo.Mentor_Mesh = Mentor.Client.Entity.Mesh;
                        AppInfo.Mentor_Name = Mentor.Client.Entity.Name;
                        AppInfo.Type = 2;
                        Mentor.Client.Send(AppInfo);
                    }
                }

                #endregion
                if (Team != null)
                {
                    if (Team.TeamLeader)
                    {
                        Network.GamePackets.Team team = new Team();
                        team.UID = Account.EntityID;
                        team.Type = Network.GamePackets.Team.Dismiss;
                        foreach (Client.GameState Teammate in Team.Teammates)
                        {
                            if (Teammate != null)
                            {
                                if (Teammate.Entity.UID != Account.EntityID)
                                {
                                    Teammate.Send(team);
                                    Teammate.Team = null;
                                }
                            }
                        }
                    }
                    else
                    {
                        Network.GamePackets.Team team = new Team();
                        team.UID = Account.EntityID;
                        team.Type = Network.GamePackets.Team.ExitTeam;
                        foreach (Client.GameState Teammate in Team.Teammates)
                        {
                            if (Teammate != null)
                            {
                                if (Teammate.Entity.UID != Account.EntityID)
                                {
                                    Teammate.Send(team);
                                    Teammate.Team.Remove(Account.EntityID);
                                }
                            }
                        }
                    }
                }
            }
        }
if anyone knows the solution please post here or contact me [Only registered and activated users can see links. Click Here To Register...] am very thankful if someone help me thanks!

?
07/02/2011 04:10 mlady272#2
yeeeeeeeeeeeeeeeeees
07/03/2011 18:21 gato230184#3
Hi I can help this is the solution:
in the SQL configuration in the table should change the last character EntitiID for which it was created so as not repeated EntitiID
07/03/2011 22:01 Spirited#4
It's not a bug. It's not coded.
Just make the client d/c if you can't figure it out.
Or, just packet log a real tq server and you'll know exactly how it's done.

Chris made a really nice guide on packet logging and he released his packet logger.
Both links can be found in his signature.
08/28/2011 17:55 raymart12#5
i have also the same problem pls help me full guide i need tnxx who help :)
08/28/2011 19:42 Spirited#6
Quote:
Originally Posted by raymart12 View Post
i have also the same problem pls help me full guide i need tnxx who help :)
I want to roundhouse kick your ass right now for posting something so incredibly stupid.
Read what I said.
09/04/2011 13:28 raymart12#7
anyone know how to solve this problem plss if anyone thank's in advance
04/02/2012 00:15 marcbacor6666#8
what code to make the character dc?
04/03/2012 23:15 turk55#9
Quote:
Originally Posted by marcbacor6666 View Post
what code to make the character dc?
:facepalm:

client.Disconnect();
04/04/2012 14:43 samehvan#10
you have 2 options as i can advice you when creating the character

1-
Quote:
string Message = "Your character is ready. \nPlease re-login to play.";
client.Send(new Message(Message, "ALLUSERS", System.Drawing.Color.Orange, GamePackets.Message.PopUP));
this will tell the player that his character has been created and he needs to click back button twice to get back to login screen and then login

2-

Quote:
string Message = "ANSWER_OK";
client.Send(new Message(Message, "ALLUSERS", System.Drawing.Color.Orange, GamePackets.Message.PopUP));
this will just create the character and then go forward logging him in
04/04/2012 17:10 -impulse-#11
Quote:
Originally Posted by samehvan View Post

2-



this will just create the character and then go forward logging him in
Not quite. It will just tell the client to re-send the 1052 packet. That way if the server still awaits for someone with an ID (even though they just created a new character), the server will proceed like it should have.

So to fix this you have to:
1. Make sure you don't remove the the appendConnect.Identifier in case the account that was used to login is being sent the create character packet (aka "NEW_ROLE").
2.Send ANSWER_OK as samehvan said.

With that done you'll be good to go.
04/07/2012 10:56 marcbacor6666#12
Quote:

client.Disconnect();
does not work. it wont dc

Quote:
#region EnitityCreate (1001)
case 1001:
{
if (client.Action == 1)
{
EnitityCreate EC = new EnitityCreate();
EC.Deserialize(packet);
string Message = "";
Database.EntityTable.CreateEntity(EC, client, ref Message);
if(Message == "ANSWER_OK")
Message = "Character created. Use back button so you can login!";

client.Send(new Message(Message, "ALLUSERS", System.Drawing.Color.Orange, GamePackets.Message.PopUP));
if (client.Entity != null)
client.Entity.JustCreated = true;
client.Disconnect();
}
break;
}
#endregion
bump
04/20/2012 05:57 awesome100able#13
Send me source: [Only registered and activated users can see links. Click Here To Register...] ill fix it for u