コード例 #1
0
ファイル: Program.cs プロジェクト: elexor/d3sharp
        public void Run()
        {
            using (_server = new Server()) // Create new test server.
            {
                InitializeServerEvents(); // Initializes server events for debug output.

                // we can't listen for port 1119 because D3 and the launcher (agent) communicates on that port through loopback.
                // so we change our default port and start D3 with a shortcut like so:
                //   "F:\Diablo III Beta\Diablo III.exe" -launch -auroraaddress 127.0.0.1:1345
                _server.Listen(_port);
                Logger.Info("Server is listening on port {0}...", _server.Port.ToString());

                // Read user input indefinitely.
                while (_server.IsListening)
                {
                    var line = Console.ReadLine();
                    if (!string.Equals("quit", line, StringComparison.OrdinalIgnoreCase)
                     && !string.Equals("exit", line, StringComparison.OrdinalIgnoreCase))
                    {
                        continue;
                    }
                    Logger.Info("Shutting down server...");
                    _server.Shutdown();
                }
            }
        }
コード例 #2
0
ファイル: Connection.cs プロジェクト: nortex/d3sharp
        public Connection(Server server, Socket socket)
        {
            if (server == null) throw new ArgumentNullException("server");
            if (socket == null) throw new ArgumentNullException("socket");

            this._server = server;
            this._socket = socket;
        }       
コード例 #3
0
ファイル: Client.cs プロジェクト: xynoman/d3sharp
        public Client(Server server, Socket socket)
        {
            if (server == null) throw new ArgumentNullException("server");
            if (socket == null) throw new ArgumentNullException("socket");

            this._server = server;
            this._socket = socket;
            this.Services = new Dictionary<uint, uint>();
        }