public static void SyncEnemy(byte fromClient, Packet packet)
        {
            //if (!Server.clients[fromClient].player.isHost) return;
            byte toClient = packet.ReadByte();

            if ((Server.clients[fromClient].player.activeScene == Server.clients[toClient].player.activeScene))
            {
                return;
            }

            string goName = packet.ReadString();
            int    id     = packet.ReadInt();

            ServerSend.SyncEnemy(toClient, goName, id);
        }
        public static void LoadServerScene(byte fromClient, Packet packet)
        {
            string sceneName = packet.ReadString();

            GameManager.instance.StartCoroutine(LoadSceneRoutine());

            IEnumerator LoadSceneRoutine()
            {
                Scene scene = USceneManager.GetSceneByName(sceneName);

                if (!scene.isLoaded)
                {
                    AsyncOperation operation = USceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Additive);

                    yield return(new WaitWhile(() => !operation.isDone));
                }

                Scene loadedScene = USceneManager.GetSceneByName(sceneName);

                GameObject[] rootGOs = loadedScene.GetRootGameObjects();
                if (rootGOs != null)
                {
                    List <GameObject> enemies = new List <GameObject>();
                    foreach (GameObject rootGO in rootGOs)
                    {
                        List <GameObject> childEnemies = rootGO.FindChildEnemies();

                        foreach (GameObject enemy in childEnemies)
                        {
                            enemies.Add(enemy);
                        }
                    }

                    foreach (GameObject enemy in enemies)
                    {
                        var tracker = enemy.GetComponent <EnemyTracker>();
                        if (tracker)
                        {
                            tracker.playerIds.Add(fromClient);
                        }
                        else
                        {
                            tracker = enemy.AddComponent <EnemyTracker>();
                            ServerSend.SyncEnemy(fromClient, enemy.name, tracker.enemyId);
                            tracker.playerIds.Add(fromClient);
                        }

                        bool foundUnusedKey = false;
                        for (int i = 0; i <= Server.Enemies.Count; i++)
                        {
                            if (!Server.Enemies.Keys.Contains(i))
                            {
                                tracker.enemyId = i;
                                Server.Enemies.Add(i, tracker);
                                foundUnusedKey = true;
                                break;
                            }
                        }

                        if (!foundUnusedKey)
                        {
                            for (int i = Server.Enemies.Count + 1; i <= 99999; i++)
                            {
                                if (!Server.Enemies.Keys.Contains(i))
                                {
                                    tracker.enemyId = i;
                                    Server.Enemies.Add(i, tracker);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }