reworked buffer and messages
fixed input being sent twice and fixed buffer bug in server
Merge remote-tracking branch 'upstream/master'