private static IGameObject CreateObjectWithOverrides(ulong instance, ProductVersion version, Vector3 initPos, int level, Vector3 initFwd, Hashtable overrides, Simulator.ObjectInitParameters initData) { GlobalFunctions.FillInInitData(initPos, level, initFwd, ref initData); IGameObject createdObject = CreateObjectInternal(instance, version, overrides, initData); GlobalFunctions.CheckForFailure(createdObject, "Missing object resource instance " + instance + Common.NewLine); return createdObject; }
public static string GetLocalizedName(ProductVersion value) { string entryKey = null; if (value != ProductVersion.BaseGame) { string str3 = value.ToString(); if (str3.Length == 0x3) { str3 = str3.Replace("P", "P0"); } entryKey = "Engine:Caption" + str3; } else { entryKey = "Ui/Caption/BuildBuy/CatalogProductFilter:BaseGame"; } return Common.LocalizeEAString(entryKey); }
public static IGameObject CreateObject(ulong instance, ProductVersion version, Simulator.ObjectInitParameters initData) { Hashtable overrides = new Hashtable(0x1); IGameObject obj = null; try { obj = CreateObjectWithOverrides(instance, version, Vector3.OutOfWorld, 0, Vector3.UnitZ, overrides, initData); if (obj is FailureObject) { Common.DebugNotify((obj as FailureObject).mErrorText); } } catch (NullReferenceException exception) { string str = "Instance name was " + instance + Common.NewLine; throw new NullReferenceException(exception.Message + str); } return obj; }
public static IGameObject CreateObject(ulong instance, ProductVersion version, Simulator.ObjectInitParameters initData) { Hashtable overrides = new Hashtable(0x1); IGameObject obj = null; try { obj = CreateObjectWithOverrides(instance, version, Vector3.OutOfWorld, 0, Vector3.UnitZ, overrides, initData); if (obj is FailureObject) { Common.DebugNotify((obj as FailureObject).mErrorText); } } catch (NullReferenceException exception) { string str = "Instance name was " + instance + Common.NewLine; throw new NullReferenceException(exception.Message + str); } return(obj); }
protected override void OnLoad(EventArgs e) { this.Text = "ReoGrid Demo " + ProductVersion.ToString(); string rootCategory = unvell.ReoGrid.Demo.Properties.Resources.DemoCategory; using (var sr = new System.IO.StringReader(rootCategory)) { demoFile = (DemoFile)xmlSerializer.Deserialize(sr) as DemoFile; } if (demoFile == null) { MessageBox.Show("Cannot read demo category file correctly. Please redownload the program."); Close(); return; } tree.BeforeExpand += tree_BeforeExpand; tree.AfterSelect += tree_AfterSelect; LoadAllItems(); var dummyGrid = new ReoGridControl(); this.labTitle.Text = dummyGrid.ProductName + " " + dummyGrid.ProductVersion.ToString(); web.Visible = false; // load default demo item if (!string.IsNullOrEmpty(demoFile.defaultItem)) { var demoItem = FindDemoItemByName(demoFile, demoFile.defaultItem); if (demoItem != null) { this.currentItem = demoItem; LoadDemo(demoItem); } } }
protected void PatchAllDotNetProjectFiles(Settings settings, ProductVersion version) { Log("Patching assembly versions in .csproj files..."); var projectFiles = Directory.EnumerateFiles(".", "*.csproj", SearchOption.AllDirectories); foreach (var projectFile in projectFiles) { Log($" Patching {projectFile} to version {version}"); var xdoc = XDocument.Load(projectFile); var propertyGroupElement = xdoc.Element("Project").Elements("PropertyGroup").First(x => !x.HasAttributes); if (propertyGroupElement == null) { propertyGroupElement = new XElement("PropertyGroup"); xdoc.Add(propertyGroupElement); } void PatchOrAddElement(string name, string value) { var element = propertyGroupElement.Element(name); if (element == null) { element = new XElement(name); propertyGroupElement.Add(element); } element.Value = value; } PatchOrAddElement("Version", version.ToString()); PatchOrAddElement("AssemblyVersion", $"{version.RoundToMajor}"); PatchOrAddElement("FileVersion", $"{version}.0"); PatchOrAddElement("InformationalVersion", version.ToString()); xdoc.Save(projectFile); } }
protected override void OnLoad(EventArgs e) { this.Text = "ReoGrid デモプログラム " + ProductVersion.ToString(); string rootCategory = DemoJP.Properties.Resources.DemoCategory; using (var sr = new System.IO.StringReader(rootCategory)) { demoCategoryFile = (DemoFile)xmlSerializer.Deserialize(sr) as DemoFile; } if (demoCategoryFile == null) { MessageBox.Show("カテゴリファイルの読み込みに失敗しました。もう一度ダウンロードして試してください。"); Close(); return; } tree.BeforeExpand += tree_BeforeExpand; tree.AfterSelect += tree_AfterSelect; LoadAllItems(); var dummyGrid = new ReoGridControl(); this.labTitle.Text = dummyGrid.ProductName + " " + dummyGrid.ProductVersion.ToString(); web.Visible = false; // load default demo item if (!string.IsNullOrEmpty(demoCategoryFile.defaultItem)) { var demoItem = FindDemoItemByName(demoCategoryFile, demoCategoryFile.defaultItem); if (demoItem != null) { this.currentItem = demoItem; LoadDemo(demoItem); } } }
/// <summary> /// Setups the gated request. /// </summary> /// <param name="product">The product.</param> /// <param name="productVersion">The product version.</param> /// <param name="market">The market.</param> /// <param name="environment">The environment.</param> /// <param name="app">AppCode.</param> /// <param name="audienceGroup">Audience Group.</param> /// <param name="requestedGates">The requested gates.</param> /// <param name="blockedGates">The blocked gates.</param> /// <returns>Gated Request</returns> private static IGatedRequest SetupGatedRequest(string product, string productVersion, string market, string environment, int app, HashSet <string> audienceGroups = null, HashSet <string> requestedGates = null, HashSet <string> blockedGates = null, HashSet <string> cloudContext = null) { IGatedRequest gatedRequest = new UnitTestGatedRequest() { CallingClient = new GatedClient { Name = product, ProductCode = new ProductCode(product), Version = ProductVersion.Parse(productVersion), AppCode = app.ToString(), AudienceGroups = audienceGroups }, Environment = environment, Market = market, Users = null, RequestedGateIds = requestedGates, BlockedGateIds = blockedGates, CloudContexts = cloudContext }; return(gatedRequest); }
public List <ProductVersion> GetVersions(long productId) { List <ProductVersion> lstVersions = new List <ProductVersion>(); SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["CRMContext"].ConnectionString); con.Open(); SqlCommand cmd = new SqlCommand("spGetVersions", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ProductId", SqlDbType.BigInt).Value = productId; SqlDataReader dr = cmd.ExecuteReader(); ProductVersion versions = null; while (dr.Read()) { versions = new ProductVersion(); versions.VersionName = Convert.ToString(dr["Version"]); versions.VersionId = Convert.ToInt64(dr["VersionId"]); lstVersions.Add(versions); } return(lstVersions); }
private async void CheckClicked(object sender, EventArgs e) { try { var version = await _apiProvider.FindLatestVersion <ProductVersion>(); var thisProduct = new ProductVersion(Settings.VersionNumber); _view.UpdateResult(version, Settings.Api.HostBase, version <= thisProduct); } catch (Exception exception) { _view.ProcessError(exception); SimpleLog.Log(exception); var submitResult = await _apiProvider.SendException(exception); if (!string.IsNullOrWhiteSpace(submitResult)) { SimpleLog.Log("[WebAPI endpoint]: " + submitResult); } } }
private void MainForm_Load(object sender, EventArgs e) { L_AppVersion.Text = $"v {ProductVersion.ToString()}"; MainForm_DesignChanged(FormDesign.Design); lastAddedChars = new Dictionary <TextBox, string>() { { TB_IconPath, string.Empty }, { TB_FolderPath, string.Empty } }; chosenIndex = new Dictionary <TextBox, int>() { { TB_IconPath, 0 }, { TB_FolderPath, 0 } }; if (Directory.Exists("C:\\Icons")) { TBChangeIdentifier.Enable(); TB_IconPath.Text = "C:\\Icons"; TBChangeIdentifier.Disable(); } }
private void InitilizeAssemblies(ProductVersion productVersion, string[] files) { foreach (var file in files) { var directory = Path.GetDirectoryName(file); var xmlFile = Path.Combine(directory, Path.GetFileNameWithoutExtension(file) + ".xml"); XmlDocument doc = new XmlDocument(); doc.Load(xmlFile); var members = doc.SelectNodes("/doc/members/member") .OfType <XmlNode>() .ToDictionary(x => x.Attributes["name"].Value, x => x.SelectSingleNode("summary").InnerText?.Trim()); var types = Assembly.LoadFile(file).GetExportedTypes().Where(x => x.IsPublic) .ToList(); foreach (var type in types) { var typeDescription = GetClassSummary(members, type); var exportedType = new ExportedType { Description = typeDescription, Name = Regex.Replace(type.Name, @"\`\d+", string.Empty), Namespace = type.Namespace }; if (type.IsGenericType) { exportedType.IsGeneric = true; exportedType.GenericParameters = type.GetGenericArguments().Select(x => new ExportedTypeGenericParameter() { Name = Regex.Replace(x.Name, @"\`\d+", string.Empty), Description = GetClassSummary(members, x), ExportedType = exportedType }).ToList(); } productVersion.ExportedTypes.Add(exportedType); InitilizeTypes(type, exportedType, members); } } }
public void UpdateVersion(FullProductDto combined) { var productId = _productVersionRepository.GetAll().ToList(); var sameNameProductVersion = _productVersionRepository.GetMany(x => x.Name.Equals(combined.Name) && x.SoftDelete == false && !Guid.Equals(x.Id, combined.ProductVersionId)); if (sameNameProductVersion.Count() != 0) { throw new BusinessException(ExceptionCode.DuplicateProductNames); } var oldProductVersion = _productVersionRepository.GetByID(combined.ProductVersionId); if (oldProductVersion != null) { var oldProduct = _productRepository.GetByID(oldProductVersion.ProductId); oldProduct.IsInStore = combined.IsInStore; oldProduct.Quantity = combined.Quantity; oldProduct.IsOrderable = combined.IsOrderable; _productRepository.Update(oldProduct); if (IsNewProductVersionNeeded(combined, oldProductVersion)) { oldProductVersion.SoftDelete = true; ProductVersion newProductVersion = new ProductVersion(); newProductVersion.Description = combined.Description; newProductVersion.Cost = combined.Cost; newProductVersion.Created = DateTime.Now; newProductVersion.Name = combined.Name; newProductVersion.ProductId = oldProduct.Id; newProductVersion.UrlImg = combined.UrlImg; newProductVersion.SoftDelete = false; _productVersionRepository.Update(oldProductVersion); _productVersionRepository.Create(newProductVersion); } } }
private void AboutBoxEd_Load(object sender, EventArgs e) { String[] VersionInfo = ProductVersion.Split('.'); String VersionText = "v" + ProductVersion; int VersionDelta = Int32.Parse(VersionInfo[3]); VersionText += " " + "(" + "Build" + " " + VersionInfo[0] + (Int32.Parse(VersionInfo[1]) != 0 ? VersionInfo[1] + "." : "") + ";" + " " + "Rev." + (Int32.Parse(VersionInfo[2]) < 10 ? "0" : "") + VersionInfo[2]; if (VersionDelta >= 100 && VersionDelta < 200) { VersionText += " " + "Milestone"; } else if (VersionDelta >= 200 && VersionDelta < 400) { VersionText += " " + "ALPHA"; } else if (VersionDelta >= 400 && VersionDelta < 800) { VersionText += " " + "BETA"; } else if (VersionDelta >= 800 && VersionDelta < 1337) { VersionText += " " + "Release Candidate"; } else if (VersionDelta >= 1338 && VersionDelta < 2000) { VersionText += " " + "Hotfix"; } else if (VersionDelta >= 2000 && VersionDelta < 9999) { VersionText += " " + "Post-Release Test"; } VersionText += ")"; labelVersion.Text = VersionText; }
public void Create6Issues(int numberOfIssues) { Issue issue = null; Issue priorIssue = null; using (SessionNoServer session = new SessionNoServer(systemDir)) { session.BeginUpdate(); for (int i = 0; i < numberOfIssues; i++) { IssueTracker issueTracker = (IssueTracker)session.Open(IssueTracker.PlaceInDatabase, 1, 1, false); User user = issueTracker.UserSet.Keys[rand.Next(issueTracker.UserSet.Count)]; User assignedTo = issueTracker.UserSet.Keys[rand.Next(issueTracker.UserSet.Count)]; Project project = issueTracker.ProjectSet.Keys[rand.Next(issueTracker.ProjectSet.Count)]; Component component = issueTracker.ComponentSet.Keys[rand.Next(issueTracker.ComponentSet.Count)]; ProductVersion version = issueTracker.VersionSet.Keys[rand.Next(issueTracker.VersionSet.Count)]; Issue.CategoryEnum category = (Issue.CategoryEnum)rand.Next(5); Issue.Resolution resolution = (Issue.Resolution)rand.Next(5); Issue.PriorityEnum priority = (Issue.PriorityEnum)rand.Next(5); Issue.StatusEnum status = (Issue.StatusEnum)rand.Next(5); if (status == Issue.StatusEnum.Open || status == Issue.StatusEnum.InProgress || status == Issue.StatusEnum.Reopened) { resolution = Issue.Resolution.Incomplete; // the other states does not make sense } DateTime dueDate = new DateTime(rand.Next()); string c = "project" + i.ToString(); string s = "summary" + i.ToString(); string e = "environment" + i.ToString(); string d = "idescription" + i.ToString(); issue = new Issue(user, priority, project, category, component, version, resolution, s, d, e, assignedTo, dueDate, null, status); issue.Persist(session, priorIssue == null ? issue : priorIssue); priorIssue = issue; issueTracker.Add(issue); } session.Commit(); } }
/// <summary> /// 组件初始化 /// </summary> private void ComponentInitialize() { CheckForIllegalCrossThreadCalls = false; Text = $"{Text} - Version: {ProductVersion.ToString()}"; // 初始化全局组件集 GlobalContext.Instance.UIContext = new MainUIComponentContext { Center_ListViewNF_MusicList = listView_SongItems, Right_PictureBox_AlbumImage = pictureBox_AlbumImg, Right_TextBox_MusicTitle = textBox_MusicTitle, Right_TextBox_MusicArtist = textBox_MusicArtist, Right_TextBox_MusicAblum = textBox_Ablum, Right_TextBox_MusicBuildInLyric = textBox_BuildInLyric, Top_ToolStrip = toolStrip1, Bottom_StatusStrip = toolStripStatusLabel1, Bottom_ProgressBar = toolStripProgressBar1, Top_ToolStrip_Buttons = BuildToolStripButtons() }; // 加载插件 PluginManager.LoadPlugins(); PluginManager.GetPlugins <IPluginExtensions>().ForEach(x => x.InitializePlugin(PluginManager)); }
/// <summary> /// 处理版本更新事件 /// </summary> /// <param name="version"></param> /// <param name="message"></param> /// <returns></returns> private bool HandleUpdate(ProductVersion version, ref string message) { if (string.IsNullOrEmpty(message)) { message = $"正在更新【{ProductName}】的版本【V{version.Value}】。。。"; } Update versionDetail = null; if (!UpdateTool.GetProductVersionDetail(ProductName, version.Folder, ref versionDetail)) { message = "获取更新明细失败"; return(false); } RetsetProgress(versionDetail.WorkCount); //前期准备 if (!HandleWork("更新前准备工作", version.Folder, versionDetail.Preparation, ref message)) { return(false); } //实际处理 return(HandleWork("处理工作", version.Folder, versionDetail.Handle, ref message) ? HandleWork("更新成功后工作", version.Folder, versionDetail.Success, ref message) : HandleWork("更新失败后回滚工作", version.Folder, versionDetail.Rollback, ref message)); }
private async void Main_Load(object sender = null, EventArgs e = null) { bool success = true; Running = true; await GetImagesFromResources(); Logger.Initialize(); Logger.Log("Super Update: v" + ProductVersion.ToString()); Logger.Log("Developed by: Dylan Bickerstaff (C) 2020"); Logger.Log("Starting Super Update...", LogLevels.Information); success = await CheckForUpdates(); if (!success) { Logger.Log("Something went wrong, press \"More details\" for more details.", LogLevels.Information); Running = false; return; } UpdateSelectEngine upEng = new UpdateSelectEngine(lvDetails); //upEng.Dispose(); Running = false; }
public uHomePage() { InitializeComponent(); VersionLabel.Text = ProductVersion.ToString(); }
/// <summary> /// A new version of the game is available /// </summary> /// <param name="product"></param> void AutoUpdater_NewVersion(ProductVersion product) { MessageBox.Show("New version available !!!"); }
public void Handle(string command, Settings settings) { command = command?.ToLowerInvariant()?.Trim(); if (settings.Verbose || command == "version") { var toolVersion = ProductVersion.FromSystemVersion(Assembly.GetCallingAssembly().GetName().Version); Log($"Release Tool {toolVersion}"); } if (settings.Verbose) { Log(string.Empty); Log("Configuration:"); Log($" ChangeLogFileName = {settings.MarkdownChangeLogFileName}"); Log($" DoNotPrompt = {settings.DoNotPrompt}"); Log($" FirstVersion = {settings.FirstVersion}"); Log($" HtmlChangeLogFileName = {settings.HtmlChangeLogFileName}"); Log($" LatestChangesFileName = {settings.LatestChangesFileName}"); Log($" PatchAssemblyVersions = {settings.PatchAssemblyVersions}"); Log($" ProductName = {settings.ProductName}"); Log($" ReleaseHistoryFileName = {settings.ReleaseHistoryFileName}"); Log($" VersionFileName = {settings.VersionFileName}"); Log($" Verbose = {settings.Verbose}"); Log(string.Empty); } if (string.IsNullOrWhiteSpace(command)) { throw new ErrorException("No command was specified!"); } switch (command) { case "version": break; case "init": new InitCommand(Log).Execute(settings); break; case "prepare": new PrepareCommand(Log).Execute(settings); break; case "thisversion": new ThisVersionCommand(Log).Execute(settings); break; case "nextversion": new NextVersionCommand(Log).Execute(settings); break; case "changelog": new ChangelogCommand(Log).Execute(settings); break; case "fullchangelog": new FullChangelogCommand(Log).Execute(settings); break; default: throw new ErrorException($"Unknown command '{command}'"); } }
public new void MakeLoopCallback(StateMachineClient smc, Interaction <Sim, InventionWorkbench> .LoopData ld) { try { Target.mInventionProgress += ld.mDeltaTime / mTotalTime; if (Target.mInventionProgress >= 1f) { AddSynchronousOneShotScriptEventHandler(0x65, new SacsEventHandler(OnAnimationEvent)); AnimateSim("Swipe"); if (mMakeMany) { if (!Target.ConsumeScrap(mCurData.GetScrapCost(Actor, mIsCheapToy), Actor)) { ShowOutOfScrapTNS(); Actor.AddExitReason(ExitReason.Finished); } else { AddSynchronousOneShotScriptEventHandler(0x67, new SacsEventHandler(OnAnimationEvent)); SetParameter("skillLevel", InventionWorkbench.GetSkillLevelParam(mInventSkill)); AnimateSim("Loop Invent"); mFinalModelShown = false; mTimeUntilModelSwap = GetTimeForNextModelChange(); } } else { Actor.AddExitReason(ExitReason.Finished); } } else if (!mFinalModelShown) { if (Target.mInventionProgress >= InventionWorkbench.kShowFinalModelPercent) { string miniModelName = mCurData.MiniModelName; ProductVersion prodVersion = mCurData.ProdVersion; Slot finalModelSlot = mCurData.FinalModelSlot; if (Target.mDummyModel == null) { Actor.AddExitReason(ExitReason.Finished); } else { Target.mDummyModel.UnParent(); Target.mDummyModel.ParentToSlot(Target, finalModelSlot); Target.mDummyModel.SetModel(miniModelName, prodVersion); mFinalModelShown = true; } } else { mTimeUntilModelSwap -= ld.mDeltaTime; if (mTimeUntilModelSwap <= 0f) { Target.SwapToRandomDummyGeoState(false); mTimeUntilModelSwap = GetTimeForNextModelChange(); } } } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); } }
public override void Remove(ProductVersion value) { GameUtils.sProductFlags &= ~value; }
public override bool Contains(ProductVersion value) { return((GameUtils.sProductFlags & value) != ProductVersion.Undefined); }
/// <summary> /// Initializes a new instance of the <see cref="ProjectBase" /> class. /// </summary> protected ProjectBase(XmlElement xmlDefinition, SolutionTask solutionTask, TempFileCollection temporaryFiles, GacCache gacCache, ReferencesResolver referencesResolver, DirectoryInfo outputDir) { if (xmlDefinition == null) { throw new ArgumentNullException("xmlDefinition"); } if (solutionTask == null) { throw new ArgumentNullException("solutionTask"); } if (temporaryFiles == null) { throw new ArgumentNullException("temporaryFiles"); } if (gacCache == null) { throw new ArgumentNullException("gacCache"); } if (referencesResolver == null) { throw new ArgumentNullException("referencesResolver"); } _projectConfigurations = new ConfigurationDictionary(); _buildConfigurations = new ConfigurationDictionary(); _extraOutputFiles = CollectionsUtil.CreateCaseInsensitiveHashtable(); // ensure the specified project is actually supported by this project VerifyProjectXml(xmlDefinition); _solutionTask = solutionTask; _temporaryFiles = temporaryFiles; _outputDir = outputDir; _gacCache = gacCache; _refResolver = referencesResolver; _productVersion = DetermineProductVersion(xmlDefinition); }
/// <summary> /// Check if the user can Manually Authorise the payment /// </summary> /// <param name="user"> System User </param> /// <param name="checkLog"> Collection of Claim Financial Authority Limit Check Result </param> /// <param name="product"> Product Version </param> /// <param name="check"> Enum Claim Financial Authority Check Type</param> /// <param name="claimTransactionHeader">Claim Transaction Header</param> /// <returns> Bool True / False </returns> protected bool CanPerformManualCheck(User user, List<ClaimFinancialAuthorityLimitCheckResult> checkLog, ProductVersion product, StaticValues.ClaimFinancialAuthorityCheckType check, ClaimTransactionHeader claimTransactionHeader) { FinancialAuthorityCheckComponents components = new FinancialAuthorityCheckComponents(claimTransactionHeader.ClaimHeader, null, claimTransactionHeader); var claimTransactionArgs = new ClaimTransactionHeaderArgument(AmountDataSource.Historical, claimTransactionHeader); // Determine if the manual auth is possible. var result = ClaimFinancialAuthorityCheckUtil.PerformUserLimitCheck(user.UserID, product, StaticValues.ClaimFinancialAuthorityLimitType.LimitForManualAuthorisation, check, claimTransactionArgs, components, null); // Add the result to the checklog that was passed in, a list of results of the ClaimFinancialAuthorityChecks checkLog.Add(result); // Return true or false, appropriately return result == ClaimFinancialAuthorityLimitCheckResult.NullValue || result.IsAuthorised; }
/// <summary> /// Check if the user can Manually Authorise the payment /// </summary> /// <param name="user">Syatem User</param> /// <param name="checkLog"> Collection of ClaimFinancialAuthorityLimitCheckResult </param> /// <param name="product"> Product Version </param> /// <param name="check"> Claim Financial Authority Check Type </param> /// <param name="header"> Claim mHeader</param> /// <param name="claimTransactionHeader"> Claim Transaction Header </param> /// <returns> True / False</returns> protected bool CanPerformManualCheck(User user, List<ClaimFinancialAuthorityLimitCheckResult> checkLog, ProductVersion product, StaticValues.ClaimFinancialAuthorityCheckType check, ClaimHeader header, ClaimTransactionHeader claimTransactionHeader) { FinancialAuthorityCheckComponents components = new FinancialAuthorityCheckComponents(claimTransactionHeader.ClaimHeader, null, claimTransactionHeader); var claimArgs = new ClaimHeaderArgument(AmountDataSource.Historical, header, claimTransactionHeader); var result = ClaimFinancialAuthorityCheckUtil.PerformUserLimitCheck(user.UserID, product, StaticValues.ClaimFinancialAuthorityLimitType.LimitForManualAuthorisation, check, claimArgs, components,null); checkLog.Add(result); return result == ClaimFinancialAuthorityLimitCheckResult.NullValue || result.IsAuthorised; }
private static IGameObject CreateObjectInternal(ulong instance, ProductVersion version, Hashtable data, Simulator.ObjectInitParameters initData) { ResourceKey key = new ResourceKey(instance, 0x319e4f1d, ResourceUtils.ProductVersionToGroupId(version)); return GlobalFunctions.CreateObjectInternal(key, data, initData); }
// From SimDescription.Instantiate private static Sim Perform(SimDescription ths, Vector3 position, ResourceKey outfitKey, bool forceAlwaysAnimate, OnReset reset) { Household.HouseholdSimsChangedCallback changedCallback = null; Household changedHousehold = null; bool isChangingWorlds = GameStates.sIsChangingWorlds; bool isLifeEventManagerEnabled = LifeEventManager.sIsLifeEventManagerEnabled; Corrections.RemoveFreeStuffAlarm(ths); using (SafeStore store = new SafeStore(ths, SafeStore.Flag.LoadFixup | SafeStore.Flag.Selectable | SafeStore.Flag.Unselectable)) { try { // Stops the memories system from interfering LifeEventManager.sIsLifeEventManagerEnabled = false; // Stops UpdateInformationKnownAboutRelationships() GameStates.sIsChangingWorlds = true; if (ths.Household != null) { changedCallback = ths.Household.HouseholdSimsChanged; changedHousehold = ths.Household; ths.Household.HouseholdSimsChanged = null; } if (ths.CreatedSim != null) { AttemptToPutInSafeLocation(ths.CreatedSim, false); if (reset != null) { ths.CreatedSim.SetObjectToReset(); reset(ths.CreatedSim, false); } return(ths.CreatedSim); } if (ths.AgingState != null) { bool flag = outfitKey == ths.mDefaultOutfitKey; ths.AgingState.SimBuilderTaskDeferred = false; ths.AgingState.PreInstantiateSim(ref outfitKey); if (flag) { ths.mDefaultOutfitKey = outfitKey; } } int capacity = forceAlwaysAnimate ? 0x4 : 0x2; Hashtable overrides = new Hashtable(capacity); overrides["simOutfitKey"] = outfitKey; overrides["rigKey"] = CASUtils.GetRigKeyForAgeGenderSpecies((ths.Age | ths.Gender) | ths.Species); if (forceAlwaysAnimate) { overrides["enableSimPoseProcessing"] = 0x1; overrides["animationRunsInRealtime"] = 0x1; } string instanceName = "GameSim"; ProductVersion version = ProductVersion.BaseGame; if (ths.Species != CASAgeGenderFlags.Human) { instanceName = "Game" + ths.Species; version = ProductVersion.EP5; } SimInitParameters initData = new SimInitParameters(ths); Sim target = GlobalFunctions.CreateObjectWithOverrides(instanceName, version, position, 0x0, Vector3.UnitZ, overrides, initData) as Sim; if (target != null) { if (target.SimRoutingComponent == null) { // Performed to ensure that a useful error message is produced when the Sim construction fails target.OnCreation(); target.OnStartup(); } target.SimRoutingComponent.EnableDynamicFootprint(); target.SimRoutingComponent.ForceUpdateDynamicFootprint(); ths.PushAgingEnabledToAgingManager(); /* This code is idiotic * if ((ths.Teen) && (target.SkillManager != null)) * { * Skill skill = target.SkillManager.AddElement(SkillNames.Homework); * while (skill.SkillLevel < SimDescription.kTeenHomeworkSkillStartLevel) * { * skill.ForceGainPointsForLevelUp(); * } * } */ // Custom OccultTypeHelper.SetupForInstantiatedSim(ths.OccultManager); if (ths.IsAlien) { World.ObjectSetVisualOverride(target.ObjectId, eVisualOverrideTypes.Alien, null); } AttemptToPutInSafeLocation(target, false); EventTracker.SendEvent(EventTypeId.kSimInstantiated, null, target); /* * MiniSimDescription description = MiniSimDescription.Find(ths.SimDescriptionId); * if ((description == null) || (!GameStates.IsTravelling && (ths.mHomeWorld == GameUtils.GetCurrentWorld()))) * { * return target; * } * description.UpdateInWorldRelationships(ths); */ if (ths.HealthManager != null) { ths.HealthManager.Startup(); } if (((ths.SkinToneKey.InstanceId == 15475186560318337848L) && !ths.OccultManager.HasOccultType(OccultTypes.Vampire)) && (!ths.OccultManager.HasOccultType(OccultTypes.Werewolf) && !ths.IsGhost)) { World.ObjectSetVisualOverride(ths.CreatedSim.ObjectId, eVisualOverrideTypes.Genie, null); } if (ths.Household.IsAlienHousehold) { (Sims3.UI.Responder.Instance.HudModel as HudModel).OnSimCurrentWorldChanged(true, ths); } if (Household.RoommateManager.IsNPCRoommate(ths.SimDescriptionId)) { Household.RoommateManager.AddRoommateInteractions(target); } } return(target); } finally { LifeEventManager.sIsLifeEventManagerEnabled = isLifeEventManagerEnabled; GameStates.sIsChangingWorlds = isChangingWorlds; if ((changedHousehold != null) && (changedCallback != null)) { changedHousehold.HouseholdSimsChanged = changedCallback; if (changedHousehold.HouseholdSimsChanged != null) { changedHousehold.HouseholdSimsChanged(Sims3.Gameplay.CAS.HouseholdEvent.kSimAdded, ths.CreatedSim, null); } } } } }
/////// <summary> /////// Create Event on claimDetail /////// </summary> /////// <param name="clmDetail">Claim Detail</param> /////// <param name="clmTransHeader">Claim Transaction Header</param> /////// <param name="product">Product Version</param> /////// <param name="eventTypeCode">event Type Code</param> private void CreateEvent(ClaimHeader clmHeader,ClaimDetail clmDetail, ClaimTransactionHeader clmTransHeader, ProductVersion product, string eventTypeCode) { // find an event on the Product for this claim that matches the required event type bool EventExists= false; var productEvent = ProductService.GetProductEventQuery().GetProductEvents(clmTransHeader.ClaimHeader.ProductVersionID.GetValueOrDefault()) .Where(x => x.EventTypeCode == eventTypeCode).FirstOrDefault(); if (eventTypeCode == ClaimConstants.EVENT_TYPECODE_RECOVERYRECEIPT) { EventExists = this.ChkIfEventExists(clmHeader, productEvent); } if (productEvent != null && !EventExists) { ClaimEvent claimEvent = null; // Get a list of all claim details on all Claim Transaction Groups on this ClaimTransactionHeader IEnumerable<ClaimDetail> claimDetails = clmTransHeader.ClaimTransactionGroups.Select(a => a.ClaimDetail).Distinct(); if (claimDetails.Count() == 1) { // We only have one claim detail so add the event to that claim detail ClaimDetail claimDetail = claimDetails.First(); claimEvent = claimDetail.AddNewClaimEvent(productEvent.ProductEventID, true); } else { // We have multiple claim details, so add the event at the Claim Transaction Header level claimEvent = clmTransHeader.ClaimHeader.AddNewClaimEvent(productEvent.ProductEventID, true); } if (claimEvent.CustomText01Field.IsInUse == true) { // Set the cancellation reason, CustomText01 claimEvent.CustomText01 = clmTransHeader.ClaimTransactionDescription; } } }
protected static Urnstone PrivateCreateGrave(SimDescription corpse) { string style; ProductVersion version = ProductVersion.BaseGame; switch (corpse.Species) { case CASAgeGenderFlags.Dog: case CASAgeGenderFlags.LittleDog: style = "tombstoneDog"; version = ProductVersion.EP5; break; case CASAgeGenderFlags.Horse: if (corpse.IsUnicorn) { style = "tombstoneUnicorn"; } else { style = "tombstoneHorse"; } version = ProductVersion.EP5; break; case CASAgeGenderFlags.Cat: style = "tombstoneCat"; version = ProductVersion.EP5; break; default: ulong lifetimeHappiness = corpse.LifetimeHappiness; if (lifetimeHappiness >= Urnstone.LifetimeHappinessWealthyTombstone) { style = "UrnstoneHumanWealthy"; } else if (lifetimeHappiness < Urnstone.LifetimeHappinessPoorTombstone) { style = "UrnstoneHumanPoor"; } else { style = "UrnstoneHuman"; } break; } Urnstone stone = GlobalFunctions.CreateObject(style, version, Vector3.OutOfWorld, 0, Vector3.UnitZ, null, null) as Urnstone; if (stone == null) { return(null); } corpse.Fixup(); stone.SetDeadSimDescription(corpse); stone.mPlayerMoveable = true; return(stone); }
public void SetThumbnail(string icon, ProductVersion version) { SetThumbnail (ResourceKey.CreatePNGKey(icon, ResourceUtils.ProductVersionToGroupId(version))); }
public void DoCheckForUpdates() { if (WebInstallUrl.IsNullOrEmpty()) { return; } Log("Checking for new version"); if (!WebInstallUrl.EndsWith("/")) { WebInstallUrl += "/"; } try { using (var wc = new System.Net.WebClient()) { var config = wc.DownloadString(WebInstallUrl + "Config.xml"); var hash = XmlToHash(config); int onlineVersion = GetVersionInteger(hash["ProductVersion"]); int localVersion = GetVersionInteger(ProductVersion); if (onlineVersion > localVersion) { int InstallerOnlineVersion = GetVersionInteger(hash["InstallerNeedsMinVersion"]); int InstallerLocalVersion = GetVersionInteger(InstallerNeedsMinVersion); SetConfig(hash); Log("Found new version " + ProductVersion); Log("Downloading installation files"); if (InstallerOnlineVersion > InstallerLocalVersion) { var fileName = "SharpKitSetup_" + ProductVersion.Replace("v", "").Replace(".", "_") + ".exe"; var tempFile = Path.GetTempPath() + fileName; Utils.UIDeleteFile(tempFile); wc.DownloadFile(WebInstallUrl + fileName, tempFile); Log("Starting new setup file"); if (Utils.IsUnix) { Process.Start("mono", tempFile); } else { Process.Start(tempFile); } System.Diagnostics.Process.GetCurrentProcess().Kill(); } else { var data = wc.DownloadData(WebInstallUrl + "Files.zip"); Log("Downloading finisehd"); WebMemorystram = new MemoryStream(data); //at the moment, sharpkit install files are not very large. When becomes > 100MB, it should be saved to disk. } } else if (onlineVersion == localVersion) { Log("No new version available."); } else { Log("Local version are newer than online version."); } } } catch (Exception ex) { Log("Error while checking for updates. Continue installing offline files. " + ex); } }
public CommonOptionItem(string name, int count, string icon, ProductVersion version) : this(name, count) { SetThumbnail(icon, version); }
public override void Add(ProductVersion value) { GameUtils.sProductFlags |= value; }
public Sim _NInstantiate(Vector3 position, ResourceKey outfitKey, bool addInitialObjects, bool forceAlwaysAnimate) { if (runI) { return(null); } if (NiecHelperSituation.__acorewIsnstalled__) { if (!Instantiator.kDontCallDGSACore && NFinalizeDeath.RUNIACORE != null) { NFinalizeDeath.RUNIACORE(false); } else { NFinalizeDeath.CheckNHSP(); } } if (CreatedSim != null) { return(CreatedSim); } if (AgingState != null) { bool isDefaultOutfit = outfitKey == mDefaultOutfitKey; AgingState.PreInstantiateSim(ref outfitKey); if (isDefaultOutfit) { mDefaultOutfitKey = outfitKey; } } Hashtable hashtable = new Hashtable(forceAlwaysAnimate ? 4 : 2); hashtable["simOutfitKey"] = outfitKey; hashtable["rigKey"] = CASUtils.GetRigKeyForAgeGenderSpecies(Age | Gender | Species); if (forceAlwaysAnimate) { hashtable["enableSimPoseProcessing"] = 1u; hashtable["animationRunsInRealtime"] = 1u; } string instanceName = "GameSim"; ProductVersion version = ProductVersion.BaseGame; if (Species != CASAgeGenderFlags.Human) { instanceName = "Game" + Species; version = ProductVersion.EP5; } bool shouldNullHousehold = false; if (Household == null) { mHousehold = Household.NpcHousehold ?? Household.ActiveHousehold; shouldNullHousehold = true; } Sim sim = GlobalFunctions.CreateObjectWithOverrides(instanceName, version, position, 0, Vector3.UnitZ, hashtable, new SimInitParameters(this)) as Sim; if (sim != null) { sim.mSimDescription = this; this.mSim = sim; if (sim.SimRoutingComponent != null) { sim.SimRoutingComponent.EnableDynamicFootprint(); sim.SimRoutingComponent.ForceUpdateDynamicFootprint(); } try { if (sim.IsSelectable) { sim.AddInitialObjects(true); } } catch (ResetException) { throw; } catch (Exception) { } PushAgingEnabledToAgingManager(); if (OccultManager != null) { OccultManager.SetupForInstantiatedSim(); } if (GameUtils.IsFutureWorld()) { CauseEffectService.ApplyCauseAndEffectModsToSim(sim); } if (IsAlien) { World.ObjectSetVisualOverride(sim.ObjectId, eVisualOverrideTypes.Alien, null); } if (EventTracker.sInstance != null) { EventTracker.SendEvent(EventTypeId.kSimInstantiated, null, sim); } MiniSimDescription miniSimDescription = MiniSimDescription.Find(SimDescriptionId); if (miniSimDescription != null && (GameStates.IsTravelling || mHomeWorld != GameUtils.GetCurrentWorld())) { miniSimDescription.UpdateInWorldRelationships(this); } if (HealthManager != null) { HealthManager.Startup(); } if (Household.RoommateManager != null && Household.RoommateManager.IsNPCRoommate(SimDescriptionId)) { Household.RoommateManager.AddRoommateInteractions(sim); } } if (OccultManager != null && SkinToneKey.InstanceId == 15475186560318337848uL && !OccultManager.HasOccultType(OccultTypes.Vampire) && !OccultManager.HasOccultType(OccultTypes.Werewolf) && !IsGhost) { World.ObjectSetVisualOverride(CreatedSim.ObjectId, eVisualOverrideTypes.Genie, null); } if (Household != null && Household.IsAlienHousehold) { (Sims3.UI.Responder.Instance.HudModel as HudModel).OnSimCurrentWorldChanged(true, this); } if (shouldNullHousehold && mHousehold == Household.NpcHousehold) { mHousehold = null; } sim.mSimDescription = this; this.mSim = sim; return(sim); }
public bool IsVersion2OrHigher() { return(!string.IsNullOrEmpty(ProductVersion) && !ProductVersion.StartsWith("1")); }
void Equal(string one, string two) { Assert.IsTrue(ProductVersion.TryParse(one, out var v1)); Assert.IsTrue(ProductVersion.TryParse(two, out var v2)); Assert.IsTrue(v1.CompareTo(v2) == 0); }
/// <summary> /// Returns a string representation of the client. /// </summary> /// <param name="code">The product code.</param> /// <param name="version">The product version.</param> /// <returns>A string representation of the client.</returns> public static string ToGatedClientString(ProductCode code, ProductVersion version) => string.Format(CultureInfo.InvariantCulture, "{0} | {1}", code, version);
void CanParse(string s) { Assert.IsTrue(ProductVersion.TryParse(s, out var v1)); }
public ValueSettingOption(TValue value, string name, int count, string icon, ProductVersion version) : base(name, count, icon, version) { mValue = value; }
public bool TryParseProductVersion(string name, out ProductVersion value, ProductVersion defaultValue) { return mHudModel.TryParseProductVersion(name, out value, defaultValue); }