public override void Initialize(JobProcessor thread)
        {
            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            this.ThreadCount = ServiceCore.FeatureMatrix.GetInteger("MMOChannelThreadCount");
            base.Initialize(thread, MMOChannelServiceOperations.TypeConverters);
            base.RegisterMessage(OperationMessages.TypeConverters);
            base.RegisterAllProcessors(Assembly.GetExecutingAssembly());
            this.InitializeThreads();
            Log <MMOChannelService> .Logger.InfoFormat("Starting server with port {0}", HeroesSection.Instance.ChannelRelay.TcpPort);

            this.server = new Server(thread, HeroesSection.Instance.ChannelRelay.TcpPort);
            this.server.ClientIdentified += this.server_ClientIdentified;
            string[] files = Directory.GetFiles(ServiceCoreSettings.Default.MMOChannelMapFilePath, "*.dat", SearchOption.AllDirectories);
            foreach (string text in files)
            {
                Log <MMOChannelService> .Logger.InfoFormat("Loading {0}", text);

                string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(text);
                Map    item = new Map(fileNameWithoutExtension, text);
                this.maps.Add(item);
            }
            MMOChannelContents.Initialize();
            if (!ServiceCore.FeatureMatrix.IsEnable("MMOForceRecommend"))
            {
                this.perfMon = new PerformanceMonitor(thread, 30000);
                this.perfMon.ValueUpdated += this.perfMon_ValueUpdated;
            }
            Scheduler.Schedule(thread, Job.Create(new Action(this.PossessChannels)), 60000);
            if (ServiceCore.FeatureMatrix.IsEnable("Burn"))
            {
                Scheduler.Schedule(base.Thread, Job.Create(new Action(this.BurnGaugeBroadcastRepeat)), 60000);
            }
        }
        public override void Initialize(JobProcessor thread)
        {
            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            base.Initialize(thread, ExecutionServiceOperations.TypeConverters);
            base.RegisterMessage(OperationMessages.TypeConverters);
            base.RegisterProcessor(typeof(StartService), (Operation op) => new StartServiceProcessor(this, op as StartService));
            base.RegisterProcessor(typeof(QueryService), (Operation op) => new QueryServiceProcessor(this, op as QueryService));
            base.RegisterProcessor(typeof(ExecAppDomain), (Operation op) => new ExecAppDomainProcessor(this, op as ExecAppDomain));
            LocalServiceConfig localServiceConfig = this.Configuration.GetSection("LocalServiceConfig") as LocalServiceConfig;

            foreach (object obj in localServiceConfig.ServiceInfos)
            {
                LocalServiceConfig.Service service = (LocalServiceConfig.Service)obj;
                if (service.AutoStart)
                {
                    Scheduler.Schedule(base.Thread, Job.Create <string>(delegate(string serviceClass)
                    {
                        Log <ExecutionService> .Logger.DebugFormat("<Initialize : [{0}]> auto start...", serviceClass);
                        string text;
                        this.StartAppDomain(serviceClass, out text);
                        Log <ExecutionService> .Logger.DebugFormat("<Initialize : [{0}]> auto start invoked : {1}", serviceClass, text);
                    }, service.ServiceClass), 0);
                }
            }
            base.Disposed += delegate(object sender, EventArgs e)
            {
                foreach (string domainName in new List <string>(this.DomainList))
                {
                    this.StopAppDomain(domainName);
                }
            };
        }
Exemple #3
0
 public override void Initialize(JobProcessor thread)
 {
     ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
     base.Initialize(thread, MessageID.TypeConverters);
     base.RegisterMessage(OperationMessages.TypeConverters);
     base.RegisterProcessor(typeof(Whisper), (Operation op) => new WhisperProcessor(this, op as Whisper));
     base.RegisterProcessor(typeof(WhisperToGameClient), (Operation op) => new WhisperToGameClientProcessor(this, op as WhisperToGameClient));
     this.InitializeRelayClient(ServiceCoreSettings.Default.TalkWcfService, string.Format("{0}:{1}", base.Category, Service.ServerCode));
 }
Exemple #4
0
        public override void Initialize(JobProcessor thread)
        {
            IEnumerable <Type> types = OperationTypes.Types((Type type) => type.Namespace != null && type.Namespace == typeof(TradeServiceOperations).Namespace);

            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            base.Initialize(thread, types.GetConverter());
            base.RegisterMessage(OperationMessages.TypeConverters);
            base.RegisterAllProcessors(Assembly.GetExecutingAssembly());
            this.TradeItemAvgPrice = new TradeItemAvgPrice(this);
        }
