public bool PlayerHasAuthority(GameObject obj, NetworkPlayer player)
    {
        if (obj != null)
        {
            NetworkObjectServerInfo info = obj.GetComponent <NetworkObjectServerInfo>();
            if (info != null)
            {
                return(info.HasAuthority(player));
            }
        }

        return(false);
    }
    /// <summary>
    /// Updates a player to the most recent entity list
    /// </summary>
    private void UpdatePlayer(NetworkPlayer player)
    {
        if (IsPlayerServer(player))
        {
            return;
        }

        foreach (var pair in NetworkManager.Instance.GetNetworkedObjects())
        {
            GameObject obj = pair.Value;
            if (obj == null)
            {
                continue;
            }
            NetworkObjectServerInfo info     = obj.GetComponent <NetworkObjectServerInfo>();
            NetworkIdentity         identity = obj.GetComponent <NetworkIdentity>();

            NetworkSpawnRPC spawnRPC = new NetworkSpawnRPC(info.m_PrefabIndex, false, identity.m_NetworkId);
            SendRPC(spawnRPC, player); // Spawn it

            if (!info.HasAuthority(player) && !IsPlayerServer(player))
            {
                NetworkAuthorizationRPC authRPC = new NetworkAuthorizationRPC(
                    true, false, false, identity.m_NetworkId
                    );
                SendRPC(authRPC, player);
            }
            foreach (var type in info.m_RPCTypes) // Update any extra RPC's the object may have
            {
                NetworkRPC rpc = info.GetRPC(type);
                if (rpc != null)
                {
                    SendRPC(rpc, player);
                }
            }
        }
    }