Esempio n. 1
0
        public override Level GetLevel(Player player, string name)
        {
            Level level2 = Levels.FirstOrDefault(l => l.LevelId.Equals(name, StringComparison.InvariantCultureIgnoreCase));

            if (level2 == null)
            {
                AnvilWorldProvider _provider = null;
                for (int i = 0; i <= 4; i++)
                {
                    string name2;
                    if (i == 0)
                    {
                        name2 = "overworld";
                    }
                    else
                    {
                        name2 = "overworld" + i;
                    }
                    GameMode           gameMode     = Config.GetProperty("GameMode", GameMode.Survival);
                    Difficulty         difficulty   = Config.GetProperty("Difficulty", Difficulty.Normal);
                    int                viewDistance = Config.GetProperty("ViewDistance", 7);
                    AnvilWorldProvider world        = _provider;
                    if (world == null)
                    {
                        world = new AnvilWorldProvider();
                    }
                    var level = new xCoreLevelLobby(name2, world, EntityManager, xCore);
                    level.ViewDistance  = 8;
                    level.isGlobalLobby = true;
                    level.Initialize();
                    if (_provider == null)
                    {
                        world.MakeAirChunksAroundWorldToCompensateForBadRendering();
                        _provider = world;
                    }
                    level.Id = i + 1;
                    Levels.Add(level);
                    return(null);
                }
                return(null);
            }
            else
            {
                foreach (Level l in Levels)
                {
                    if (l.PlayerCount < 50)
                    {
                        return(l);
                    }
                }
            }
            return(null);
        }
Esempio n. 2
0
 public xCoreNPC(string name, xCoreLevelLobby level, xCoreInterface G, MiNetServer server = null) : base(name, level)
 {
     Game        = G;
     this.server = server;
     LevelLobby  = level;
 }