Added online/offline features. PROTOCOL UPDATE REQUIRED.

I added online/offline features and modified socket protocol. I will need to update the PROTOCOL file.