fixed endianness of some packets
implemented basic chat