示例#1
0
        public Server()
        {
            int width = 16;
            Server.connection = new MySqlConnection("Database=cubeworld;DataSource=localhost;UserId=root;Password=root");

            world = new Map.Map(new Models.TilesModel(Server.connection, width), width, 4);

            Console.WriteLine("> Prepering map of total width = {0} tiles ...", world.getMapWidth());

            listener.Prefixes.Add("http://*:40000/");
            listener.Start();

            Console.WriteLine("> Starting server ...");

            while (true)
            {
                maxClientsAtOnce.WaitOne();
                Accept();
            }
        }