Exemplo n.º 1
0
        public ChannelServer(int id)
        {
            MapFactory = new MapleMapFactory(MapleDataProviderFactory.GetDataProvider("Map.wz"),
                                             MapleDataProviderFactory.GetDataProvider("String.wz"));
            ChannelId = id;

            TimerManager.Instance.RepeatTask(RespawnMaps, 10 * 1000);
        }
Exemplo n.º 2
0
 public EventInstanceManager(EventManager em, string name)
 {
     this.m_em    = em;
     Name         = name;
     m_mapFactory = new MapleMapFactory(MapleDataProviderFactory.GetDataProvider("Map.wz"),
                                        MapleDataProviderFactory.GetDataProvider("String.wz"))
     {
         ChannelId = em.ChannelServer.ChannelId
     };
 }
Exemplo n.º 3
0
        public ServerInit()
        {
            CommandProcessor.Processor.Init();

            config = AppConfig.Load();
            if (config == null)
            {
                AppConfig.Creator();
                config = AppConfig.Load();
            }

            #region 注册事件
            Type[] type = Assembly.GetExecutingAssembly().GetTypes();
            foreach (Type t in type)
            {
                Attribute attribute = t.GetCustomAttribute(typeof(PacketHead), true);
                if (attribute != null)
                {
                    if (((PacketHead)attribute).Type.Equals(typeof(Channel.Opcode.RecvOpcode)))
                    {
                        HandlerInterface @interface = (HandlerInterface)Assembly.GetExecutingAssembly().CreateInstance(t.FullName);
                        CommonGlobal.mHandler.Add(((PacketHead)attribute).Head, @interface);
                        Console.WriteLine("注册事件:[{0}] - [{1}] - [进度:{2}%]", System.Enum.GetName(typeof(Channel.Opcode.RecvOpcode), ((PacketHead)attribute).Head), t.Name, ((PacketHead)attribute).Progress);
                    }
                }
            }
            #endregion

            Console.WriteLine("事件注册数量:{0}", CommonGlobal.mHandler.Count);

            channelServices = new Services.ChannelServices(config);

            GameConstants._QuitServer += channelServices.QuitServer;

            //初始化地图数据
            MapleMapFactory.Init();
            Console.WriteLine("加载完毕!");
        }