Ejemplo n.º 1
0
        public void Start()
        {
            RemoteProperties.Load();

            if (!enableRemote)
            {
                return;
            }
            try
            {
                IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, port);
                listen = new Socket(endpoint.Address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
                listen.Bind(endpoint);
                listen.Listen((int)SocketOptionName.MaxConnections);
                listen.BeginAccept(new AsyncCallback(Accept), null);
                Server.s.Log(string.Format("Creating listening socket on port {0} for remote console...", port));
            }
            catch (SocketException e) { Server.s.Log(e.Message + e.StackTrace); }
            catch (Exception e) { Server.s.Log(e.Message + e.StackTrace); }
        }
Ejemplo n.º 2
0
        public void Start()
        {
            if (!RemoteServer.enableRemote)
            {
                return;
            }
            try
            {
                RemoteProperties.Load();
                ip = Socket.RemoteEndPoint.ToString().Split(':')[0];
                Player.GlobalMessage(c.navy + "A Remote has connected to the server");
                Server.s.Log("[Remote] connected to the server.");


                Socket.BeginReceive(_tbu, 0, _tbu.Length, SocketFlags.None, Receive, this);
            }

            catch (Exception e)
            {
                Server.ErrorLog(e);
            }
        }