Packet 600D

10/24/2014 13:18 CrystalCoder#1
hello guys

i want to understand how opcode 600D work
i dont know lot on 600D so i be glad if you can help me with my question :pimp:
10/24/2014 15:29 LastThief*#2
Packet : 0x600D
Encrypted : No
Massive : No

byte flag //1 = data, 0 = header
if(flag == 1)
{
ushort count
ushort command id
}
else if(flag == 0)
{
byte[] data
}
10/24/2014 18:41 DaxterSoul#3
If you take a look closer to the structure 0x600D has, you'll notice that you need to send two of these packets.
The first declares the packet's you're massively sending/receiving while the second contains the data for those.
The packets within the massive collection can not be encrypted.

But what's the point of using massive packets?
- Less security handling per packet (because 0x600D holds the SecurityCount/SecurityCRC in it's header)
- Less packets between servers.

The 0x600D is used a lot for internal server communication. A good example are the Customer Administration System (CAS) packets. These packets have to travel a long way though the internal communication. From the ServiceManager (SMC) all the way to the SR_Client.
The route they take looks like this: ServiceManager -> GlobalManager -> FarmManager -> AgentServer -> SR_Client
Because all these servers communicate with the "STP (Silkroad Transport Protocol)", they all enforce security every time a packet is received/send. Using massive packets reduces the amount of encryption/decryption between the servers and the overall server load.

tl;dr
If you're using the SilkroadSecurityApi, these packets don't bother you much when working with the usual client related stuff, there are only a few massive packets in the Server/Client communication.

Properly formatted version:
Code:
        //Command: 0x600D
        //Name: GLOBAL_SERVER_MASSIVE
        //Description:
        //Encryption: false
        //Massive: false
        public const ushort SERVER_GLOBAL_MASSIVE = 0x600D;
        //  1   byte    Flag [0x00 = Data, 0x01 = Header]
        //  if(Flag == 0x01)
        //  {
        //      2   ushort  Count
        //      2   ushort  CommandID
        //  }
        //  else if(Flag == 0x00)
        //  {
        //      *   byte[]  Data
        //  }
Parsing process in SecurityManager.cs (SilkroadSecurityApi by Drew Benton):
Code:
        // Auto process massive messages for the user
        if (command_opcode == 0x600D)
        {
            byte mode = command_data.ReadByte();
            if (mode == 1)
            {
                m_massive_count = command_data.ReadUInt16();
                ushort contained_command_opcode = command_data.ReadUInt16();
                m_massive_command = new NetPacket(contained_command_opcode, command_encrypted, true);
            }
            else
            {
                if (m_massive_command == null)
                {
                    throw (new SecurityException("SecurityManager::Recv->A malformed 0x600D command was received."));
                }
                m_massive_command.WriteByteArray(command_data.ReadBytes(command_size - 1));
                m_massive_count--;
                if (m_massive_count == 0)
                {
                    m_massive_command.Lock();
                    m_incoming_commands.Add(m_massive_command);
                    m_massive_command = null;
                }
            }
        }