Exemple #5
0
 public override void Initialize(JobProcessor thread)
 {
     ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
     base.Initialize(thread, MessageID.TypeConverters);
     base.RegisterMessage(OperationMessages.TypeConverters);
     base.RegisterProcessor(typeof(Respond), (Operation op) => new RespondProcessor(this, op as Respond));
     if (FeatureMatrix.IsEnable("TcProtect"))
     {
         this.InitializeFsw();
         Scheduler.Schedule(base.Thread, Job.Create(new Action(this.UpdateTcProtect)), 0);
         base.RegisterProcessor(typeof(TcProtectRespond), (Operation op) => new TcProtectRespondProcessor(this, op as TcProtectRespond));
         base.RegisterProcessor(typeof(TcProtectCheck), (Operation op) => new TcProtectCheckProcessor(this, op as TcProtectCheck));
     }
 }
Exemple #6
0
 public override void Initialize(JobProcessor thread)
 {
     ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
     this.RequestIntervalSeconds = ServiceCoreSettings.Default.GRCRequestSeconds;
     base.Initialize(thread, GRCServiceOperations.TypeConverters);
     base.RegisterMessage(OperationMessages.TypeConverters);
     base.RegisterProcessor(typeof(GameResourceRespond), (Operation op) => new GameResourceRespondProcessor(this, op as GameResourceRespond));
     this.AssemblyServiceCore = Assembly.LoadFile(Path.Combine(Environment.CurrentDirectory, "ServiceCore.dll"));
     this.Content             = this.LoadContent("ItemClassInfo");
     if (this.Content.Elements.Count <object>() == 0)
     {
         Log <GRCService> .Logger.InfoFormat("LoadContent() failed! Content.Elements.Count() == 0", new object[0]);
     }
 }
Exemple #7
0
        public override void Initialize(JobProcessor thread)
        {
            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            base.Initialize(thread, MessageID.TypeConverters);
            base.RegisterMessage(OperationMessages.TypeConverters);
            base.RegisterProcessor(typeof(Login), (Operation op) => new LoginProcessor(this, op as Login));
            this.cafeauthProcessing = true;
            if (!this.Valid)
            {
                Log <CafeAuthService> .Logger.Warn("CafeAuth service is in fake mode. (CafeAuthDomainSN==255)");

                return;
            }
            this.connectToCafeAuthServer();
        }
        public override void Initialize(JobProcessor thread)
        {
            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            AdminContents.Initialize();
            this.logger = new HeroesLogDataContext();
            base.Initialize(thread, null);
            base.RegisterMessage(AdminClientServiceOperationMessages.TypeConverters);
            this.acceptor.ClientAccept += this.server_ClientAccept;
            this.acceptor.Start(thread, (int)ServiceCoreSettings.Default.AdminClientServicePort);
            Log <AdminClientService> .Logger.Debug("Starts AdminClientService");

            this.mf.Register <AdminClientServicePeer>(AdminClientServiceOperationMessages.TypeConverters, "ProcessMessage");
            this.controller = new AdminClientServicePeer(this, null);
            EventDataContext.Initialize(thread);
        }
Exemple #9
0
        public override void Initialize(JobProcessor thread)
        {
            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            base.Initialize(thread, GuildServiceOperations.TypeConverters);
            base.RegisterMessage(OperationMessages.TypeConverters);
            base.RegisterAllProcessors(Assembly.GetExecutingAssembly());
            if (FeatureMatrix.IsEnable("koKR") && !FeatureMatrix.IsEnable("NewbieGuildRecommend"))
            {
                try
                {
                    GroupNMLinkSoapResult groupNMLinkSoapResult = new GroupNMLinkSoapWrapper(130076).Execute();
                    if (groupNMLinkSoapResult.SoapErrorCode == 0)
                    {
                        Log <GuildService> .Logger.InfoFormat("길드 Refresh 성공", new object[0]);
                    }
                    else
                    {
                        Log <GuildService> .Logger.ErrorFormat("길드 Refresh 실패 : {0}", groupNMLinkSoapResult.SoapErrorCode);
                    }
                }
                catch (Exception ex)
                {
                    Log <GuildService> .Logger.Error("길드 Refresh 예외", ex);
                }
            }
            if (FeatureMatrix.IsEnable("GuildWebChat") && ServiceCoreSettings.Default.GuildChatWcfService.Length > 0)
            {
                base.OnSetupID += delegate(int id)
                {
                    Scheduler.Schedule(base.Thread, Job.Create(delegate
                    {
                        this.InitializeGuildWebChat(id);
                    }), 0);
                };
            }
            this.OnlineGuildIDList = new List <long>();
            DateTime d = GuildContents.GetPrevDailyGPResetTime() + TimeSpan.FromDays(1.0);

            this.DailyGPResetScheduleID = Scheduler.Schedule(thread, Job.Create(new Action(this.ResetOnlineGuildDailyGPScheduleFunc)), d - DateTime.UtcNow + TimeSpan.FromSeconds(30.0));
            this.NewbieRecommendGuild   = new List <long>();
            this.LogThread = base.AcquireNewThread();
            this.LogThread.Start();
        }
