示例#1
0
文件: Program.cs 项目: zaq1xsw/DogSE
        static void Main()
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new FrmMain());


            ServerConfig.Tcp = new[]
            {
                new TcpConfig
                {
                    Host = "127.0.0.1",
                    Port = 4530,
                }
            };

            Logs.ConfigLogFile("tradeage.log");
            Logs.AddAppender(new ConsoleAppender());

            GameServerService.IsConsoleRun = true;
            var world = new WorldBase();

            world.IsAutoRegisterMessage       = false;
            world.NetStateDisconnect         += world_NetStateDisconnect;
            GameServerService.AfterModuleInit = () =>
            {
                ServerLogicProtoclRegister.Register(world.GetModules(), world.PacketHandlers);
                ClientProxyRegister.Register();
                return(true);
            };
            LogicModule.Prints();
            GameServerService.StartGame(world);
        }
示例#2
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            ServerConfig.Tcp = new []
            {
                new ServerConfig.TcpConfig
                {
                    Host = "127.0.0.1",
                    Port = 4530,
                }
            };

            Logs.ConfigLogFile("tradeage.log");

            GameServerService.StartGame(new WorldBase());
        }