public static void SpawnPlayer(Client client, GamePosition positionToSpawn = null, Action callback = null)
        {
            CharacterData characterData = client.GetData(CharacterData.CHARACTER_DATA_KEY);


            if (positionToSpawn == null)
            {
                if (characterData.GetPosition() == null)
                {
                    positionToSpawn = GetRandomSpawnPoint();
                }
                else
                {
                    positionToSpawn = new GamePosition();
                    positionToSpawn.SetPosition(characterData.GetPosition());
                    positionToSpawn.Heading = characterData.Heading.HasValue ? characterData.Heading.Value : 0;
                }
            }

            NAPI.Player.SpawnPlayer(client, positionToSpawn.GetPosition(), positionToSpawn.GetHeading());
            if (callback != null)
            {
                callback();
            }
        }
        public static void SpawnPlayerAfter(Client client, GamePosition position = null, int timeMs = 3000, Action callback = null)
        {
            System.Timers.Timer _spawnTimer = new System.Timers.Timer();
            _spawnTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            _spawnTimer.Interval = timeMs;
            _spawnTimer.Enabled  = true;

            void OnTimedEvent(object sender, EventArgs e)
            {
                SpawnPlayer(client, position, callback);
                _spawnTimer.Stop();
                _spawnTimer.Dispose();
            }
        }
        public static GamePosition GetRandomSpawnPoint()
        {
            GamePosition spawnPoint = _spawnPositions.Locations[Main.Random.Next(_spawnPositions.Locations.Length)];

            return(spawnPoint);
        }