Code:
/**
* 73: Loads map region for Lumbridge
*/
b[0] = 73 + this.outStreamCryption.getNextKey();
b.writeInt16BE(3200, 1);
b.writeInt16BE(3200, 3);
/**
* 81: Initialise player
*/
b[5] = 81 + this.outStreamCrypt.nextKey();
// update our player or not
this.setBit(b, 6, 7, 1);
// VALUE: 3 - Type 3, update our players plane level
this.setBit(b, 6, 6, 1);
this.setBit(b, 6, 5, 1);
// setting plane level here, 0-3 (we use 0 for now)
this.setBit(b, 6, 4, 0);
this.setBit(b, 6, 3, 0);
// clear awaiting-point queue, i.e., remove our further steps left to do by client. Like when teleing
this.setBit(b, 6, 2, 1);
// is there an update required? (i.e., logged in, update our player)
this.setBit(b, 6, 1, 1);
// x, y co-ords (20x20)
this.setBit(b, 6, 0, 0);
this.setBit(b, 7, 7, 1);
this.setBit(b, 7, 6, 0);
this.setBit(b, 7, 5, 0);
this.setBit(b, 7, 4, 0);
this.setBit(b, 7, 3, 0);
this.setBit(b, 7, 2, 0);
this.setBit(b, 7, 1, 0);
this.setBit(b, 7, 0, 1);
this.setBit(b, 8, 7, 0);
this.setBit(b, 8, 6, 0);
this.setBit(b, 8, 5, 0);
this.setBit(b, 8, 4, 0);
this.setBit(b, 8, 3, 0);
// How many other players the client needs to update,
// currently no multiplayer so none,
// this will need some considerable thought lol
this.setBit(b, 8, 2, 0);
this.setBit(b, 8, 1, 0);
this.setBit(b, 8, 0, 0);
this.setBit(b, 9, 7, 0);
this.setBit(b, 9, 6, 0);
this.setBit(b, 9, 5, 0);
this.setBit(b, 9, 4, 0);
this.setBit(b, 9, 3, 0);
// player list updating, not really sure here, used a recommended 2047 value
this.setBit(b, 9, 2, 1);
this.setBit(b, 9, 1, 1);
this.setBit(b, 9, 0, 1);
this.setBit(b, 10, 7, 1);
this.setBit(b, 10, 6, 1);
this.setBit(b, 10, 5, 1);
this.setBit(b, 10, 4, 1);
this.setBit(b, 10, 3, 1);
this.setBit(b, 10, 2, 1);
this.setBit(b, 10, 1, 1);
this.setBit(b, 10, 0, 1);
// write frame size in short format (6 byte)
this.setBit(b, 12, 2, 1);
this.setBit(b, 12, 1, 1);
this.setBit(b, 12, 0, 0);
// initial player update done
socket.write(b);