Exemple #1
0
        /// <summary>
        /// Creates and attempts to start an AOSServer with
        /// the game specific config.
        /// </summary>
        public static bool Initialize(int maxConnections, IPEndPoint endPoint, IPEndPoint receiveEndPoint = null)
        {
            GlobalNetwork.SetupLogging();

            NetServerConfig config = new NetServerConfig();

            config.MaxConnections       = maxConnections;
            config.DontApplyPingControl = true;

            AOSServer server = new AOSServer(config);

            bool success = server.Start(endPoint);

            if (success)
            {
                GlobalNetwork.IsServer    = true;
                GlobalNetwork.IsConnected = true;
            }

            return(success);
        }