Пример #1
0
 public AionConnection(Socket socket)
     : base(socket, new MessageProtocol(ChatPacketFactory.GetInstance()))
 {
     log         = LogManager.GetLogger(GetType());
     readPackets = new Queue <CsClientPacket>();
     sendPackets = new Queue <CsServerPacket>();
 }
Пример #2
0
        public static void Main()
        {
            try
            {
                log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("log4net.config"));

                System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
                AppDomain.CurrentDomain.UnhandledException += UnhandledException;
                Console.Title = title;
                Util.SystemInfo();
                Stopwatch stopwatch = Stopwatch.StartNew();
                CronService.GetInstance().Initialize();
                Util.Section("核心配置");
                Configs.LoadConfig();
                Util.Section("数据连接");
                DAOManager.Initialize();
                Util.Section("注册服务");
                GameService.Load();
                Util.Section("网络服务");
                NewLateBinding.LateCall(SlbService.GetInstance(), null, "Start", new object[0], null, null, null, IgnoreReturn: true);
                ChatPacketFactory.GetInstance();
                AionListener.GetInstance().Start();
                GamePacketFactory.GetInstance();
                GameListener.GetInstance().Start();
                Util.Section("");
                stopwatch.Stop();
                string text = string.Format("聊天服务器启动完成,耗时{0}秒!", ((double)stopwatch.ElapsedMilliseconds / 1000.0).ToString("0.00"));
                Console.WriteLine(new string(' ', Conversions.ToInteger(Util.StringLength(text))) + text);
                Util.Section("");
                if (ChatConfig.WORKING_MEMORY_SET_ENABLE)
                {
                    WorkingMemorySet.GetInstance().Initialize(ChatConfig.WORKING_MEMORY_SET_CRON);
                }
            }
            catch (Exception err)
            {
                log.Error(err.Message, err);
            }
        }
Пример #3
0
 public CsServerPacket()
 {
     base.OpCode = ChatPacketFactory.GetInstance().GetOpCode(GetType());
 }