static int HasNewVersion(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); GameUpdater obj = (GameUpdater)ToLua.CheckObject(L, 1, typeof(GameUpdater)); System.Action <bool> arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (System.Action <bool>)ToLua.CheckObject(L, 2, typeof(System.Action <bool>)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(System.Action <bool>), func) as System.Action <bool>; } obj.HasNewVersion(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void OnEnable() { this.updater = (GameUpdater)target; this.updater.UpdateStarted += OnUpdateStarted; this.updater.UpdateCompleted += OnUpdateCompleted; this.updater.UpdateProgress += OnUpdateProgress; }
public void Apply() { GameUpdater gameUpdater = GameObject.Find("Updater").GetComponent <GameUpdater>(); if (isPlay == false) { GameObject applySkill = (GameObject)GameObject.Instantiate(ApplySkill); applySkill.transform.localScale = new Vector3(1, 1, 1); applySkill.transform.parent = gameUpdater.World.transform; Transform audio = applySkill.transform.Find("Audio"); if (audio != null) { audio.parent = Camera.main.transform; audio.transform.localPosition = new Vector3(0, 0, 0); } applySkill.transform.position = target.transform.position; applySkill.GetComponent <ParticleAutoDestroy>().SetSkillInfo(this); ApplySkill = applySkill; isPlay = true; } isPlay = true; }
// Use this for initialization void Awake() { instance = this; updater = GameUpdater.instance; updater.JustLoadLocalVersionFile("publish/vc", "password"); DontDestroyOnLoad(this.gameObject); }
// Use this for initialization void Start() { depthManager = gameObject.transform.Find("Sprite").GetComponentInChildren <DepthManager>(); appliedSkillList = new List <SkillInfo>(); gameUpdater = GameObject.Find("Updater").transform.GetComponent <GameUpdater>(); GameObject UI_Root = GameObject.Find("UI Root"); UICam = UI_Root.transform.Find("Camera(UI)").GetComponent <Camera>(); TopLeftAnchor = UI_Root.transform.Find("TopLeftAnchor").gameObject; TopRightAnchor = UI_Root.transform.Find("TopRightAnchor").gameObject; GameObject BottonRightAnchor = UI_Root.transform.Find("BottonRightAnchor").gameObject; GameObject MaxSpawnPosY = UI_Root.transform.Find("MaxSpawnPosY").gameObject; RandomPosY = Random.Range(BottonRightAnchor.transform.position.y, MaxSpawnPosY.transform.position.y); gameObject.transform.position = new Vector3(BottonRightAnchor.transform.position.x, RandomPosY, gameObject.transform.position.z); gameObject.transform.localPosition = new Vector3(gameObject.transform.localPosition.x, gameObject.transform.localPosition.y, -1); animation = gameObject.transform.Find("Sprite").GetComponentInChildren <Animation>(); skillEffectSystem = GameObject.Find("Updater").transform.Find("SkillEffectSystem").GetComponent <SkillEffectSystem>(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } // リバースプロキシ対応 app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); app.UseStaticFiles(); // CORSを有効にする app.UseCors(builder => builder .WithOrigins("http://localhost:8080", "http://127.0.0.1:8080", "https://sangoku.kmycode.net", "https://sangokukmy-legacy.netlify.com") .AllowAnyMethod() .AllowAnyHeader() .WithExposedHeaders("WWW-Authenticate")); // データベースの初期化 using (var context = new MainContext()) { context.Database.Migrate(); } // 更新処理を開始する MlService.Logger = _logger; GameUpdater.BeginUpdate(_logger); OnlineService.BeginWatch(_logger); app.UseMvc(); }
private void Verify_Click(object sender, RoutedEventArgs e) { string torrentUrl; if (!GameUpdater.HttpGet("http://www.zombies.nu/dayzerotorrent.txt", out torrentUrl)) { InfoPopup popup = new InfoPopup(); popup.Headline.Content = "An Error occured."; popup.Message.Content = "Could not contact Zombies.nu.\nPlease try again."; popup.Owner = popup.Owner = MainWindow.GetWindow(this.Parent); popup.Title = "Error"; popup.Show(); return; } else { TorrentState state = TorrentUpdater.CurrentState(); if (state == TorrentState.Stopped) { TorrentUpdater verifier = new TorrentUpdater(torrentUrl); // Sets up launcher to start checking files. verifier.StartTorrents(1); } FileVerifierPopup popup = new FileVerifierPopup(); popup.Owner = MainWindow.GetWindow(this.Parent); popup.Headline.Content = "Please Wait"; popup.Title = "Please Wait"; popup.Show(); } }
/// <summary> /// Happens when the window is closing /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="cancelEventArgs"> /// The cancel event args. /// </param> private void OnClosing(object sender, CancelEventArgs cancelEventArgs) { if (WindowManager.PlayWindow != null) { WindowManager.PlayWindow.Activate(); if (!WindowManager.PlayWindow.TryClose()) { cancelEventArgs.Cancel = true; return; } } if (WindowManager.DeckEditor != null) { WindowManager.DeckEditor.Activate(); if (!WindowManager.DeckEditor.TryClose()) { cancelEventArgs.Cancel = true; return; } } Program.LobbyClient.Disconnected -= LobbyClient_Disconnected; Program.LobbyClient.Connected -= LobbyClient_Connected; Program.LobbyClient.Connecting -= LobbyClient_Connecting; Program.LobbyClient.Stats().StatsModuleUpdate -= LobbyClient_StatsModuleUpdate; Program.LobbyClient.Stop(); GameUpdater.Get().Dispose(); Task.Factory.StartNew(Program.Exit); }
public FormLauncher() { InitializeComponent(); buttonLaunch.Text = Localization.GetText("Launcher.Button.Launch"); buttonQuit.Text = Localization.GetText("Launcher.Button.Quit"); groupBoxChangelog.Text = Localization.GetText("Launcher.Label.Changelog"); Text = LauncherSetup.LAUNCHER_UI_TITLE; foreach (var link in LauncherSetup.LauncherLinks) { try { flowLayoutPanelLinks.Controls.Add(link); } catch { } } labelLauncherVersion.Text = $"{Localization.GetText("Launcher.Label.LauncherVersion")}: {Application.ProductVersion}"; buttonLaunch.Enabled = false; updater = new GameUpdater(); updater.StatusUpdate += Updater_StatusUpdate; updater.ChangelogLoaded += Updater_ChangelogLoaded; updater.GameVersionDetected += Updater_GameVersionDetected; updater.ProgressUpdate += Updater_ProgressUpdate; updater.UpdateFinished += Updater_UpdateFinished; updater.UpdateFailed += Updater_UpdateFailed; updater.Start(); }
public TDGame() { MainGame = this; this.IsMouseVisible = true; graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; env = new GameUpdater(); Components.Add(env); startScreen = MenuScreen.makeStartScreen(); Components.Add(startScreen); deathScreen = MenuScreen.makeDeathScreen(); Components.Add(deathScreen); winScreen = MenuScreen.makeWinScreen(); Components.Add(winScreen); achievementsViewer = MenuScreen.makeAchievementsScreen(env); Components.Add(achievementsViewer); setActiveComponent(startScreen); }
public UpdateWindow(string gameTitle, string optionalGameVersion, string optionalUpdateURL) : base(WindowType.Toplevel) { m_updater = new GameUpdater(gameTitle, optionalGameVersion, optionalUpdateURL); m_updater.StageChanged += OnStageChanged; m_updater.ProgressChanged += OnProgressChanged; m_updater.PromptChanged += OnPromptChanged; Build(); }
public void Setup() { var versionProvider = new VersionProvider(new RestClient(), TestHelpers.GetTestDataFolder("TestData/Version.json")); gameUpdater = new GameUpdater(new RestClient("http://local.host.com"), TestHelpers.GetTestDataFolder("updates"), versionProvider); }
/// <summary> /// Happens when the window is closing /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="cancelEventArgs"> /// The cancel event args. /// </param> private void OnClosing(object sender, CancelEventArgs cancelEventArgs) { SubscriptionModule.Get().IsSubbedChanged -= this.Main_IsSubbedChanged; Program.LobbyClient.Stop(); GameUpdater.Get().Stop(); GameUpdater.Get().Dispose(); Task.Factory.StartNew(Program.Exit); }
public UpdateForm(string gameTitle, string optionalGameVersion, string optionalUpdateURL) { m_updater = new GameUpdater(gameTitle, optionalGameVersion, optionalUpdateURL); m_updater.StageChanged += OnStageChanged; m_updater.StageChanged += OnProgressChanged; m_updater.ProgressChanged += OnProgressChanged; m_updater.PromptChanged += OnPromptChanged; Build(); }
public static MenuScreen makeAchievementsScreen(GameUpdater env) { MenuScreen output; output = new MenuScreen(MenuScreenType.Achievements); output.env = env; return output; }
public NextWaveButton(GameUpdater env, int width, int height, SpriteFont font) : base(width, height, font) { this.env = env; Vector2 measurement = font.MeasureString(Text); textOffsetX = (int)((width - measurement.X) / 2f); textOffsetY = (int)((height - measurement.Y) / 2f); }
/// <summary> /// Happens when the window is closing /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="cancelEventArgs"> /// The cancel event args. /// </param> private void OnClosing(object sender, CancelEventArgs cancelEventArgs) { Program.LobbyClient.Disconnected -= LobbyClient_Disconnected; Program.LobbyClient.Connected -= LobbyClient_Connected; Program.LobbyClient.Connecting -= LobbyClient_Connecting; Program.LobbyClient.Stats().StatsModuleUpdate -= LobbyClient_StatsModuleUpdate; Program.LobbyClient.Stop(); GameUpdater.Get().Dispose(); Task.Factory.StartNew(Program.Exit); }
// Use this for initialization void Start() { updater = GameObject.Find("Updater").GetComponent <GameUpdater>(); SkillEffectList = new List <SkillEffectInfo>(); SkillEffectInfo[] SkillEffects = gameObject.GetComponentsInChildren <SkillEffectInfo>(); for (int i = 0; i < SkillEffects.Length; ++i) { SkillEffectList.Add(SkillEffects[i]); } }
public PauseButton(GameUpdater env, SpriteFont font, int width, int height) : base(width, height, font) { this.env = env; Vector2 unpausedSize = font.MeasureString(unpausedText); Vector2 pausedSize = font.MeasureString(pausedText); unpausedOffset = new Point((int)((width - unpausedSize.X) / 2), (int)((height - unpausedSize.Y) / 2)); pausedOffset = new Point((int)((width - pausedSize.X) / 2), (int)((height - pausedSize.Y) / 2)); }
// Use this for initialization void Start() { updater = gameObject.AddComponent <GameUpdater>(); updater.CheckIsFirstStart(); downResVersionListAction = new ActionTimeOut(updater.DownloadResVersionList, 5f, IgnoreVersion); compareVersionAction = new ActionTimeOut(updater.CompareVersion, 5f, TimeOut); downMD2Action = new ActionTimeOut(updater.DownloadMD2File, 5f, TimeOut); downMDAction = new ActionTimeOut(updater.DownloadMD, 5, TimeOut); downTipAction = new ActionTimeOut(updater.DownLoadTips, 5, TimeOut); Timer.Instance.Run(downResVersionListAction); }
public void On_KnownGameStatus_ReturnsCorrectUpdater(GameStatus gameStatus, Type expectedUpdater) { // Arrange Mock <IEventAggregator> eventAggregatorMock = new(MockBehavior.Strict); GameUpdateFactory instanceUnderTest = new(eventAggregatorMock.Object); // Act GameUpdater updater = instanceUnderTest.On(gameStatus); // Assert updater.Should().BeOfType(expectedUpdater); }
public ArenaManager(GameUpdater env, int pixelWidth, int pixelHeight) { this.env = env; this.selectedTrapType = TrapType.NoType; this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.arenaTranslation = new Point(0, 0); this.scrollPanel = new ScrollPanel(this, scrollPanelWidth, pixelWidth, pixelHeight); }
public void Setup() { TestHelpers.CleanupTestFolder(); TestHelpers.SetupCultureInfo(); this._restClient = new RestClient("https://s3-eu-west-1.amazonaws.com/helbreath-files/updates/"); var restclientMock = new Mock<RestClient>(); restclientMock.Setup(x => x.Execute(It.IsAny<IRestRequest>())).Returns(new RestResponse { Content = "{ 'version' : 0.4 }" }); this._versionProvider = new VersionProvider(restclientMock.Object, TestHelpers.GetTestDataFolder("TestData/Version.json")); this._gameUpdater = new GameUpdater(_restClient, TestHelpers.GetTestDataFolder("TestData"), this._versionProvider); }
public PlayerHUD(GameUpdater env, int startingMoney = 1000) { this.money = startingMoney; this.env = env; this.health = STARTING_HEALTH; DetailViewType = DetailViewType.TrapPreview; previewX = 0; previewY = TDGame.MediumFont.MeasureString("A\nA\nA").Y + mainYBuffer; //the height of a 3-line string and a buffer setupFixedTraps(); }
static int UpdateVersion(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); GameUpdater obj = (GameUpdater)ToLua.CheckObject(L, 1, typeof(GameUpdater)); obj.UpdateVersion(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public static Menu MakeAchievementMenu(GameUpdater env) { Menu output = new Menu("Achievements"); output.drawPosition.X = 30; output.drawPosition.Y = 10; foreach (Achievements a in Enum.GetValues(typeof(Achievements))) output.addItem(new AchievementItem(a, env, smallFont)); output.addItem(new StartButton("Back to Main Menu", mediumFont)); return output; }
static int OnUpdateDownloadFinished(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); GameUpdater obj = (GameUpdater)ToLua.CheckObject(L, 1, typeof(GameUpdater)); obj.OnUpdateDownloadFinished(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetInstance(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); GameUpdater o = GameUpdater.GetInstance(); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
/// <summary> /// Initializes a new instance of the <see cref="Main"/> class. /// </summary> public Main() { this.InitializeComponent(); #if (Release_Test) this.Title = "OCTGN " + "[Test v" + Const.OctgnVersion + "]"; #endif ConnectBox.Visibility = Visibility.Hidden; Program.LobbyClient.OnStateChanged += this.LobbyClientOnOnStateChanged; Program.LobbyClient.OnLoginComplete += this.LobbyClientOnOnLoginComplete; this.PreviewKeyUp += this.OnPreviewKeyUp; this.Closing += this.OnClosing; GameUpdater.Get().Start(); this.Loaded += OnLoaded; //new GameFeedManager().CheckForUpdates(); }
static int OnUpdateDownloadError(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); GameUpdater obj = (GameUpdater)ToLua.CheckObject(L, 1, typeof(GameUpdater)); UnityEngine.WWW arg0 = (UnityEngine.WWW)ToLua.CheckObject(L, 2, typeof(UnityEngine.WWW)); obj.OnUpdateDownloadError(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int SetUpdateServer(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); GameUpdater obj = (GameUpdater)ToLua.CheckObject(L, 1, typeof(GameUpdater)); int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.SetUpdateServer(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void OpenUpdaterDialog() { PatchHistory patchHistory = PatchHistory.CreatePatchHistoryInstance(latestPatchHistoryPath); if (patchHistory.ID == Parameter.GameClientSettingsInformation.ClientVersionHistory.ID) { Close(DialogResult.No); } else { Hide(); GameUpdater gU = new GameUpdater(patchHistory); Close(gU.ShowDialog()); } }
static int CheckVersionNumber(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); GameUpdater obj = (GameUpdater)ToLua.CheckObject(L, 1, typeof(GameUpdater)); VersionConfig arg0 = (VersionConfig)ToLua.CheckObject(L, 2, typeof(VersionConfig)); VersionConfig arg1 = (VersionConfig)ToLua.CheckObject(L, 3, typeof(VersionConfig)); bool o = obj.CheckVersionNumber(arg0, arg1); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetFileListNeedDownloaded(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); GameUpdater obj = (GameUpdater)ToLua.CheckObject(L, 1, typeof(GameUpdater)); VersionConfig arg0 = (VersionConfig)ToLua.CheckObject(L, 2, typeof(VersionConfig)); VersionConfig arg1 = (VersionConfig)ToLua.CheckObject(L, 3, typeof(VersionConfig)); System.Collections.Generic.List <string> o = obj.GetFileListNeedDownloaded(arg0, arg1); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_UpdateServer(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); GameUpdater obj = (GameUpdater)o; string ret = obj.UpdateServer; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index UpdateServer on a nil value" : e.Message)); } }
/// <summary> /// Happens when the window is closing /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="cancelEventArgs"> /// The cancel event args. /// </param> private void OnClosing(object sender, CancelEventArgs cancelEventArgs) { if (WindowManager.PlayWindow != null) { if (!WindowManager.PlayWindow.TryClose()) { cancelEventArgs.Cancel = true; return; } } SubscriptionModule.Get().IsSubbedChanged -= this.Main_IsSubbedChanged; Program.LobbyClient.OnDisconnect -= LobbyClientOnOnDisconnect; Program.LobbyClient.Stop(); //GameUpdater.Get().Stop(); GameUpdater.Get().Dispose(); Task.Factory.StartNew(Program.Exit); }
static int get_serverName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); GameUpdater obj = (GameUpdater)o; string[] ret = obj.serverName; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index serverName on a nil value" : e.Message)); } }
static int set_serverName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); GameUpdater obj = (GameUpdater)o; string[] arg0 = ToLua.CheckStringArray(L, 2); obj.serverName = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index serverName on a nil value" : e.Message)); } }
static int get_DownloadSpeed(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); GameUpdater obj = (GameUpdater)o; float ret = obj.DownloadSpeed; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index DownloadSpeed on a nil value" : e.Message)); } }
public AchievementItem(Achievements achievement, GameUpdater env, SpriteFont font) : base("A\nA", font) { this.ach = achievement; this.env = env; }