Ejemplo n.º 1
0
        public void Leave(OpenPlayer player)
        {
            if (player.Level is MultiVerseLevel mvl)
            {
                var lvl = Plugin.Api.LevelManager.GetDefaultLevel();

                player.SpawnLevel(lvl, lvl.SpawnPoint, true);
                return;
            }

            player.SendPluginMessage($"You are not in a multiverse world!");
        }
Ejemplo n.º 2
0
        internal bool TryJoin(OpenPlayer player)
        {
            if (!CanJoin())
            {
                return(false);
            }

            if (TeamManager.TryAssignTeam(player))
            {
                player.SpawnLevel(Level, Level.SpawnPoint, false);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 3
0
        public void Join(OpenPlayer player, string levelname)
        {
            if (Plugin.MultiVerseManager.TryGet(levelname, out var instance))
            {
                player.SendPluginMessage($"Joining multiverse world: {instance.Name}");

                player.Level.RemovePlayer(player, true);

                player.SpawnLevel(instance.Level, instance.Level.SpawnPoint, true, null, () =>
                {
                    player.SendPluginMessage($"You have joined world: {instance.Name}, to leave it type '/mv leave' or join another multiverse world.");
                });
                return;
            }

            player.SendPluginMessage($"No world with the provided name has been found!");
        }
Ejemplo n.º 4
0
        internal bool TryJoin(OpenPlayer player)
        {
            if (!CanJoin())
            {
                return(false);
            }

            if (TeamManager.TryAssignTeam(player))
            {
                PlayerLocation spawnPosition;

                if (!TryGetSpawnPosition(out spawnPosition))
                {
                    spawnPosition = Level.SpawnPoint;
                }

                player.SpawnLevel(Level, spawnPosition, false);
                return(true);
            }

            return(false);
        }