Beispiel #1
0
        static void Main()
        {
            ConsoleLogManager.Reset();

            var scheduleService = new ScheduleService();

            scheduleService.Run <DistributeJob>("Rotation Set", "0 0 0 1 1/1 ? *");
        }
Beispiel #2
0
        public void Setup()
        {
            _jsonConnection   = Substitute.For <IJsonConnection>();
            _fileCache        = Substitute.For <IFileCache>();
            _applicationPaths = Substitute.For <IApplicationPaths>();
            _logManager       = new ConsoleLogManager();

            _jsonConnection.PostAsync(Arg.Any <LoginRequest>(), Option <string> .None)
            .ReturnsForAnyArgs(new Response <LoginRequest.Response>(new LoginRequest.Response("TOKEN")));
        }
        private void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            int progress = GetProgress();

            Console.Title = $"Progress: {progress}%";

            if (progress == 100)
            {
                Console.WriteLine("Rotation completed on: {0}, successful: {1}, failed : {2}", DateTime.Now, _amountFinishedActions, _amountFailedActions);
                ConsoleLogManager.Reset();
                StopProgressTimer();
            }
        }
        public void Setup()
        {
            _logManager       = new ConsoleLogManager();
            _applicationPaths = Substitute.For <IApplicationPaths>();
            _fileCache        = Substitute.For <IFileCache>();

            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                Converters = new List <JsonConverter> {
                    new OptionJsonConverter()
                }
            };
        }
Beispiel #5
0
        private bool startServer()
        {
            commandHandler = new ConsoleCommandHandler(this);
            var threadcommandreader = new ThreadCommandReader(this);

            threadcommandreader.setDaemon(true);
            threadcommandreader.start();
            ConsoleLogManager.init();
            logger.info("Starting Crafty version " + Crafty.VERSION + "(based on minecraft server version Beta 1.3)");

            logger.info("Loading properties");
            propertyManagerObj = new PropertyManager(new File("server.properties"));
            string s = propertyManagerObj.getStringProperty("server-ip", "");

            onlineMode        = propertyManagerObj.getBooleanProperty("online-mode", true);
            spawnPeacefulMobs = propertyManagerObj.getBooleanProperty("spawn-animals", true);
            pvpOn             = propertyManagerObj.getBooleanProperty("pvp", true);
            InetAddress inetaddress = null;

            if (s.Length > 0)
            {
                inetaddress = InetAddress.getByName(s);
            }
            int i = propertyManagerObj.getIntProperty("server-port", 25565);

            logger.info(
                (new StringBuilder()).append("Starting Minecraft server on ").append(s.Length != 0 ? s : "*").append(":")
                .append(i).toString());
            networkServer = new NetworkListenThread(this, inetaddress, i);
            if (!onlineMode)
            {
                logger.warning("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
                logger.warning("The server will make no attempt to authenticate usernames. Beware.");
                logger.warning(
                    "While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
                logger.warning("To change this, set \"online-mode\" to \"true\" in the server.settings file.");
            }
            configManager = new ServerConfigurationManager(this);
            entityTracker = new EntityTracker(this);
            long   l  = java.lang.System.nanoTime();
            string s1 = propertyManagerObj.getStringProperty("level-name", "world");

            logger.info((new StringBuilder()).append("Preparing level \"").append(s1).append("\"").toString());
            initWorld(new SaveConverterMcRegion(new File(".")), s1);
            logger.info(
                (new StringBuilder()).append("Done (").append(java.lang.System.nanoTime() - l).append(
                    "ns)! For help, type \"help\" or \"?\"").toString());
            return(true);
        }
Beispiel #6
0
 static LogManager()
 {
     Default = new ConsoleLogManager();
 }
Beispiel #7
0
 public void Setup()
 {
     _logManager = new ConsoleLogManager();
 }
 public void Setup()
 {
     _logManager    = new ConsoleLogManager();
     _tvDbClient    = Substitute.For <ITvDbClient>();
     _seriesMapping = Substitute.For <ISeriesMapping>();
 }