Quote:
Originally Posted by LasEm
RESPONSE
0xB025 - SERVER_AGENT_CHAT_RESPONSE
1 byte result
if(result == 2)
{
2 ushort errorCode
}
1 byte chatType
1 byte chatIndex
|
Thank you for heartlessly copy-pasting this mess, but it looks better with
Anyways...
Quote:
|
is there any way to enter the correct chatindex automatically every time...
|
The chatIndex is always counting up for every CHAT_REQUEST the client sends (no matter what chatType and even if the target is not found).
Track the index yourself or copy it from the response. Also, don't hardcode the chatType.
Code:
if (packet.Opcode == 0xB025)
{
byte result = packet.ReadByte();
if (result == 2)
{
var errorCode = packet.ReadUShort();
var chatType = packet.ReadByte();
var chatIndex = packet.ReadByte();
if (errorCode == 3) //UIIT_CHATERR_CANT_FIND_TARGET
{
var replace = new Packet(packet.Opcode, packet.Encrypted, packet.Massive);
replace.WriteByte(1); //success
replace.WriteByte(chatType);
replace.WriteByte(chatIndex);
ag_local_security.Send(replace);
continue;
}
}
}