public void BurnGaugeBroadcast()
 {
     using (BurnDataContext burnDataContext = new BurnDataContext())
     {
         try
         {
             int         num         = burnDataContext.AddAllUserEventCount(new int?(-99), new int?(0), new DateTime?(DateTime.MaxValue));
             BurnJackpot burnJackpot = MMOChannelContents.GetBurnJackpot();
             if (burnJackpot != null)
             {
                 if (this.LatestBurnGauge != num)
                 {
                     this.LatestBurnGauge = num;
                     foreach (KeyValuePair <long, Channel> keyValuePair in this.channels)
                     {
                         Channel       value   = keyValuePair.Value;
                         PacketMessage message = new PacketMessage
                         {
                             Data = SerializeWriter.ToBinary <ServiceCore.EndPointNetwork.BurnGauge>(new ServiceCore.EndPointNetwork.BurnGauge(num, burnJackpot.JackpotStart, burnJackpot.MaxReward))
                         };
                         value.BroadcastToColhenLobby(message);
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             Log <MMOChannelService> .Logger.Error("burn gauge broadcasting error", ex);
         }
     }
 }
        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);
            }
        }
Exemple #3
0
 static MMOChannelContents()
 {
     MMOChannelContents.Load();
     HeroesContentsLoader.DB3Changed += MMOChannelContents.Load;
 }