Beispiel #1
0
        public SS14Server(ICommandLineArgs args)
        {
            var    assemblies  = new List <Assembly>();
            string assemblyDir = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);

            assemblies.Add(Assembly.LoadFrom(Path.Combine(assemblyDir, "SS14.Server.Services.dll")));

            IoCManager.AddAssemblies(assemblies);


            IoCManager.Resolve <ISS14Server>().SetServerInstance(this);

            //Init serializer
            var serializer = IoCManager.Resolve <ISS14Serializer>();

            Runlevel   = RunLevel.Init;
            _singleton = this;

            var configMgr = IoCManager.Resolve <IServerConfigurationManager>();

            configMgr.Initialize(PathHelpers.ExecutableRelativeFile("server_config.xml"));
            string logPath = configMgr.LogPath;

            if (!Path.IsPathRooted(logPath))
            {
                logPath = PathHelpers.ExecutableRelativeFile(logPath);
            }

            LogManager.Initialize(logPath, configMgr.LogLevel);

            TickRate   = IoCManager.Resolve <IServerConfigurationManager>().TickRate;
            ServerRate = 1000.0f / TickRate;
        }
Beispiel #2
0
        public SS14Server()
        {
            IoCManager.Resolve <ISS14Server>().SetServerInstance(this);

            //Init serializer
            var serializer = IoCManager.Resolve <ISS14Serializer>();

            Runlevel   = RunLevel.Init;
            _singleton = this;

            IoCManager.Resolve <IServerConfigurationManager>().Initialize("./server_config.xml");
            LogManager.Initialize(IoCManager.Resolve <IServerConfigurationManager>().LogPath,
                                  IoCManager.Resolve <IServerConfigurationManager>().LogLevel);

            TickRate   = IoCManager.Resolve <IServerConfigurationManager>().TickRate;
            ServerRate = 1000.0f / TickRate;
        }
        public SS14Server()
        {
            IoCManager.Resolve<ISS14Server>().SetServerInstance(this);

            //Init serializer
            var serializer = IoCManager.Resolve<ISS14Serializer>();

            Runlevel = RunLevel.Init;
            _singleton = this;

            IoCManager.Resolve<IConfigurationManager>().Initialize("./config.xml");
            LogManager.Initialize(IoCManager.Resolve<IConfigurationManager>().LogPath,
                                  IoCManager.Resolve<IConfigurationManager>().LogLevel);

            TickRate = IoCManager.Resolve<IConfigurationManager>().TickRate;
            ServerRate = 1000.0f / TickRate;
        }