I'm not quite sure where you got this idea that there's 6 strings in the list, but I just logged these from the latest patch:
Quote:
Originally Posted by Super Aids
He didn't even write 6 strings to it.
Isn't it Obvious enough i made a mistake and i wrote the "SYSTEM" length which is 6 instead of 4 in the string count offset?
PHP Code:
04 06 53 59 53 54 45 4D
And YES the string count can be 6 without writing 6 strings to the packet... try logging a talk packet coming from the client and take a look at the string count... TQ is that stupid...
WriteUInt(0, 4);//in your case color = 0 will work just fine
WriteUInt(Type, 8);//2101
WriteUInt(EntityID, 12);//1311 for the test purpose
WriteUInt(0, 20);//in your case you don't need to add the mesh
WriteByte(4, 24);
WriteStringWithLength(From, 25);//"SYSTEM"
WriteStringWithLength(To, 26 + From.Length);//"ALLUSERS"
//WriteStringWithLength(Date, 27 + From.Length + To.Length);//in your case you don't need to add the Date its used only in offline messages
WriteStringWithLength(Message, 28 + From.Length + To.Length );// + Date.length only in an offline message
See if that works.. if not then i am sorry i can't help you anymore you need to learn how to sniff/structure packets on your own... And for that there is a lot of guides here on the forums.. you just need to search
Here's a protip: don't specify offsets when constructing packets -- or, you could make a method that will do it for you.
Then you won't run into problems like this.
As a side note, constructing packets like this always makes me think back to LOTF:
Here's a protip: don't specify offsets when constructing packets-- or, you could make a method that will do it for you.
Then you won't run into problems like this.
As a side note, constructing packets like this always makes me think back to LOTF:
Generally.. C# beginners that never touched C++ don't have a clue on how to use Pointers\fixed Statements\Unsafe code and if they do they'll never bother...
I really don't think that a member who downloaded a public source and decided to start adding stuff to it will ever bother to Replace\Rebuild the packets builder class..
Here's a protip: don't specify offsets when constructing packets -- or, you could make a method that will do it for you.
Then you won't run into problems like this.
As a side note, constructing packets like this always makes me think back to LOTF:
We all have our preferences. The reason I do static offsets is because IMO it gives a better look over the packet and where the hell data is written in it.
I do my messagepacket like this:
Code:
using System;
using ProjectX_V3_Lib.Network;
namespace ProjectX_V3_Game.Packets
{
/// <summary>
/// Client -> Server
/// Server -> Client
/// </summary>
public class MessagePacket : DataPacket
{
public MessagePacket(DataPacket inPacket)
: base(inPacket)
{
string[] strings = StringPacker.Analyze(inPacket, 24);
From = strings[0];
To = strings[1];
Unknown = strings[2];
Message = strings[3];
}
public MessagePacket(StringPacker Message)
: base((ushort)(24 + Message.Size), PacketType.MessagePacket)
{
Message.AppendAndFinish(this, 24);
Time = 0;
}
public readonly string From;
public readonly string To;
public readonly string Unknown;
public readonly string Message;
public System.Drawing.Color Color
{
get { return (System.Drawing.Color.FromArgb((int)ReadUInt32(4))); }
set { WriteUInt32((uint)value.ToArgb(), 4); }
}
public Enums.ChatType ChatType
{
get { return (Enums.ChatType)ReadUInt32(8); }
set { WriteUInt32((uint)value, 8); }
}
public uint Time
{
get { return ReadUInt32(12); }
set { WriteUInt32(value, 12); }
}
public uint ToFace
{
get { return ReadUInt32(16); }
set { WriteUInt32(value, 16); }
}
public uint FromFace
{
get { return ReadUInt32(20); }
set { WriteUInt32(value, 20); }
}
public static void Handle(Client.GameClient client, DataPacket packet)
{
using (var message = new MessagePacket(packet))
{
if (message.Message.StartsWith("/") || message.Message.StartsWith("@"))
{
Packets.Message.Commands.Handle(client, message.Message, message.Message.Split(' '));
}
else
{
Console.WriteLine("{0} speaks to {1}: {2}", message.From, message.To, message.Message);
}
}
}
}
}
Which File in source 5630 Containt Ping ! 11/21/2012 - CO2 Private Server - 3 Replies I have 2 source its same !
one of them contain many prob but i want to get the file who contain ping cuz its bad in the another !!
i hope to understand me !!
and am sorry for my bad English lang !!
Private Messaging options 07/03/2010 - Technical Support - 2 Replies Hi guys:mofo:
I've been trying to send PMs to several members but I think my messages are not reaching because whenever i send it, it never shows up on the SEnt Messages link so im guessing i have to enable it or something?:confused:
Thank you if you can help me;):handsdown::D:bandit::):cool::rolleyes: