Mk I'll take a stab at this. So data types take certain amounts of bytes.
1 short = 2 bytes
1 int (dword called that because d is 4 letter in alphabet or...) = 4 bytes
1 long (q word 8th leter) = 8 bytes
For their max values you can look at this
https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx
Ok so now that we have that covered. Basically you aren't sending enough data you're missing the total xp field. The client is trying to read 3 variables you're only sending 2 to it.
case 124
consists of 10 bytes. 1 short and 2 ints = 10 bytes.
That looks like a custom packet its not in my client *shrugs* anyways
The 9 in StreamBuffer.newOutBuffer(9); is the amount of bytes the buffer is going to allocate.
You gotta keep in consideration that the writeHeader sends one byte of data for the packet id.
Edit: Also you want the buffer to be the exact size because the client has an array of packet sizes to check against!
soooo long story short add another
out.writeInt((int) exp);
and change the size to 11.
Did that make sense at all?
Code:
@Override
public void execute(Client client) {
StreamBuffer.OutBuffer out = StreamBuffer.newOutBuffer(11);
out.writeHeader(client.getEncryptor(), 124);
out.writeShort(id);
out.writeInt((int) exp); // TODO: Change this to xp gained.
out.writeInt((int) exp);
client.send(out.getBuffer());
}