Beispiel #1
0
        public void Start(IPEndPoint endPoint)
        {
            Scheduler.DisabledEvents.Clear();
            if (Program.ServerConfiguration.DisabledEvents != null)
            {
                Program.ServerConfiguration.DisabledEvents.ToList().ForEach(
                    ev => Scheduler.DisabledEvents.Add(ev));
            }
            ShuttingDown = false;
            Time.Reset();
            Time.Start();
            Listener = new TcpListener(endPoint);
            Listener.Start();
            EndPoint = (IPEndPoint)Listener.LocalEndpoint;

            SocketAsyncEventArgs args = new SocketAsyncEventArgs();

            args.Completed += AcceptClient;

            if (!Listener.Server.AcceptAsync(args))
            {
                AcceptClient(this, args);
            }

            Log(LogCategory.Notice, "Running TrueCraft server on {0}", EndPoint);
            EnvironmentWorker.Change(MillisecondsPerTick, Timeout.Infinite);
            if (Program.ServerConfiguration.Query)
            {
                QueryProtocol.Start();
            }
        }
Beispiel #2
0
        public void Start(IPEndPoint endPoint)
        {
            ShuttingDown = false;
            Listener     = new TcpListener(endPoint);
            Listener.Start();
            EndPoint = (IPEndPoint)Listener.LocalEndpoint;

            Scheduler.Start();

            SocketAsyncEventArgs args = new SocketAsyncEventArgs();

            args.Completed += AcceptClient;

            if (!Listener.Server.AcceptAsync(args))
            {
                AcceptClient(this, args);
            }

            Log(LogCategory.Notice, "Running TrueCraft server on {0}", EndPoint);
            EnvironmentWorker.Change(100, 1000 / 20);
            if (Program.ServerConfiguration.Query)
            {
                QueryProtocol.Start();
            }
        }