You last visited: Today at 07:23
Advertisement
Client DC 2 seconds after CharacterInfo Packet Sent
Discussion on Client DC 2 seconds after CharacterInfo Packet Sent within the CO2 Private Server forum part of the Conquer Online 2 category.
03/24/2011, 22:32
#1
elite*gold: 28
Join Date: Jun 2010
Posts: 2,253
Received Thanks: 877
Client DC 2 seconds after CharacterInfo Packet Sent
Hey guys,
Working with 5165 here(custom source)
I'm having a few probs with this, My Client seem to Disconnect about 2 seconds after my CharacterInfo packet is sent.
It's called by this void
Code:
public static void Login(byte[] Packet, GameClient Client)
{
LoginPacket Login = new LoginPacket();
Login.Deserialize(Packet);
Accounts Acc = null;
AuthClient AC = null;
Console.WriteLine(Login.Identifier);
if (Kernel.PendingConnections.ContainsKey(Login.Identifier))
{
Kernel.PendingConnections.TryGetValue(Login.Identifier, out AC);
Console.WriteLine(Login.Identifier);
Kernel.PendingConnections.Remove(Login.Identifier);
Acc = AC.Info;
if (Acc != null)
{
string ResponseMessage = "";
Client.Info = Acc;
if (Client.Info.EntityID == 0)
Client.Send(Messages.NEW_ROLE);
else
{
Client.Send(Messages.ANSWER_OK);
ResponseMessage = "ANSWER_OK";
}
if (ResponseMessage == "ANSWER_OK")
{
if (Kernel.ClientPool.ContainsKey(Client.Entity.UID))
{
GameClient Fucked = Server.GetCharByUID(Client.Entity.UID);
Fucked.Disconnect();
}
Characters.LoadCharacter(Client);
Kernel.ClientPool.Add(Client.Entity.UID, Client);
CharacterInfo ci = new CharacterInfo(Client);
(HERE!!!!!!!) Client.Send(ci.ToArray());
Client.Info.IP = Client._socket.RemoteEndPoint.ToString().Split(' ')[0].ToString();
Client.Info.UpdateEntireAccount();
Console.WriteLine("Account: {0} && Character: {1} has logged in!", Client.Info.Username, Client.Entity.Name);
}
}
}
}
And the characterInfo packet is as follows:
Code:
using System;
using Painless.Networking;
using ProjectD.Game;
namespace ProjectD.Packet_Processor.Structures
{
public class CharacterInfo : PacketWriter, ProjectD.Core.Interfaces.iPacket
{
GameClient client;
public CharacterInfo(GameClient _client)
{
client = _client;
}
public void Deserialize(byte[] buffer)
{
throw new NotImplementedException();
}
public byte[] ToArray()
{
byte[] Packet = new byte[98 + client.Entity.Spouse.Length + client.Entity.Name.Length];
WriteUInt16((ushort)(Packet.Length - 8), 0, Packet);
WriteUInt16(0x3ee, 2, Packet);
WriteUInt32(client.Entity.UID, 4, Packet);
WriteUInt32(client.Entity.Mesh, 8, Packet);
WriteUInt16(client.Entity.Hairstyle, 12, Packet);
WriteUInt32(client.Entity.Money, 14, Packet);
WriteUInt32(client.Entity.ConquerPoints, 18, Packet);
WriteUInt64(0/*Experience*/, 22, Packet);
WriteUInt16(client.Entity.Strength, 50, Packet);
WriteUInt16(client.Entity.Agility, 52, Packet);
WriteUInt16(client.Entity.Vitality, 54, Packet);
WriteUInt16(client.Entity.Spirit, 56, Packet);
WriteUInt16(0/*Atributes*/, 58, Packet);
WriteUInt16((ushort)client.Entity.Hitpoints, 60, Packet);
WriteUInt16(client.Entity.Mana, 62, Packet);
WriteUInt16(0/*PKpoint*/, 64, Packet);
Packet[66] = (byte)client.Entity.Level;
Packet[67] = client.Entity.Class;
Packet[69] = client.Entity.Reborn;
Packet[70] = 1;
WriteUInt32(0/*QuizPoints*/, 71, Packet);
Packet[87] = 2;
WriteStringWithLength(client.Entity.Name, 88, Packet);
WriteStringWithLength(client.Entity.Spouse, 89 + Packet[88], Packet);
return Packet;
}
public void Send(GameClient client)
{
client.Send(ToArray());
}
}
}
But it still disconnects? Any Thoughts? Totally stuck with this one.
03/24/2011, 23:29
#2
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
Why don't you try/catch.
try
{Client.Send(ci.ToArray());}
catch(Exception E)
{Console.WriteLine(E.Tostring());}
See if anything happens there?
03/24/2011, 23:51
#3
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
Correct me if I'm wrong but aren't you supposed to add the login status with the length?
Anyhow, make sure your entity isn't null, and as Arco said, put a try/catch and write us the exception and we'll look into it.
03/25/2011, 01:28
#4
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,519
I assume your Send function adds "TQServer" to the end of that packet?
03/25/2011, 17:09
#5
elite*gold: 28
Join Date: Jun 2010
Posts: 2,253
Received Thanks: 877
Nothing caught in exceptions.
@korv, Yea.
The GameClient nor the Entity is null.
03/25/2011, 19:11
#6
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
Quote:
Originally Posted by
_DreadNought_
Nothing caught in exceptions.
@korv, Yea.
The GameClient nor the Entity is null.
Breakpoint Client.Send(ci.ToArray()); and step into it, keep doing that until client disconnection.
03/25/2011, 19:59
#7
elite*gold: 28
Join Date: Jun 2010
Posts: 2,253
Received Thanks: 877
The exact line the disconnects the client is:
_socket.Send(_buffer);
Not that we couldnt of guessed that.
will try seeing if theres any exceptions there.
#edit
No socket exceptions either.
The ****? :/
03/26/2011, 03:12
#8
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
Quote:
Originally Posted by
_DreadNought_
The exact line the disconnects the client is:
_socket.Send(_buffer);
Not that we couldnt of guessed that.
will try seeing if theres any exceptions there.
#edit
No socket exceptions either.
The ****? :/
You're adding the extra 8 bytes towards the length AND adding TQ server to it as well?
03/26/2011, 09:02
#9
elite*gold: 0
Join Date: Jan 2011
Posts: 470
Received Thanks: 97
Put a breakpoint at "Client.Info.IP = Client._socket.RemoteEndPoint.ToString().Split(' ')[0].ToString();". Does it ever hit that? If it does, the character info packet isn't the problem. It's being sent correctly. You might be missing something else. And how did you add me on your iPod? o.O
03/26/2011, 11:09
#10
elite*gold: 28
Join Date: Jun 2010
Posts: 2,253
Received Thanks: 877
Yes it is being sent correctly and yes its hitting the IP thing Fang.
However the character info wasn't right but it wasn't it's fault.
The character UID does not appear to be being stored correctly therefor the UID of the character is null not the character itsself.
Thanks for the trys guys.
#Requesting a close
Similar Threads
5180 CharacterInfo packet ( Impule's )
07/06/2010 - CO2 Private Server - 19 Replies
My packet appears to be wrong, the characternames are fucked up...and I cant see anybody else but can see other people talking/whispers along with them dropping things and doing things like @gm hey but if I whisper them using the name that appears when they talk its like E Speak to all: Hey but if I whisper there real name they get it and my names appears fucked. heres my packet with a few /* */ things
using System;
namespace Conquer_Online_Server.Network.GamePackets
{
...
Client Crash after 5 seconds
12/14/2009 - Dekaron - 5 Replies
I downloaded the new rexination , got new offsets when i entered my char the game still crash please someone had this problem and repair it , i really need some support.
regards , ser
[HELP] CharacterInfo Packet
10/09/2009 - CO2 Private Server - 5 Replies
Hi!
I would like to know if someone can post the CharacterInfo packet for thé new encryption ~5090.
I'm in trouble because i send a wrong Packet in the 1052.
So the 0x3f2 case 74 do not comes. The screen freeze a login...
So i think that I send the wrong packet.
Btw I'm using Hybrid's source.
I can't post my packet. I'm with my phone actualy.
Btw, thanks in advance for reply =)
All times are GMT +2. The time now is 07:24 .