Ejemplo n.º 1
0
        protected Server(ServerConfiguration configuration)
        {
            // Set configuration
            Assert.NotNull(configuration, "configuration");

            Configuration = configuration;

            // Set log level
            Log.SetLevel(configuration.LogLevel);

            // Log some generic data
            log.Info("Running server in {0} mode", configuration.ServerMode);
            log.Info("Using {0} ms of send buffering", configuration.SendBuffering);

            // Setup id pools
            actorIdPool = new Collections.UShortPool();
            playerIdPool = new Collections.UShortPool();

            //
            LoadAssemblies();

            // Setup context
            ContextPlugin = CreateContextPlugin(typeof(ServerContextPluginAttribute));
            Context = new Context(this);

            // Create server
            NetworkPeer = NetworkServer = new Network.LidgrenServer(this);
        }
Ejemplo n.º 2
0
        protected Server(ServerConfiguration configuration)
        {
            // Set configuration
            Assert.NotNull(configuration, "configuration");

            Configuration = configuration;

            // Set log level
            Log.SetLevel(configuration.LogLevel);

            // Log some generic data
            log.Info("Running server in {0} mode", configuration.ServerMode);
            log.Info("Using {0} ms of send buffering", configuration.SendBuffering);

            // Setup id pools
            actorIdPool  = new Collections.UShortPool();
            playerIdPool = new Collections.UShortPool();

            //
            LoadAssemblies();

            // Setup context
            ContextPlugin = CreateContextPlugin(typeof(ServerContextPluginAttribute));
            Context       = new Context(this);

            // Create server
            NetworkPeer = NetworkServer = new Network.LidgrenServer(this);
        }