示例#1
0
        /// <summary>
        /// Starts the netServer.
        /// </summary>
        /// <param name="port">The port to listen on.</param>
        /// <param name="password">The password of the netServer.</param>
        /// <param name="maximumPlayerAmount">Maximum amount of players.</param>
        public void ServerStart(int port, string password, int maximumPlayerAmount)
        {
            if (IsMPClientInitialized)
            {
                Log.Warning("Cannot start the server. Client is initialized.");
                return;
            }

            if (!IsMPServerInitialized)
            {
                Log.Warning("Cannot start the server. The server is not initialized.");
                return;
            }

            Log.Message("Starting server.");
            MPServer.StartServer(port, password, maximumPlayerAmount);
            Log.Message("Server started.");
        }
示例#2
0
        /// <summary>
        /// Starts the netServer.
        /// </summary>
        public void ServerStart()
        {
            if (IsMPClientInitialized)
            {
                Log.Warning("Cannot start the server. Client is initialized.");
                return;
            }

            if (!IsMPServerInitialized)
            {
                Log.Warning("Cannot start the server. The server is not initialized.");
                return;
            }

            Log.Message("Starting server.");
            MPServer.StartServer();
            SetMPRole(MPRoleType.Server);
            Log.Message("Server started.");
        }