@Override
  protected void onDestroy() {
    if (this.mSocketServer != null) {
      try {
        this.mSocketServer.sendBroadcastServerMessage(new ConnectionCloseServerMessage());
      } catch (final IOException e) {
        Debug.e(e);
      }
      this.mSocketServer.terminate();
    }

    if (this.mSocketServerDiscoveryServer != null) {
      this.mSocketServerDiscoveryServer.terminate();
    }

    if (this.mServerConnector != null) {
      this.mServerConnector.terminate();
    }

    if (this.mSocketServerDiscoveryClient != null) {
      this.mSocketServerDiscoveryClient.terminate();
    }

    super.onDestroy();
  }
  @Override
  public void onPauseGame() {
    super.onPauseGame();

    this.disableAccelerometerSensor();
  }
  @Override
  public void onResumeGame() {
    super.onResumeGame();

    this.enableAccelerometerSensor(this);
  }