Esempio n. 1
0
        // 创建实验室用的服务器,返回启动操作
        public static Action BuildLibServer(GameServer gs, int port)
        {
            srv = gs;

            var ci = BC <ConsoleInput>();

            ci.Srv = gs;

            BuildBaseComponents();     // 基础模块
            BuildBussinessLoggers(gs); // 日志系统
            BuildQuestionnaire(gs);    // 问卷系统
            BuildLogicComponents(gs);  // 逻辑功能
            BuildGMComponent();        // GM 和调试功能

            // 初始化所有模块
            srv.Initialize();

            return(() =>
            {
                // 启动服务器
                srv.Get <NetCore>().StartListening("0.0.0.0", port);
                srv.Get <ILog>().Info("GameServer started at: " + port);

                srv.Start();
            });
        }
Esempio n. 2
0
        public static Action BuildConsoleAgent(GameServer gs, string srvAddr, int srvPort)
        {
            srv = gs;

            BuildBaseComponents(); // 基础模块
            var cia = BC <ConsoleInputAgent>();

            // 初始化所有模块
            srv.Initialize();

            return(() =>
            {
                // 启动服务器
                cia.Start(srvAddr, srvPort);
                srv.Start();
            });
        }
Esempio n. 3
0
        // 战斗数据分析用服务器
        public static Action BuildConsoleDataAnalysis(GameServer gs, int port)
        {
            srv = gs;

            var cida = BC <ConsoleInputDataAnalysis>();

            cida.Srv = gs;

            BuildBaseComponents();         // 基础模块
            BuildLogicComponents(gs);      // 逻辑功能
            BuildDataAnalysisComponents(); // 数据分析功能

            // 初始化所有模块
            srv.Initialize();

            return(() =>
            {
                // 启动服务器
                srv.Get <ILog>().Info("DataAnalysisServer started at: " + port);

                srv.Start();
            });
        }