Ejemplo n.º 1
0
        protected override void OnStart()
        {
            WriteLine("Game Server is starting...");
            WriteLine();

            GameServer = new GameServer(
                Settings.Default.AppId,
                Settings.Default.ListeningPort,
                Settings.Default.BroadcastRange,
                Settings.Default.ServerId,
                Settings.Default.ServerType);

            GameServer.Start();
        }
Ejemplo n.º 2
0
        public GameServerTest()
        {
            _threader = new ThreadController(false);
            _serializer = new JsonSerializer();
            testServerHost = getLocalIPAddress().ToString();

            //-- Create and start the server
            _gs = new GameServer(TEST_APP_ID, TEST_CLIENT_PORT, TEST_BROADCAST_RANGE, TEST_SERVER_ID, ServerType.GameServer);
            _gs.Start();

            //-- Create the clients
            NetPeerConfiguration config = new NetPeerConfiguration(TEST_APP_ID);
            _clientOne = new NetClient(config);
            _clientTwo = new NetClient(config);
        }