title: UNET: Command function CmdSpawnPlayer called on server
body: <p>I got an error from Unity while I was busy executing a command for the server. The error is:</p>
  <blockquote>
  <p>Command function CmdSpawnPlayer called on server.</p>
  <p>UnityEngine.Debug:LogError(Object)</p>
  <p>NetworkHandler:CallCmdSpawnPlayer(Boolean)
  NetworkHandler:OnEnable() (at Assets/Scripts/Managers/NetworkHandler.cs:69)</p>
  <p>UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()</p>
  </blockquote>
  <p>Here is the code I use:</p>
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  using UnityEngine.Networking;
  
  public class NetworkHandler : NetworkBehaviour
  {
      public Player NetworkPlayer
      {
          get;
          private set;
      }
  
      public bool HasInternet
      {
          get
          {
              return Network.HavePublicAddress();
          }
      }
  
      public bool IsConnectedToServer
      {
          get
          {
              return networkManager.isNetworkActive;
          }
      }
  
      [SerializeField]
      private NetworkManager networkManager;
  
      [SerializeField]
      private GameObject playerPrefab, spectatorPrefab;
  
      public void StartClient()
      {
          networkManager.StartClient();
      }
  
      public void StartServer()
      {
          networkManager.StartServer();
      }
  
      [Command]
      private void CmdSpawnPlayer(bool isSpectator)
      {
          SpawnPlayer(isSpectator);
      }
  
      private void SpawnPlayer(bool isSpectator)
      {
          if (isSpectator)
          {
              NetworkServer.SpawnWithClientAuthority(Instantiate(spectatorPrefab), connectionToClient);
          }
          else
          {
              NetworkServer.SpawnWithClientAuthority(Instantiate(playerPrefab), connectionToClient);
          }
      }
  
      private void OnEnable()
      {
          if (IsConnectedToServer)
          {
              CmdSpawnPlayer(true);
              Game.CameraHandler.InstantiateMode();
          }
      }
  }
  </code></pre>
  <p>The Unity version is use is 5.3.4f1.</p>