public void Stop()
 {
     running = false;
     PlayerLogout logout = new PlayerLogout ();
     logout.authtoken = authtoken;
     logout.playerId = playerId;
     ClientMessage message = CreateClientMessage ();
     message.playerLogout = logout;
     byte[] bytes = Serialize (message);
     Write (bytes);
     tcpClient.Close ();
 }
 public void Stop()
 {
     running = false;
     PlayerLogout logout = new PlayerLogout ();
     logout.authtoken = authtoken;
     logout.playerId = playerId;
     ClientMessage message = CreateClientMessage ();
     message.playerLogout = logout;
     byte[] bytes = Serialize (message);
     udpClient.Send (bytes, bytes.Length, host, port);
     udpClient.Close ();
 }