Exemple #10
0
        public override void Initialize(JobProcessor thread)
        {
            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            DSContents.Initialize();
            base.Initialize(thread, DSServiceOperations.TypeConverters);
            base.RegisterMessage(OperationMessages.TypeConverters);
            base.RegisterAllProcessors(Assembly.GetExecutingAssembly());
            this.MessageHandlerFactory = new MessageHandlerFactory(true);
            this.MessageHandlerFactory.Register <DSEntity>(Messages.TypeConverters, "ProcessMessage");
            this.InitializeTcpClientHolder();
            base.Disposed += delegate(object _, EventArgs __)
            {
                this.KillDSProcess();
            };
            this.KillDSProcess();
            DSService.MyIP = this.GetMyIP();
            this.InitializeTcpServer(ServiceCoreSettings.Default.DSServicePort);
            base.OnSetupID += delegate(int id)
            {
                Scheduler.Schedule(base.Thread, Job.Create(new Action(this.SetupDSController)), 0);
            };
            int integer = FeatureMatrix.GetInteger("DSCactiFrequency");

            if (integer > 0)
            {
                this.CactiCsvFileDropper = new CactiCsvFileDropper("Cacti", "DSService", integer, new List <string>
                {
                    "ProcessCount",
                    "FPS_siglint",
                    "FPS_bugeikloth",
                    "FPS_elculous"
                });
                this.CactiCsvFileDropper.FileDropStarted += this.GetCactiInformation;
            }
            FeatureMatrix.onUpdated += this.OnUpdatedFetureMatrix;
        }
