Esempio n. 1
0
        public void ResetOnlineGuildDailyGPScheduleFunc()
        {
            HeroesDataContext  heroesDataContext = new HeroesDataContext();
            List <long>        list = new List <long>(this.OnlineGuildIDList);
            GuildGainGPMessage guildGainGPMessage = new GuildGainGPMessage(0L);

            foreach (long id in list)
            {
                IEntity entityByID = base.GetEntityByID(id);
                if (entityByID != null && !entityByID.IsClosed)
                {
                    GuildEntity guildEntity = entityByID.Tag as GuildEntity;
                    if (entityByID != null)
                    {
                        heroesDataContext.ResetInGameGuildDailyGainGP(guildEntity.GuildSN);
                        guildEntity.GuildInfo.DailyGainGP.Clear();
                        guildGainGPMessage.GuildPoint = guildEntity.GuildInfo.GuildPoint;
                        foreach (OnlineGuildMember onlineGuildMember in guildEntity.OnlineMembers.Values)
                        {
                            onlineGuildMember.RequestFrontendOperation(SendPacket.Create <GuildGainGPMessage>(guildGainGPMessage));
                        }
                    }
                }
            }
            DateTime d = GuildContents.GetPrevDailyGPResetTime() + TimeSpan.FromDays(1.0);

            this.DailyGPResetScheduleID = Scheduler.Schedule(JobProcessor.Current, Job.Create(new Action(this.ResetOnlineGuildDailyGPScheduleFunc)), d - DateTime.UtcNow + TimeSpan.FromSeconds(30.0));
        }
Esempio n. 2
0
		private static void Load()
		{
			GuildContents.GuildLevelUpInfoDic = (from x in HeroesContentsLoader.GetTable<GuildLevelUpInfo>()
			where ServiceCore.FeatureMatrix.IsEnable(x.Feature)
			select x).ToDictionary((GuildLevelUpInfo x) => x.Level, (GuildLevelUpInfo x) => x);
			foreach (GuildLevelUpInfo guildLevelUpInfo in GuildContents.GuildLevelUpInfoDic.Values)
			{
				guildLevelUpInfo.RequiredExp *= 10L;
			}
			GuildContents.LoadGuildDailyGPLimit();
			if (ServiceCore.FeatureMatrix.IsEnable("GuildHeroesCore_v1"))
			{
				GuildContents.LoadGuildForbiddenWords();
				return;
			}
			Log<GuildContents>.Logger.WarnFormat("doesn't need to load GuildForbiddenWords while using PlatformAPI(GuildHeroesCore_v1 feautre is off).", new object[0]);
		}
Esempio n. 3
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();
        }
Esempio n. 4
0
		static GuildContents()
		{
			GuildContents.Load();
			HeroesContentsLoader.DB3Changed += GuildContents.Load;
			GuildContents.LoadGuildDailyGPResetTime();
		}