Esempio n. 1
0
        protected void Application_End()
        {
            InitService initService_ =
                __singleton <InitService> ._instance();

            initService_._runExit();
        }
Esempio n. 2
0
        private async Task OnClientReadyAsync()
        {
            InternalStatistics.IncrementEvent("Ready");

            await InitService.InitAsync();

            await SetActivityAsync();
        }
Esempio n. 3
0
 public void sendOffsetToServer()
 {
     if (xOffset != 0 || zOffset != 0)
     {
         InitService.GetInstance().NotifyClientOperations(Command.Move, xOffset + "_" + zOffset);
         resetOffset();
     }
 }
Esempio n. 4
0
        public override void OnEnter()
        {
            base.OnEnter();
            InitService service = _ctx.QueryService <InitService>(InitService.Name);
            SMActor     actor   = service.SMActor;

            actor.LoadScene(_name);
        }
Esempio n. 5
0
        public void handshake(uint session, SprotoTypeBase responseObj, object ud)
        {
            InitService service = _ctx.QueryService <InitService>(InitService.Name);

            if (service != null)
            {
                service.OnRspHandshake(responseObj);
            }
        }
Esempio n. 6
0
        public void handshake(uint session, SprotoTypeBase responseObj)
        {
            InitService service = (InitService)_ctx.QueryService("init");

            if (service != null)
            {
                service.Handshake(responseObj);
            }
        }
 protected void InitializeDb(string connectionString, string dbFile = null, string dbTag = null)
 {
     ConnStr = connectionString;
     InitDb(dbFile, dbTag);
     if (ServiceProvider != null)
     {
         InitService.InitServices(ServiceProvider);
     }
 }
Esempio n. 8
0
    public static InitService GetInstance()
    {
        if (ins == null)
        {
            ins = new InitService();
            ins.init();
        }

        return(ins);
    }
Esempio n. 9
0
        public override void OnEnter()
        {
            base.OnEnter();
            if (_service == null)
            {
                _service = _ctx.QueryService <InitService>(InitService.Name);
            }
            SMActor actor = _service.SMActor;

            actor.LoadScene(_name);
        }
Esempio n. 10
0
        public override void OnEnter()
        {
            base.OnEnter();
            InitService service = (InitService)_ctx.QueryService("init");

            if (service != null)
            {
                SMActor actor = service.SMActor;
                actor.LoadScene("game");
            }
        }
Esempio n. 11
0
        public void FetchSysmail(SprotoTypeBase responseObj)
        {
            EntityMgr mgr = ((AppContext)_ctx).GetEntityMgr();

            mgr.MyEntity.GetComponent <UComSysInbox>().FetchSysmail(responseObj);
            C2sSprotoType.fetchsysmail.response obj = responseObj as C2sSprotoType.fetchsysmail.response;
            if (_service == null)
            {
                _service = _ctx.QueryService <InitService>(InitService.Name);
            }
        }
Esempio n. 12
0
        public override void OnEnter()
        {
            base.OnEnter();

            InitService service = _ctx.QueryService <InitService>(InitService.Name);

            if (service != null)
            {
                SMActor actor = service.SMActor;
                actor.LoadScene("login");
            }
        }
Esempio n. 13
0
        public GrillBotService(IServiceProvider services, DiscordSocketClient client, CommandService commands, IOptions <Configuration> config,
                               CalledEventStats calledEventStats, InitService initService)
        {
            Services         = services;
            Client           = client;
            Commands         = commands;
            Config           = config.Value;
            CalledEventStats = calledEventStats;
            InitService      = initService;

            Client.Ready += OnClientReadyAsync;
        }
Esempio n. 14
0
 public InitController(
     DeptService deptService,
     ProjService projService,
     UserService userService,
     InitService initService
     )
 {
     _deptService = deptService;
     _projService = projService;
     _userService = userService;
     _initService = initService;
 }
Esempio n. 15
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, InitService initService)
        {
            app.UseResponseBuffering();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseMvc();

            initService.LoadData(env.IsDevelopment() ? @"d:\tmp\data" : "/tmp/data");
        }
Esempio n. 16
0
        public GrillBotService(IServiceProvider services, DiscordSocketClient client, CommandService commands, IOptions <Configuration> config,
                               InternalStatistics internalStatistics, InitService initService, ILogger <GrillBotService> logger)
        {
            Services           = services;
            Client             = client;
            Commands           = commands;
            Config             = config.Value;
            InternalStatistics = internalStatistics;
            InitService        = initService;
            Logger             = logger;

            Client.Ready += OnClientReadyAsync;
        }
