コード例 #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;
        }
コード例 #2
0
ファイル: ServerClient.cs プロジェクト: MintL/datx02-rally
        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;
        }