예제 #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
        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>();
        }