Beispiel #1
0
        public ServerClient(GameManager game) : base(game)
        {
            NetPeerConfiguration config = new NetPeerConfiguration("DATX02");

            config.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);

            ServerThread = new NetClient(config);
            ServerThread.Start();

            Sender      = new ServerSender(ServerThread, this);
            Receiver    = new ServerReceiver(ServerThread, this);
            Game        = game;
            LocalPlayer = new Player(game);
            State       = ServerState.Lobby;
        }
Beispiel #2
0
        private TimeSpan WaitConnect = new TimeSpan(0, 0, 1); // 3 second wait

        #endregion Fields

        #region Constructors

        public ServerClient(GameManager game)
            : base(game)
        {
            NetPeerConfiguration config = new NetPeerConfiguration("DATX02");
            config.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);

            ServerThread = new NetClient(config);
            ServerThread.Start();

            Sender = new ServerSender(ServerThread, this);
            Receiver = new ServerReceiver(ServerThread, this);
            Game = game;
            LocalPlayer = new Player(game);
            State = ServerState.Lobby;
        }