コード例 #1
0
 public MineWorldServer()
 {
     NetPeerConfiguration netConfig = new NetPeerConfiguration("MineWorld");
     netConfig.Port = Constants.MineworldPort;
     netConfig.MaximumConnections = 2;
     netConfig.EnableMessageType(NetIncomingMessageType.ConnectionApproval);
     netConfig.EnableMessageType(NetIncomingMessageType.DiscoveryRequest);
     netConfig.DisableMessageType(NetIncomingMessageType.UnconnectedData);
     Server = new NetServer(netConfig);
     GameWorld = new GameWorld(this);
     Console = new MineWorldConsole(this);
     ServerListener = new ServerListener(Server,this);
     ServerSender = new ServerSender(Server, this);
     Listener = new Thread(ServerListener.Start);
     MapManager = new MapManager();
     PlayerManager = new PlayerManager();
     Configloader = new ConfigFile("Data/Settings.ini");
 }
コード例 #2
0
        public MineWorldServer()
        {
            NetPeerConfiguration netConfig = new NetPeerConfiguration("MineWorld");

            netConfig.Port = Constants.MineworldPort;
            netConfig.MaximumConnections = 2;
            netConfig.EnableMessageType(NetIncomingMessageType.ConnectionApproval);
            netConfig.EnableMessageType(NetIncomingMessageType.DiscoveryRequest);
            netConfig.DisableMessageType(NetIncomingMessageType.UnconnectedData);
            Server         = new NetServer(netConfig);
            GameWorld      = new GameWorld(this);
            Console        = new MineWorldConsole(this);
            ServerListener = new ServerListener(Server, this);
            ServerSender   = new ServerSender(Server, this);
            Listener       = new Thread(ServerListener.Start);
            MapManager     = new MapManager();
            PlayerManager  = new PlayerManager();
            Configloader   = new ConfigFile("Data/Settings.ini");
        }