// upon connection of a new client all the info has to be sent to client prior to starting the regular communication
public void initialize()
{
// first packet sent
outStream.createFrame(249);
outStream.writeByteA(1); // 1 for members, zero for free
outStream.writeWordBigEndianA(playerId);
// here is the place for seting up the UI, stats, etc...
setChatOptions(0, 0, 0);
for(int i = 0; i < 25; i++) setSkillLevel(i, playerLevel[i], playerXP[i]);
outStream.createFrame(107); // resets something in the client
setSidebarInterface(1, 3917);
setSidebarInterface(2, 638);
setSidebarInterface(3, 3213);
setSidebarInterface(4, 1644);
setSidebarInterface(5, 5608);
setSidebarInterface(6, 1151);
setSidebarInterface(7, 12855); // what is this?
setSidebarInterface(8, 5065);
setSidebarInterface(9, 5715);
setSidebarInterface(10, 2449);
setSidebarInterface(11, 904);
setSidebarInterface(12, 147);
setSidebarInterface(13, 962);
setSidebarInterface(0, 2423);
handler.updatePlayer(this, outStream);
handler.updateNPC(this, outStream);
setEquipment(playerEquipment[playerHat],1,playerHat);
setEquipment(playerEquipment[playerCape],1,playerCape);
setEquipment(playerEquipment[playerAmulet],1,playerAmulet);
setEquipment(playerEquipment[playerArrows],190,playerArrows);
setEquipment(playerEquipment[playerChest],1,playerChest);
setEquipment(playerEquipment[playerShield],1,playerShield);
setEquipment(playerEquipment[playerLegs],1,playerLegs);
setEquipment(playerEquipment[playerHands],1,playerHands);
setEquipment(playerEquipment[playerFeet],1,playerFeet);
setEquipment(playerEquipment[playerRing],1,playerRing);
setEquipment(playerEquipment[playerWeapon],1,playerWeapon);
update();
}