Exemple #11
0
        public override void Initialize(JobProcessor thread)
        {
            ConnectionStringLoader.LoadFromServiceCore(Settings.Default);
            base.Initialize(thread, CashShopServiceOperations.TypeConverters);
            base.RegisterMessage(OperationMessages.TypeConverters);
            base.RegisterProcessor(typeof(NotifyCashShopUserInfo), (Operation x) => new NotifyCashShopUserInfoProcessor(this, x as NotifyCashShopUserInfo));
            base.RegisterProcessor(typeof(NotifyCashShopCID), (Operation x) => new NotifyCashShopCIDProcessor(this, x as NotifyCashShopCID));
            base.RegisterProcessor(typeof(QueryCashShopBalance), (Operation x) => new QueryCashShopBalanceProcessor(this, x as QueryCashShopBalance));
            base.RegisterProcessor(typeof(QueryCashShopInventory), (Operation x) => new QueryCashShopInventoryProcessor(this, x as QueryCashShopInventory));
            base.RegisterProcessor(typeof(QueryCashShopItemPickUp), (Operation x) => new QueryCashShopItemPickUpProcessor(this, x as QueryCashShopItemPickUp));
            base.RegisterProcessor(typeof(QueryCashShopPurchaseItem), (Operation x) => new QueryCashShopPurchaseItemProcessor(this, x as QueryCashShopPurchaseItem));
            base.RegisterProcessor(typeof(QueryCashShopProductList), (Operation x) => new QueryCashShopProductListProcessor(this, x as QueryCashShopProductList));
            base.RegisterProcessor(typeof(StopCashShop), (Operation x) => new StopCashShopProcessor(this, x as StopCashShop));
            base.RegisterProcessor(typeof(QueryCashShopPurchaseGift), (Operation x) => new QueryCashShopPurchaseGiftProcessor(this, x as QueryCashShopPurchaseGift));
            base.RegisterProcessor(typeof(RequestGoddessProtection), (Operation x) => new RequestGoddessProtectionProcessor(this, x as RequestGoddessProtection));
            base.RegisterProcessor(typeof(DirectPickUp), (Operation x) => new DirectPickUpProcessor(this, x as DirectPickUp));
            base.RegisterProcessor(typeof(QueryCashShopGiftSender), (Operation x) => new QueryCashShopGiftSenderProcessor(this, x as QueryCashShopGiftSender));
            base.RegisterProcessor(typeof(RollbackDirectPickUp), (Operation x) => new RollbackDirectPickUpProcessor(this, x as RollbackDirectPickUp));
            base.RegisterProcessor(typeof(DirectPickUpByProductNo), (Operation x) => new DirectPickUpByProductNoProcessor(this, x as DirectPickUpByProductNo));
            base.RegisterProcessor(typeof(QueryCashShopRefund), (Operation x) => new QueryCashShopRefundProcessor(this, x as QueryCashShopRefund));
            base.RegisterProcessor(typeof(QueryBeautyShopInfo), (Operation x) => new QueryBeautyShopInfoProcessor(this, x as QueryBeautyShopInfo));
            base.RegisterProcessor(typeof(QueryCashShopProductInfo), (Operation x) => new QueryCashShopProductInfoProcessor(this, x as QueryCashShopProductInfo));
            base.RegisterProcessor(typeof(QueryCashShopProductInfoByCashShopKey), (Operation x) => new QueryCashShopProductInfoByCashShopKeyProcessor(this, x as QueryCashShopProductInfoByCashShopKey));
            base.RegisterProcessor(typeof(WishListSelect), (Operation x) => new WishListSelectProcessor(this, x as WishListSelect));
            base.RegisterProcessor(typeof(WishListInsert), (Operation x) => new WishListInsertProcessor(this, x as WishListInsert));
            base.RegisterProcessor(typeof(WishListDelete), (Operation x) => new WishListDeleteProcessor(this, x as WishListDelete));
            this.IsCashShopStopped = false;
            ServiceCore.FeatureMatrix.GetString("");
            this.IsCashShopServiceUseable = (ServiceCore.FeatureMatrix.LangTag != "KO-KR-X-DEV");
            string text = ServiceCore.FeatureMatrix.GetString("NISMSEncodingType");

            if (text == "")
            {
                text = "Default";
                Log <CashShopService> .Logger.WarnFormat("can't find NISMSEncodingType feature. EncodingType will set {0} type.", text);
            }
            this.Connection = new Connection(text);
            this.Connection.CategoryArrayChanged += this.Connection_CategoryArrayChanged;
            this.Connection.ProductArrayChanged  += this.Connection_ProductArrayChanged;
            this.Connection.Disconnected         += delegate(object sender, EventArgs e)
            {
                Log <CashShopService> .Logger.Fatal("CashShop Disconnected!");

                if (this.IsCashShopServiceUseable)
                {
                    Scheduler.Schedule(base.Thread, Job.Create <bool>(new Action <bool>(this.connectToCashShop), true), 60000);
                }
            };
            this.Connection.ConnectionFail += delegate(object sender, EventArgs <Exception> e)
            {
                Log <CashShopService> .Logger.Fatal("CashShop Connection Failed...");

                Scheduler.Schedule(base.Thread, Job.Create <bool>(new Action <bool>(this.connectToCashShop), true), 60000);
            };
            this.Connection.ConnectionSucceed += delegate(object sender, EventArgs e)
            {
                Log <CashShopService> .Logger.Info("CashShop Connected.");

                this.IsCashShopServiceUseable = true;
            };
            Scheduler.Schedule(base.Thread, Job.Create <bool>(new Action <bool>(this.connectToCashShop), false), 0);
            if (ServiceCore.FeatureMatrix.IsEnable("BeautyShopItemSyncNISMS"))
            {
                try
                {
                    string cashShopType = ServiceCore.FeatureMatrix.GetString("LanguageTag");
                    this.CustomizeCouponInfoList = (from x in HeroesContentsLoader.GetTable <CustomizeItemInfo>()
                                                    where (x.Weight == -1 || x.Weight == -2) && (x.CashShopType ?? cashShopType) == cashShopType
                                                    select x).ToList <CustomizeItemInfo>();
                    foreach (CustomizeItemInfo customizeItemInfo in this.CustomizeCouponInfoList)
                    {
                        BeautyShopCouponListElement item = new BeautyShopCouponListElement(customizeItemInfo.Category, customizeItemInfo.ItemClass, customizeItemInfo.Weight);
                        this.BeautyShopCouponList.Add(item);
                    }
                    this.ItemClassInfoDic = (from x in HeroesContentsLoader.GetTable <ItemClassInfo>()
                                             where ServiceCore.FeatureMatrix.IsEnable(x.Feature)
                                             select x).ToDictionary_OverwriteDuplicated((ItemClassInfo x) => x.ItemClass);
                }
                catch (Exception ex)
                {
                    Log <CashShopService> .Logger.Error(ex);
                }
            }
            WishListManager function = new WishListManager(this);

            base.RegisterFunction <WishListManager>(function);
        }