protected void Application_End() { InitService initService_ = __singleton <InitService> ._instance(); initService_._runExit(); }
private async Task OnClientReadyAsync() { InternalStatistics.IncrementEvent("Ready"); await InitService.InitAsync(); await SetActivityAsync(); }
public void sendOffsetToServer() { if (xOffset != 0 || zOffset != 0) { InitService.GetInstance().NotifyClientOperations(Command.Move, xOffset + "_" + zOffset); resetOffset(); } }
public override void OnEnter() { base.OnEnter(); InitService service = _ctx.QueryService <InitService>(InitService.Name); SMActor actor = service.SMActor; actor.LoadScene(_name); }
public void handshake(uint session, SprotoTypeBase responseObj, object ud) { InitService service = _ctx.QueryService <InitService>(InitService.Name); if (service != null) { service.OnRspHandshake(responseObj); } }
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); } }
public static InitService GetInstance() { if (ins == null) { ins = new InitService(); ins.init(); } return(ins); }
public override void OnEnter() { base.OnEnter(); if (_service == null) { _service = _ctx.QueryService <InitService>(InitService.Name); } SMActor actor = _service.SMActor; actor.LoadScene(_name); }
public override void OnEnter() { base.OnEnter(); InitService service = (InitService)_ctx.QueryService("init"); if (service != null) { SMActor actor = service.SMActor; actor.LoadScene("game"); } }
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); } }
public override void OnEnter() { base.OnEnter(); InitService service = _ctx.QueryService <InitService>(InitService.Name); if (service != null) { SMActor actor = service.SMActor; actor.LoadScene("login"); } }
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; }
public InitController( DeptService deptService, ProjService projService, UserService userService, InitService initService ) { _deptService = deptService; _projService = projService; _userService = userService; _initService = initService; }
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"); }
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; }
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; }
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(); }); }
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. }
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); }
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(); }
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"); } } }
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"); } } }
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); }
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(); } } }
//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); }
private async Task OnClientReadyAsync() { InternalStatistics.IncrementEvent("Ready"); await InitService.InitAsync().ConfigureAwait(false); }
public void _runInit() { InitService initService_ = __singleton <InitService> ._instance(); initService_.m_tRunSave += this._saveStatusOption; }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); InitService.InitDefaultCampaign(); }
protected void sendHeartBeat() { InitService.GetInstance().sendHeartBeat(); }