Exemplo n.º 1
0
 public ConsolePlayer(Server server)
     : base()
 {
     this.Group = new ConsoleGroup();
     username = "******";
     ip = "127.0.0.1";
 }
Exemplo n.º 2
0
        public Server()
        {
            Log("Starting Server");
            s = this;
            consolePlayer = new ConsolePlayer(s);
            consolePlayer.SetUsername(ConsoleName);
            //Group.DefaultGroup = new DefaultGroup(); //debugging
            mainlevel = new World(0, 127, 0, "main", new Random().Next());
            World.worlds.Add(mainlevel);
            ml = new MainLoop("server");
            #region updatetimer
            ml.Queue(delegate
            {
                updateTimer.Elapsed += delegate
                {
                Player.GlobalUpdate();
                }; updateTimer.Start();
            });
            #endregion
            //TODO AI Update Timer

            //Setup();

            Log("Server Started");

            //new Creeper(new Point3(0, 0, 0), mainlevel);
        }
Exemplo n.º 3
0
 public ConsolePlayer(Server server)
     : base()
 {
     this.group = new ConsoleGroup();
     username = Server.ConsoleName;
     ip = "127.0.0.1";
 }
Exemplo n.º 4
0
 public RemotePlayer(Server server)
     : base()
 {
     this.group = new ConsoleGroup();
     username = Remote.getUsername();
     ip = Remote.getIp();
 }
Exemplo n.º 5
0
        public Server()
        {
            Log("Starting Server");
            s = this;
            if (Directory.Exists("main"))
            {
                mainlevel = World.LoadLVL("main");
            }
            else
            {
                mainlevel = new World(0, 127, 0, "main", 0) { ChunkLimit = int.MaxValue };
                World.worlds.Add(mainlevel);
            } //changed to seed 0 for now
            ml = new MainLoop("server");
            #region updatetimer
            ml.Queue(delegate
            {
                keepAliveTimer.Elapsed += delegate
                {
                    Player.players.ForEach(delegate(Player p) { p.SendKeepAlive(); });
                }; keepAliveTimer.Start();
            });
            ml.Queue(delegate
            {
                updateTimer.Elapsed += delegate
                {
                Player.GlobalUpdate();
                }; updateTimer.Start();
            });
            ml.Queue(delegate
            {
                playerlisttimer.Elapsed += delegate
                {
                    Player.PlayerlistUpdate();
                }; playerlisttimer.Start();
            });
            #endregion
            //TODO AI Update Timer

            //Setup();

            //new Creeper(new Point3(0, 72, 0), mainlevel);
        }
Exemplo n.º 6
0
        public Server()
        {
            Log("Starting Server");
            s = this;
            mainlevel = new World(0, 127, 0, "main");
            World.worlds.Add(mainlevel);
            ml = new MainLoop("server");
            #region updatetimer
            ml.Queue(delegate
            {
                updateTimer.Elapsed += delegate
                {
                    Player.GlobalUpdate();
                }; updateTimer.Start();
            });
            #endregion

            Setup();

            Log("Server Started");
        }
Exemplo n.º 7
0
 private static void Exit()
 {
     Server.Stop();
     Server = null;
 }
Exemplo n.º 8
0
 private static void StartServer()
 {
     (Server = new Server()).Setup();
     (webServer = new WebServer()).Start();
 }
Exemplo n.º 9
0
 public Server()
 {
     s = this;
 }