/// <summary>
 /// Creates a new ScheduleManager with default values, linked to the 
 /// specified <see cref="EMMServer"/>.
 /// </summary>
 /// <param name="server">The EMMServer to use for executing commands.</param>
 public SchedulerManager(EMMServer server)
 {
     mServer = server;
     mTasks = new List<ScheduleTask>();
     mTimer = new Timer();
     mTimer.Elapsed += onTimerEvent;
 }
        private void Initialise()
        {
            // Setup the log viewer
            mLogItemLock = new object();
            mLogItems = new InvokeOC<LogListItem>(uxLogListView.Dispatcher);
            uxLogListView.ItemsSource = mLogItems;

            // Setup the server manager
            mMinecraft = Manager.Server;
            mMinecraft.ServerMessage += HandleServerMessage;
            mMinecraft.StatusChanged += HandleServerMessage;
        }
        public void FixtureSetup()
        {
            mPersistentServer = new EMMServer();

            mSettingsFilename = Path.Combine(Path.GetTempPath(), Path.GetTempFileName());
            using (TextWriter tw = new StreamWriter(mSettingsFilename))
            {
                tw.WriteLine(@"SimpleValue=Banana");
                tw.WriteLine(@"TestSimpleValue=Strawberry");
                tw.WriteLine(string.Format(@"AbsolutePath={0}", mSettingsFilename));
                tw.WriteLine(string.Format(@"RelativePath=.\{0}", Path.GetFileName(mSettingsFilename)));
                tw.Close();
            }

            mSettings = new SettingsFile(mPersistentServer, mSettingsFilename, '=');
            mSettings.LookForNewSettings();
        }
示例#4
0
        public void FixtureSetup()
        {
            // Reflection within the server will yield the incorrect directory for settings, so we need to set it here.
            string testRoot = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Substring(8));
            string settingsFile = Path.Combine(testRoot, "settings.conf");

            using (TextWriter tw = new StreamWriter(settingsFile))
            {
                tw.WriteLine(@"ServerJar=.\MinecraftSimulator.exe");
                tw.Close();
            }
            Console.WriteLine("Settings File is: " + settingsFile);

            mPersistentServer = new EMMServer();
            //mPersistentServer = new EMMServer(settingsFile);
            //Assert.That(mPersistentServer.Settings.Filename, Is.EqualTo(settingsFile));

            mPersistentServer.StartServer();
            WaitForServerStatus(Status.Running);
        }
示例#5
0
 /// <summary>
 /// Creates a new <c>CommandParser</c> and connects it to the specified <see cref="IServer"/>.
 /// </summary>
 /// <param name="minecraft"></param>
 public CommandParser(EMMServer minecraft)
 {
     mMinecraft = minecraft;
 }
示例#6
0
 public UserManager(EMMServer server)
 {
     mServer = server;
 }
示例#7
0
 public SettingsFile(EMMServer server, string fileName, char separator)
 {
     mServer = server;
     mSettingsFile = fileName;
     mSeparator = separator;
 }
示例#8
0
 internal PowerManager(EMMServer server)
 {
     mServer = server;
 }
示例#9
0
 public void FixtureTeardown()
 {
     mPersistentServer.StopServer(false, 0, true);
     WaitForServerStatus(Status.Stopped);
     mPersistentServer = null;
 }
示例#10
0
 public UserManager(EMMServer server)
 {
     mServer = server;
 }
示例#11
0
 public Config(EMMServer server)
 {
     mServer = server;
     mServerManagerRoot = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase.Substring(8))); // strip the "file:///" from the front of the codebase
 }
示例#12
0
 /// <summary>
 /// Creates a new <c>CommandParser</c> and connects it to the specified <see cref="IServer"/>.
 /// </summary>
 /// <param name="minecraft"></param>
 public CommandParser(EMMServer minecraft)
 {
     mMinecraft = minecraft;
 }
 public MCServerProperties(EMMServer server)
     : base(server, Path.Combine(server.Settings.MinecraftRoot, "server.properties"), '=')
 {
 }
示例#14
0
 internal PowerManager(EMMServer server)
 {
     mServer = server;
 }