Esempio n. 17
0
        public GrillBotService(IServiceProvider services, DiscordSocketClient client, CommandService commands, InternalStatistics internalStatistics,
                               InitService initService, BotState botState, ConfigurationService configurationService)
        {
            Services             = services;
            Client               = client;
            Commands             = commands;
            InternalStatistics   = internalStatistics;
            InitService          = initService;
            BotState             = botState;
            ConfigurationService = configurationService;

            Client.Ready += OnClientReadyAsync;
        }
Esempio n. 18
0
        public void Configuration(IAppBuilder app)
        {
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath          = new PathString("/Account/Login"),
            });

            Task.Run(async() =>
            {
                IInitContract initDB = new InitService(NinjectDependency.CreateKernel());
                await initDB.FirstDBInitializationAsync();
            });
        }
Esempio n. 19
0
        internal void Run()
        {
            // init some data
            InitService.Init();

            //1. The count of all students.
            var allStudentsCount = this.GetAllStudentsCount();

            Console.WriteLine($"All students count is {allStudentsCount}");

            //2. The names of students for a specific discipline.
            Console.WriteLine();
            Console.WriteLine("*******English students*******");
            var englishStudentsList = this.GetAllStudentsByDisciplineName(DisciplineType.English);

            foreach (var student in englishStudentsList)
            {
                Console.WriteLine($"{student.Name} {student.Surname}");
            }

            Console.WriteLine();
            Console.WriteLine("*******C# students*******");
            var cSharpStudentsList = this.GetAllStudentsByDisciplineName(DisciplineType.CSharp);

            foreach (var student in cSharpStudentsList)
            {
                Console.WriteLine($"{student.Name} {student.Surname}");
            }

            //3. The lesson with the earliest start date.
            Console.WriteLine();
            var earliestLessons = this.GetEarliestLesson();

            foreach (var lesson in earliestLessons)
            {
                Console.WriteLine($"The earliest lesson is {lesson.Name}");
            }

            //4. The names of lecturers which teach the discipline which has the maximum number of students.
            //5. The names of students for a discipline which has the maximum number of students.
            //6. The name of the discipline with the lesson which has the earliest start date.
            //7. The name of the student who participates in the maximum number of disciplines.
            //8. The pairs of student name and discipline name(students are assigned to discipline).

            //9. The names of disciplines sorted by the number of students assigned to the discipline.
            //10. The names of all students which age is less than 30.
        }
Esempio n. 20
0
        public override void OnEnter()
        {
            base.OnEnter();
            InitService service = _ctx.QueryService <InitService>(InitService.Name);

            service.SMActor.LoadScene("World");

            _systems.Initialize();

            // udp sync
            Modules.BattleScene m = _ctx.U.GetModule <Modules.BattleScene>();
            long   session        = m.Session;
            string host           = m.UdpHost;
            int    port           = (int)m.UdpPort;

            _ctx.UdpAuth(session, host, port);
        }
Esempio n. 21
0
        void _runPreinit()
        {
            string      systemPath_  = HostingEnvironment.MapPath(@"~");
            InitService initService_ =
                __singleton <InitService> ._instance();

            initService_._runPreinit();

            AccountService accountService_ =
                __singleton <AccountService> ._instance();

            accountService_._runPreinit();

            MoneyService moneyService_ =
                __singleton <MoneyService> ._instance();

            moneyService_._runPreinit();
        }
Esempio n. 22
0
        private void ExecuteLoadedCmd()
        {
            //写注册表
            bool isSdSuccess = RegeditHelper.SetRegedit("Sd", "MjAxOS0wOC0zMQ==");
            bool isStSuccess = RegeditHelper.SetRegedit("St", "bm9ybWFs");

            if (!isSdSuccess || !isStSuccess)
            {
                MessageBox.Show("权限不足,请使用管理员权限运行程序");
                return;
            }

            string dbName = "data.sqlite";

            if (!File.Exists(dbName))
            {
                Console.WriteLine("数据库不存在");
                int result = InitService.GetService().InitDatabase(dbName);
                if (result < 0)
                {
                    Console.WriteLine("创建出错");
                }
                else
                {
                    Console.WriteLine("创建成功:{0}", result);
                }
            }

            //判断最后一次任务是否有未查看的异常项目
            int lastTaskId = TaskService.GetService().GetLastTaskId();

            if (lastTaskId >= 0)
            {
                //判断本次任务是否有未查看的任务
                int videoNotWatched = AbnormalService.GetService().SearchLastTaskById(lastTaskId);
                if (videoNotWatched > 0)
                {
                    //存在未观看项目
                    //通过消息机制弹出提示
                    Messenger.Default.Send(videoNotWatched, "videoNotWatched");
                }
            }
        }
Esempio n. 23
0
        private void ExecuteLoadedCmd()
        {
            log.Info("program begin");
            string dbName = "data.sqlite";

            if (!File.Exists(dbName))
            {
                int result = InitService.GetService().InitDatabase(dbName);
                if (result < 0)
                {
                    Debug.WriteLine("创建出错");
                    log.Error("database create failed");
                }
                else
                {
                    Debug.WriteLine("创建成功:{0}", result);
                    log.Info("database create successfully");
                }
            }
        }
Esempio n. 24
0
        protected void InitServer(Action <IServiceCollection> configure = null)
        {
            Action <IServiceCollection> methodConfigure = ConfigureServices;
            var configureDelegate = (Action <IServiceCollection>)Delegate.Combine(methodConfigure, configure);

            var builder = new WebHostBuilder()
                          .UseContentRoot(_contentRoot)
                          .UseConfiguration(Configuration)
                          .UseEnvironment("UnitTest")
                          .UseStartup(typeof(DefaultStartup))
                          .UseSerilog()
                          .ConfigureTestServices(configureDelegate);

            _server = new TestServer(builder);

            Client             = _server.CreateClient();
            Client.BaseAddress = new Uri("http://localhost");
            ServiceProvider    = _server.Host.Services;

            InitService.InitServices(ServiceProvider);
        }
Esempio n. 25
0
        public static void Main(string[] args)
        {
            //删除rabbitMQ积压的数据
            WxPopJob.DeleteQueue();
            Console.WriteLine("删除rabbitMQ积压的数据");
            InitService initService = new InitService();

            //移除在线用户
            initService.InitOnline();
            //重启时,更新所有 userid-codeList的缓存
            initService.CreateUserIdCodeListCache();
            Console.WriteLine("更新所有 userid-codeList的缓存---完毕");
            Console.WriteLine("主进程开始..");
            LogWrite.WriteLogInfo("主进程开始");

            var url = Config.GetValue("SignalRUrl");

            LogWrite.WriteLogInfo($"服务地址{url}");
            Console.WriteLine($"服务地址{url}");
            using (WebApp.Start(url))
            {
                try
                {
                    LogWrite.WriteLogInfo("服务端口开启成功");
                    Console.WriteLine("服务端口开启成功");
                    QuartzJob();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    LogWrite.WriteLogError(e);
                }
                finally
                {
                    Console.ReadKey();
                }
            }
        }
Esempio n. 26
0
    //public void NotifySynOperations(MemoryStream stream)
    //{
    //MessageNotifySyncOperations res = MessageNotifySyncOperations.Parser.ParseFrom(stream);
    //foreach (var item in res.PlayerOperations)
    //{
    //    if(!playerDic.ContainsKey(item.PlayerId))
    //    {
    //        GameObject obj = Resources.Load("Sphere") as GameObject;
    //        obj = GameObject.Instantiate(obj);
    //        obj.transform.parent = gameObject.transform.parent;
    //        obj.name = item.PlayerId;
    //        obj.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
    //        obj.transform.localPosition = new Vector3(0, 0.05f, 0);
    //        playerDic.Add(item.PlayerId, obj);
    //    }
    //    playerDic[item.PlayerId].transform.Translate(new Vector3(item.XOffset, 0, item.ZOffset));
    //    Debug.Log("同步 " + item.PlayerId + " 位置:" + item.XOffset + "  " + item.ZOffset);
    //}

    //}

    public void onClickDirectionBtn(string direction)
    {
        InitService.GetInstance().NotifyClientOperations(Command.Move, direction);
    }
Esempio n. 27
0
 private async Task OnClientReadyAsync()
 {
     InternalStatistics.IncrementEvent("Ready");
     await InitService.InitAsync().ConfigureAwait(false);
 }
Esempio n. 28
0
        public void _runInit()
        {
            InitService initService_ = __singleton <InitService> ._instance();

            initService_.m_tRunSave += this._saveStatusOption;
        }
Esempio n. 29
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     InitService.InitDefaultCampaign();
 }
Esempio n. 30
0
 protected void sendHeartBeat()
 {
     InitService.GetInstance().sendHeartBeat();
 }