public bool Execute(string directory, Mapping mapToRun, BuildData buildData) { try { DeploymentHost host = new DeploymentHost(); Runspace space = RunspaceFactory.CreateRunspace(host); space.Open(); this.PopulateVariables(space, mapToRun, buildData); string command = this.GeneratePipelineCommand(directory, mapToRun); this._scriptRun = command; this.EnsureExecutionPolicy(space); Pipeline pipeline = space.CreatePipeline(command); Collection<PSObject> outputObjects = pipeline.Invoke(); if (pipeline.PipelineStateInfo.State != PipelineState.Failed) { this._errorOccured = false; } string output = this.GenerateOutputFromObjects(outputObjects); this._output = output; space.Close(); } catch (Exception ex) { this._errorOccured = true; this._output = ex.ToString(); } return this.ErrorOccured; }
public Vegetation(SimEngine sim, BuildData data) { this.sim = sim; treeDensity = data.TreeDensity; density = data.VegetationDensity; grassDrawFadeEndDist = Sim.Settings.Graphics.Default.GrassDrawDist; grassDrawFadeStartDist = 0.8f * grassDrawFadeEndDist; treeDrawFadeEndDist = Sim.Settings.Graphics.Default.TreeDrawDist; treeDrawFadeStartDist = 0.8f * treeDrawFadeEndDist; }
private string GetSubject(Mapping map, BuildData build, IRunner runner) { string errorMessage = "Success: "; if (runner.ErrorOccured) { errorMessage = "Failed: "; } return string.Format("{0} TfsDeployer Ran Script {1} on Machine {2} for {3}/{4}/{5}",errorMessage, map.Script, map.Computer, build.TeamProject, build.BuildType, build.BuildNumber); }
public Terrain(BuildData data, SimEngine sim) { this.sim = sim; this.heightmap = data.Heightmap; this.scale = data.TerrainScale; this.g = sim.GraphicsDevice; this.camera = sim.UI.Camera; this.smooths = data.Smoothing; hmRatio = (float)heightmap.Height / heightmap.Width; }
private string GetBody(Mapping map, BuildData build, IRunner runner) { StringBuilder builder = new StringBuilder(); builder.AppendLine(string.Format("Team Project/Build: {0} to {1}",build.TeamProject,build.BuildType)); builder.AppendLine(string.Format("Quality Change: {0} to {1}",map.OriginalQuality,map.NewQuality)); builder.AppendLine(string.Format("Drop Location: {0}", build.DropLocation)); builder.AppendLine(string.Format("Build Uri: {0}", build.BuildUri)); builder.AppendLine(string.Format("Script: {0}", runner.ScriptRun)); builder.AppendLine(string.Format("Output: {0}", runner.Output)); return builder.ToString(); }
/// <summary> /// Charge les données. /// </summary> /// <param name="projectId">L'identifiant du projet.</param> protected override async Task LoadData(int projectId) { ShowSpinner(); try { BuildData data = await ServiceBus.Get <IAnalyzeService>().GetBuildData(projectId); LoadDataInternal(data); } catch (Exception e) { base.OnError(e); } }
public AliNotifyRequest AliNotify(Stream aliReturnData) { try { //获取回调参数 var s = aliReturnData; int count; var buffer = new byte[1024]; var builder = new StringBuilder(); while ((count = s.Read(buffer, 0, 1024)) > 0) { builder.Append(Encoding.UTF8.GetString(buffer, 0, count)); } s.Flush(); s.Dispose(); //request 接收的字符串含有urlencode,这里需要decode一下 var alipayReturnData = builder.ToString().Split('&').ToDictionary(a => a.Split('=')[0], a => System.Net.WebUtility.UrlDecode(a.Split('=')[1])); //获取sign var sign = alipayReturnData["sign"]; //去除sign及signtype alipayReturnData.Remove("sign"); alipayReturnData.Remove("sign_type"); //获取支付宝订单号及商户交易订单号 var tradeNo = alipayReturnData["trade_no"]; var tradeIds = alipayReturnData["out_trade_no"]; var dic = alipayReturnData.ToDictionary(d => d.Key, d => d.Value); var preSign = BuildData.BuildParamStr(dic); //验签 var result = GenerateRsaAssist.VerifySign(preSign, AliPayConfig.AliPublicKey, sign, SignType.Rsa2); return(result ? new AliNotifyRequest { IsVerify = true, PayNo = tradeNo, TradeIds = tradeIds, PayTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Sign = sign, Content = preSign } : new AliNotifyRequest { IsVerify = false, PayNo = tradeNo, TradeIds = "", PayTime = "", Sign = sign, Content = preSign }); } catch (Exception e) { return(new AliNotifyRequest { IsVerify = false, PayNo = "", TradeIds = "", PayTime = "", Sign = "", Content = e.Message }); } }
static int Main(string[] Args) { // Parse all the parameters List <string> Arguments = new List <string>(Args); string Name = ParseParam(Arguments, "Name"); string Change = ParseParam(Arguments, "Change"); string Project = ParseParam(Arguments, "Project"); string RestUrl = ParseParam(Arguments, "RestUrl"); string Status = ParseParam(Arguments, "Status"); string Url = ParseParam(Arguments, "Url"); // Check we've got all the arguments we need (and no more) if (Arguments.Count > 0 || Name == null || Change == null || Project == null || RestUrl == null || Status == null || Url == null) { Console.WriteLine("Syntax:"); Console.WriteLine(" PostBadgeStatus -Name=<Name> -Change=<CL> -Project=<DepotPath> -RestUrls=<Url> -Status=<Status> -Url=<Url>"); return(1); } if (RestUrl != null) { BuildData Build = new BuildData { BuildType = Name, Url = Url, Project = Project, ArchivePath = "" }; if (!int.TryParse(Change, out Build.ChangeNumber)) { Console.WriteLine("Change must be an integer!"); return(1); } if (!Enum.TryParse <BuildData.BuildDataResult>(Status, true, out Build.Result)) { Console.WriteLine("Change must be Starting, Failure, Warning, Success, or Skipped!"); return(1); } try { SendRequest(RestUrl, "CIS", "POST", new JavaScriptSerializer().Serialize(Build)); } catch (Exception ex) { Console.WriteLine(string.Format("An exception was thrown attempting to send the request: {0}", ex.Message)); return(1); } } return(0); }
private bool SetPlayerData(BuildData data) { data.productVersion = _commonBuildData.productVersion; data.screenOrientation = _commonBuildData.screenOrientation; data.taskNumber = _commonBuildData.taskNumber; if (!data.IsAllDataInput()) { Debug.LogError("Input all data first"); return(false); } PlayerHelper.SetPlayerSettings(data); return(true); }
public static GenerateNuGetSpecTask FillTaskLibProperties(this GenerateNuGetSpecTask input, BuildData data, string version, string taskLib) { var projectDirectory = data.Src.GetDirectory(string.Format("Rosalia.TaskLib.{0}", taskLib)); return input .Id(string.Format("Rosalia.TaskLib.{0}", taskLib)) .Description(string.Format("{0} tasks bundle for Rosalia.", taskLib)) .Tags("rosalia", "tasklib", taskLib.ToLower()) .WithFile( projectDirectory.GetDirectory("bin").GetDirectory(data.Configuration).GetFile(string.Format("Rosalia.TaskLib.{0}.dll", taskLib)), "lib") .WithDependency("Rosalia.Core", version) .WithDependenciesFromPackagesConfig(projectDirectory); //.ToFile(data.Artifacts.GetFile(string.Format("Rosalia.TaskLib.{0}.nuspec", taskLib))); }
public static string GetPathWithVars(BuildData data, string s) { s = s.Replace("$NAME", GetProductName()); s = s.Replace("$PLATFORM", ConvertBuildTargetToString(data.target)); s = s.Replace("$VERSION", PlayerSettings.bundleVersion); s = s.Replace("$DATESHORT", $"{usedDate.Date.Year % 100}_{usedDate.Date.Month}_{usedDate.Date.Day}"); s = s.Replace("$YEARSHORT", $"{usedDate.Date.Year % 100}"); s = s.Replace("$DATE", $"{usedDate.Date.Year}_{usedDate.Date.Month}_{usedDate.Date.Day}"); s = s.Replace("$YEAR", $"{usedDate.Date.Year}"); s = s.Replace("$MONTH", $"{usedDate.Date.Month}"); s = s.Replace("$DAY", $"{usedDate.Date.Day}"); s = s.Replace("$TIME", $"{usedDate.Hour}_{usedDate.Minute}"); s = s.Replace("$EXECUTABLE", GetBuildTargetExecutable(data.target)); return(s); }
public void AddFenceArea(FenceAreaData data) { foreach (var fence in data.Fences) { BuildData buildData = new BuildData(); buildData.BuildType = (int)EZooObjectType.FenceArea; buildData.BuildId = 1; buildData.BuildUid = 0; buildData.Rotate = 0; buildData.Rect.x = fence.x; buildData.Rect.y = fence.y; buildData.Rect.width = 1; buildData.Rect.height = 1; AddBuildInfo(buildData, ESceneObjectStatus.Builded); } var fenceList = data.GetFences(); foreach (var pos in fenceList) { BuildData buildData = new BuildData(); buildData.BuildType = (int)EZooObjectType.Fence; buildData.BuildId = 1; buildData.BuildUid = 0; buildData.Rotate = 0; buildData.Rect.x = pos.x; buildData.Rect.y = pos.y; buildData.Rect.width = 1; buildData.Rect.height = 1; AddBuildInfo(buildData, ESceneObjectStatus.Builded); } var connectList = data.GetFenceConnects(); foreach (var pos in connectList) { BuildData buildData = new BuildData(); buildData.BuildType = (int)EZooObjectType.FenceConnect; buildData.BuildId = 1; buildData.BuildUid = 0; buildData.Rotate = 0; buildData.Rect.x = (int)(pos.x * 10); buildData.Rect.y = (int)(pos.y * 10); buildData.Rect.width = 1; buildData.Rect.height = 1; AddBuildInfo(buildData, ESceneObjectStatus.Builded); } }
private const int MaxPosValue = 1001000; //请求的参数最大值 超出这个数值属于伪造 x*1000+y的最大值 public async Task CreateBuild(Guid roleId, int pos, BuildData build, int moneyCount, int moneyType) { try { FinanceLogData log = new FinanceLogData() { AorD = false, Count = -moneyCount, Type = (int)GameEnum.FinanceLog.CreateBuild, MoneyType = moneyType }; LandData land = await LandDataHelper.Instance.GetLandByPos(pos); if (land != null) { land.ShopId = build.Id; land.State = (int)GameEnum.MapStatus.Building; } using (var tx = LogicServer.Instance.StateManager.CreateTransaction()) { await BagDataHelper.Instance.DecGold(moneyCount, moneyType, tx); //扣钱 await BuildIdDataHelper.Instance.UpdateBuildIdListByRoleId(roleId, build.Id, tx); await BuildDataHelper.Instance.SetBuildByBuildId(build, tx); await BuildIdPosDataHelper.Instance.SetBuildIdByPos(pos, build.Id, tx); await RoleController.Instance.AddIncome(roleId, build.Income, tx); await LandDataHelper.Instance.UpdateLandByPos(pos, land, tx); await FinanceLogController.Instance.UpdateFinanceLog(roleId, log, tx); await tx.CommitAsync(); } await MsgSender.Instance.UpdateGold(moneyType); //更新货币 await MsgSender.Instance.UpdateIncome(); //更新身价 await MsgSender.Instance.FinanceLogUpdate(log); } catch (Exception ex) { //Log throw ex; } }
private string GetIconClass(BuildData data) { if (data.IsCancelled) { return("fas fa-trash text-warning"); } if (!data.IsComplete) { return("fas fa-spinner fa-spin text-info"); } if (data.IsSuccess) { return("fas fa-check text-success"); } return("fas fa-exclamation-triangle text-danger"); }
public BuildData AddObjectToEditList(Vector2Int leftBottomGrid) { BuildData buildData = new BuildData(); buildData.BuildUid = 0; buildData.Count = 0; buildData.BuildType = (int)SelectBuildType; buildData.BuildId = SelectBuildId; buildData.Rotate = 0; buildData.Rect.x = leftBottomGrid.x; buildData.Rect.y = leftBottomGrid.y; buildData.Rect.width = SelectBuildWidth; buildData.Rect.height = SelectBuildHeight; EditingObjectList.Add(buildData); return(buildData); }
private Error[] HandleRequestImpl(BuildData buildData) { if (this.platform == null) { return(new Error[] { new Error() { Message = "No platform by the name of '" + this.platformId + "'" } }); } ExportResponse response = CbxVmBundleExporter.Run(this.platform, buildData.ExportProperties.ProjectDirectory, buildData.ExportProperties.OutputDirectory, buildData); return(response.Errors); }
public void AddFacilityInfo(FacilityData facilityData) { var deploy = GameEntry.DataTable.GetDataTableRow <DRFacility>(facilityData.Id); BuildData buildData = new BuildData(); buildData.BuildType = (int)EZooObjectType.Facility; buildData.BuildId = facilityData.Id; buildData.BuildUid = facilityData.Uid; buildData.Rotate = facilityData.Rotation; buildData.Rect.x = facilityData.LeftBottom.x; buildData.Rect.y = facilityData.LeftBottom.y; buildData.Rect.width = deploy.Width; buildData.Rect.height = deploy.Height; AddBuildInfo(buildData, ESceneObjectStatus.Builded); }
private BuildData GenerateBuildData() { BuildData data = new BuildData { Size = GetSizeFromTesselation(), PlaneHeight = _cloudheight, TrisSize = (_tesselation > 0) ? new Vector2(gridUtils.Grid.TileHeight * _sizeMultiply / (float)_tesselation, gridUtils.Grid.TileWidth * _sizeMultiply / (float)_tesselation) : new Vector2(gridUtils.Grid.TileHeight * _sizeMultiply, gridUtils.Grid.TileWidth * _sizeMultiply) }; float offsetX = ((data.Size - 1) * .5f * data.TrisSize.x) - gridUtils.GridHeight * .5f; float offsetY = ((data.Size - 1) * .5f * data.TrisSize.y) - gridUtils.GridWidth * .5f; data.Offset = new Vector2(offsetX, offsetY); return(data); }
public void AddLandInfo(LandData landData) { var deploy = GameEntry.DataTable.GetDataTableRow <DRLand>(landData.Id); BuildData buildData = new BuildData(); buildData.BuildType = (int)EZooObjectType.Land; buildData.BuildId = landData.Id; buildData.BuildUid = landData.Uid; buildData.Rotate = landData.Rotation; buildData.Rect.x = landData.LeftBottom.x; buildData.Rect.y = landData.LeftBottom.y; buildData.Rect.width = deploy.Width; buildData.Rect.height = deploy.Height; AddBuildInfo(buildData, ESceneObjectStatus.Builded); }
void OnReceivedBuildData(byte[] msg) { BuildDataPacket buildDataPacket = new BuildDataPacket(msg); BuildData buildData = buildDataPacket.GetData(); dataManager.SetBuildData(buildData); if (loadingManager.CurrentScene == GameManager.Scene.Loading) { loadingManager.dataCheck[(int)ServerPacketId.BuildData - 4] = true; } else if (loadingManager.CurrentScene == GameManager.Scene.Wait) { StartCoroutine(uiManager.BuildTimeCheck()); } }
static public void WriteBuildData(string buildDataPath, BuildReport report, string[] scenes, string[] prefabs) { var developmentBuild = report.summary.options.HasFlag(BuildOptions.Development); var inputScenes = new List <BuildDataInputFile>(); foreach (var scene in scenes) { inputScenes.Add(new BuildDataInputFile(scene, developmentBuild)); } var inputFiles = new List <BuildDataInputFile>(); foreach (var scene in scenes) { inputFiles.Add(new BuildDataInputFile(scene, developmentBuild)); } foreach (var prefab in prefabs) { inputFiles.Add(new BuildDataInputFile(prefab, developmentBuild)); } foreach (var assetInfo in report.packedAssets.SelectMany(a => a.contents)) { if (assetInfo.sourceAssetPath.ToNPath().FileExists() && !assetInfo.sourceAssetPath.StartsWith(".")) { inputFiles.Add(new BuildDataInputFile(assetInfo.sourceAssetPath, developmentBuild)); } } foreach (var projectSetting in new NPath("ProjectSettings").Files("*.asset")) { inputFiles.Add(new BuildDataInputFile(projectSetting, developmentBuild)); } var buildData = new BuildData() { scenes = inputScenes.ToArray(), inputFiles = inputFiles.ToArray(), buildOptions = report.summary.options & BuildData.BuildOptionsMask, unityVersion = Application.unityVersion, resourcePaths = ResourcesAPIInternal.GetAllPaths("").OrderBy(p => p).ToArray(), enabledModules = ModuleMetadata.GetModuleNames() .Where(m => ModuleMetadata.GetModuleIncludeSettingForModule(m) != ModuleIncludeSetting.ForceExclude) .ToArray() }; buildDataPath.ToNPath().WriteAllText(JsonUtility.ToJson(buildData)); }
public void AddShopInfo(ShopData shopData) { var deploy = GameEntry.DataTable.GetDataTableRow <DRShop>(shopData.Id); // 创建对象数据 BuildData buildData = new BuildData(); buildData.BuildType = (int)EZooObjectType.Shop; buildData.BuildId = shopData.Id; buildData.BuildUid = shopData.Uid; buildData.Rotate = shopData.Rotation; buildData.Rect.x = shopData.LeftBottom.x; buildData.Rect.y = shopData.LeftBottom.y; buildData.Rect.width = deploy.Width; buildData.Rect.height = deploy.Height; AddBuildInfo(buildData, ESceneObjectStatus.Builded); }
public void SetUp() { var property = new Property("property name", "property type", new InheritedPropertyValue("key")); var contextItem = MockRepository.GenerateMock <IContextItem>(); contextItem.Stub(c => c.Name).Return("key"); contextItem.Stub(c => c.Value).Return("result"); var context = new[] { contextItem }; var buildContext = new BuildData(Enumerable.Empty <IContextItem>()); buildContext.ContextSets.Push(context); this.propertyInstance = property.Build(buildContext); }
public static void PostCIS(BuildData Build) { using (SQLiteConnection Connection = new SQLiteConnection(ConnectionString)) { Connection.Open(); using (SQLiteCommand Command = new SQLiteCommand("INSERT INTO [CIS] (ChangeNumber, BuildType, Result, URL, Project, ArchivePath) VALUES (@ChangeNumber, @BuildType, @Result, @URL, @Project, @ArchivePath)", Connection)) { Command.Parameters.AddWithValue("@ChangeNumber", Build.ChangeNumber); Command.Parameters.AddWithValue("@BuildType", Build.BuildType); Command.Parameters.AddWithValue("@Result", Build.Result); Command.Parameters.AddWithValue("@URL", Build.Url); Command.Parameters.AddWithValue("@Project", Build.Project); Command.Parameters.AddWithValue("@ArchivePath", Build.ArchivePath); Command.ExecuteNonQuery(); } } }
public void SetUp() { var property = new Property( "property name", "property type", new VariablePropertyValue( "language code", new[] { new PropertyVariant("en", new FixedPropertyValue("English"), true), new PropertyVariant("fr", new InheritedPropertyValue("french message")) })); var buildContext = new BuildData(new[] { new ContextItem("french message", "Bonjour!"), new ContextItem("language code", "fr") }); this.propertyInstance = property.Build(buildContext); }
public static void Init() { if (_inited) { return; } var buildDataBundlePath = Path.Combine( UnityEngine.Application.streamingAssetsPath, "BuildDataAssetBundle", "builddata"); var buildDataBundle = AssetBundle.LoadFromFile(buildDataBundlePath); if (buildDataBundle == null) { _inited = true; Teardown(); buildDataBundle = AssetBundle.LoadFromFile(buildDataBundlePath); if (buildDataBundle == null) { Debug.LogError("Unable to load build data."); return; } } var allBuildData = buildDataBundle.LoadAllAssets <BuildData>(); if (allBuildData.Length == 0) { Debug.LogError("Build data bundle does not contain build data."); buildDataBundle.Unload(true); return; } else if (allBuildData.Length > 1) { Debug.LogError("Build data bundle contains more than one build data."); buildDataBundle.Unload(true); return; } // All green. _buildDataBundle = buildDataBundle; _buildData = allBuildData[0]; _inited = true; }
public void SetUp() { var property = new Property( "property name", "property type", new VariablePropertyValue( "language code", new[] { new PropertyVariant("en", new FixedPropertyValue("English"), true), new PropertyVariant("fr", new FixedPropertyValue("Français")) })); var buildContext = new BuildData(Enumerable.Empty <IContextItem>()); this.propertyInstance = property.Build(buildContext); }
public static BuildData CreateJungleData() { BuildData buildData = new BuildData(); buildData.Tile = 158; buildData.Wall = 42; buildData.PlatformStyle = 2; buildData.DoorStyle = 2; buildData.TableStyle = 2; buildData.WorkbenchStyle = 2; buildData.PianoStyle = 2; buildData.BookcaseStyle = 12; buildData.ChairStyle = 3; buildData.ChestStyle = 8; buildData.ProcessRoom = AgeJungleRoom; return(buildData); }
public static BuildData CreateDesertData() { BuildData buildData = new BuildData(); buildData.Tile = 396; buildData.Wall = 187; buildData.PlatformStyle = 0; buildData.DoorStyle = 0; buildData.TableStyle = 0; buildData.WorkbenchStyle = 0; buildData.PianoStyle = 0; buildData.BookcaseStyle = 0; buildData.ChairStyle = 0; buildData.ChestStyle = 1; buildData.ProcessRoom = AgeDesertRoom; return(buildData); }
public static BuildData CreateMarbleData() { BuildData buildData = new BuildData(); buildData.Tile = 357; buildData.Wall = 179; buildData.PlatformStyle = 29; buildData.DoorStyle = 35; buildData.TableStyle = 34; buildData.WorkbenchStyle = 30; buildData.PianoStyle = 29; buildData.BookcaseStyle = 31; buildData.ChairStyle = 35; buildData.ChestStyle = 51; buildData.ProcessRoom = AgeMarbleRoom; return(buildData); }
public static BuildData CreateSnowData() { BuildData buildData = new BuildData(); buildData.Tile = 321; buildData.Wall = 149; buildData.DoorStyle = 30; buildData.PlatformStyle = 19; buildData.TableStyle = 28; buildData.WorkbenchStyle = 23; buildData.PianoStyle = 23; buildData.BookcaseStyle = 25; buildData.ChairStyle = 30; buildData.ChestStyle = 11; buildData.ProcessRoom = AgeSnowRoom; return(buildData); }
public static BuildData CreateMushroomData() { BuildData buildData = new BuildData(); buildData.Tile = 190; buildData.Wall = 74; buildData.PlatformStyle = 18; buildData.DoorStyle = 6; buildData.TableStyle = 27; buildData.WorkbenchStyle = 7; buildData.PianoStyle = 22; buildData.BookcaseStyle = 24; buildData.ChairStyle = 9; buildData.ChestStyle = 32; buildData.ProcessRoom = AgeMushroomRoom; return(buildData); }
public override Dictionary <string, string> GenerateReplacementDictionary( ExportProperties exportProperties, BuildData buildData) { Dictionary <string, string> replacements = this.ParentPlatform.GenerateReplacementDictionary(exportProperties, buildData); replacements["ANDROID_ORIENTATION"] = this.ConvertOrientationString(exportProperties.Orientations); // This logic is duplicated in LangJava's PlatformImpl replacements["JAVA_PACKAGE"] = (exportProperties.JavaPackage ?? exportProperties.ProjectID).ToLowerInvariant(); if (replacements["JAVA_PACKAGE"].StartsWith("org.crayonlang.interpreter")) { throw new InvalidOperationException("Cannot use org.crayonlang.interpreter as the project's package."); } return(replacements); }
public static BuildData CreateGraniteData() { BuildData buildData = new BuildData(); buildData.Tile = 369; buildData.Wall = 181; buildData.PlatformStyle = 28; buildData.DoorStyle = 34; buildData.TableStyle = 33; buildData.WorkbenchStyle = 29; buildData.PianoStyle = 28; buildData.BookcaseStyle = 30; buildData.ChairStyle = 34; buildData.ChestStyle = 50; buildData.ProcessRoom = AgeGraniteRoom; return(buildData); }
/// <summary> /// 扩建店铺 成功 构造返回 /// </summary> /// <param name="build"></param> /// <param name="config"></param> /// <returns></returns> private async Task <LoadBuildInfo> BuildExtend(BuildData build, AutoData.Extension config) { var role = LogicServer.User.role; using (var tx = LogicServer.Instance.StateManager.CreateTransaction()) { build.CurExtendLv++; build.Employee += config.ClerkAddtion; build.CustomerAddtion += config.CustomerAddtion; build.Star++; build.Income += config.Income; role.SocialStatus += config.Income; await BagDataHelper.Instance.DecGold(config.UpgradeCost.Count, config.UpgradeCost.CurrencyID, tx); //扣钱 await RoleDataHelper.Instance.UpdateRoleByRoleIdAsync(role.Id, role, tx); //更新用户身价 await BuildDataHelper.Instance.UpdateBuildByBuildId(build, tx); //更新建筑 await tx.CommitAsync(); } await MsgSender.Instance.UpdateGold(config.UpgradeCost.CurrencyID); await MsgSender.Instance.UpdateIncome(); LoadBuildInfo info = new LoadBuildInfo() { BuildId = build.Id, BuildType = build.BuildType, Employee = build.Employee, GetMoney = build.GetMoney, Level = build.Level, Name = build.Name, Popularity = build.Popularity, Pos = build.Pos, RoleId = build.RoleId, Star = build.Star, TodayCanAdvartise = build.TodayCanAdvartise, CustomerAddtion = build.CustomerAddtion, CurExtendLv = build.CurExtendLv, CostGold = build.CostGold, Income = build.Income }; return(info); }
public static void PostBuild(BuildData Build) { using (SQLiteConnection Connection = new SQLiteConnection(ConnectionString)) { Connection.Open(); long ProjectId = TryInsertAndGetProject(Connection, Build.Project); using (SQLiteCommand Command = new SQLiteCommand("INSERT INTO [Badges] (ChangeNumber, BuildType, Result, URL, ArchivePath, ProjectId) VALUES (@ChangeNumber, @BuildType, @Result, @URL, @ArchivePath, @ProjectId)", Connection)) { Command.Parameters.AddWithValue("@ChangeNumber", Build.ChangeNumber); Command.Parameters.AddWithValue("@BuildType", Build.BuildType); Command.Parameters.AddWithValue("@Result", Build.Result); Command.Parameters.AddWithValue("@URL", Build.Url); Command.Parameters.AddWithValue("@ArchivePath", Build.ArchivePath); Command.Parameters.AddWithValue("@ProjectId", ProjectId); Command.ExecuteNonQuery(); } } }
public void Alert(Mapping mapping, BuildData build, IRunner runner) { try { SmtpClient client = new SmtpClient(Settings.Default.SmtpServer); string subject = GetSubject(mapping, build, runner); string body = GetBody(mapping, build, runner); string toAddress = mapping.NotificationAddress ?? Settings.Default.ToAddress; MailMessage message = new MailMessage(Settings.Default.FromAddress, toAddress, subject, body); ; client.Send(message); } catch(Exception ex) { TraceHelper.TraceError(TraceSwitches.TfsDeployer, ex); } }
public bool Execute(string workingDirectory, Mapping mapToRun, BuildData buildData) { _scriptRun = Path.Combine(workingDirectory, mapToRun.Script); if (!File.Exists(_scriptRun)) { TraceHelper.TraceWarning(TraceSwitches.TfsDeployer, "BatchRunner - Could not find script: {0}", _scriptRun); _commandOutput = string.Format("BatchRunner - Could not find script: {0}", _scriptRun); _errorOccured = true; } else { // Create the ProcessInfo object ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(_scriptRun); psi.UseShellExecute = false; psi.RedirectStandardOutput = true; psi.RedirectStandardInput = true; psi.RedirectStandardError = true; psi.WorkingDirectory = workingDirectory; psi.Arguments = CreateArguments(mapToRun, buildData); TraceHelper.TraceInformation(TraceSwitches.TfsDeployer, "BatchRunner - Executing Scripts: {0} with arguments {1} in working directory {2}", _scriptRun, psi.Arguments, psi.WorkingDirectory); // Start the process Process proc = Process.Start(psi); using (StreamReader sOut = proc.StandardOutput) { proc.WaitForExit(); // Read the sOut to a string. _commandOutput = sOut.ReadToEnd().Trim(); TraceHelper.TraceInformation(TraceSwitches.TfsDeployer, "BatchRunner - Output From Command: {0}", _commandOutput); } _errorOccured = false; } return !_errorOccured; }
public BuildSummary GetBuildSummary(BuildData buildData) { BuildSummary result = null; foreach (BuildSummary summary in _summaries) { if (summary.BuildUri == buildData.BuildUri) { result = summary; break; } } if (result == null) { result = new BuildSummary(); _summaries.Add(result); } result.BuildDate = buildData.StartTime; result.BuildNumber = buildData.BuildNumber; result.BuildStatus = buildData.BuildStatus; result.BuildUri = buildData.BuildUri; result.DropLocation = buildData.DropLocation; return result; }
/// <summary> /// Catches the scenes with its path in build settings /// </summary> public static void CatchScenes() { // Process allowed only when game is playing if (EditorApplication.isPlaying) { // Load data from file BuildData bd = BuildData.Load(); if (bd == null) bd = new BuildData(); // Clear old scenes bd.scenes.Clear(); // Get where to start int i = 0; // If scene is in build settings we have to count one more scene int handler = 0; // Get new scenes for (; i < SceneManager.sceneCountInBuildSettings + handler; ++i) { //Load next Scene SceneManager.LoadScene(i); // Get scene path string path = SceneManager.GetSceneAt(i).path; if (i > 0) { // Add to scene list bd.scenes.Add(path); Debug.Log("Scene Loaded: " + path); // Check if scene is build settings if (SceneManager.GetSceneAt(0).name == SceneManager.GetSceneAt(i).name) handler = 1; } } Debug.Log(bd.scenes.Count + " scenes catched"); // Save data to file BuildData.Save(bd); } else { Debug.LogError("You must be in Play Mode"); } }
internal static Task<BuildResult> Compile (ProgressMonitor monitor, DotNetProject project, BuildData buildData) { return Task<BuildResult>.Run (delegate { ProjectItemCollection items = buildData.Items; BuildResult br = BuildResources (buildData.Configuration, ref items, monitor); if (br != null) return br; return project.OnCompileSources (items, buildData.Configuration, buildData.ConfigurationSelector, monitor); }); }
public void LogWarning(BuildData.WarningID warningID, string message, string fileName = null, int line = -1, int col = -1) { if (LogWarnings) { System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, message); } var entry = new BuildData.WarningEntry { ID = warningID, Message = message, Line = line, Column = col, FileName = fileName }; warnings.Add(entry); if (core.Options.IsDeltaExecution) { } OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), fileName, line, col); if (MessageHandler != null) { MessageHandler.Write(outputmessage); if (WebMsgHandler != null) { OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), "", line, col); WebMsgHandler.Write(webOutputMsg); } if (!outputmessage.Continue) throw new BuildHaltException(message); } }
public static BuildResult Compile (IProgressMonitor monitor, SolutionEntityItem item, BuildData buildData, ItemCompileCallback callback) { return Services.ProjectService.GetExtensionChain (item).Compile (monitor, item, buildData, callback); }
static void RequestGridSpawn(long builderEntityId, DefinitionIdBlit definition,BuildData position, bool isStatic, bool instantBuild) { Debug.Assert(BuildComponent != null, "The build component was not set in cube builder!"); MyEntity builder = null; bool isAdmin = (MyEventContext.Current.IsLocallyInvoked || MySession.Static.HasPlayerAdminRights(MyEventContext.Current.Sender.Value)); if ((instantBuild && isAdmin) == false) { MyEntities.TryGetEntityById(builderEntityId, out builder); } var blockDefinition = Definitions.MyDefinitionManager.Static.GetCubeBlockDefinition(definition); MatrixD worldMatrix = MatrixD.CreateWorld(position.Position, position.Forward, position.Up); BuildComponent.GetGridSpawnMaterials(blockDefinition, worldMatrix, isStatic); bool hasBuildMat = MyCubeBuilder.BuildComponent.HasBuildingMaterials(builder); hasBuildMat |= isAdmin; bool canSpawn = true; // Try spawning "fake" grid in that place, if fail it means something already there. if (isStatic) { canSpawn = GridPlacementTest(builder, blockDefinition, worldMatrix); } canSpawn = hasBuildMat & canSpawn; // It is not possible to create something in already occupied place, even if admin. ulong senderId = MyEventContext.Current.Sender.Value; MyMultiplayer.RaiseStaticEvent(s => SpawnGridReply, canSpawn, new EndpointId(senderId)); if (!canSpawn) return; SpawnGrid(blockDefinition, worldMatrix, builder, isStatic); }
private void PopulateVariables(Runspace space, Mapping mapToRun, BuildData buildData) { this.PopulateCommonVariables(space, mapToRun, buildData); foreach (ScriptParameter parameter in mapToRun.ScriptParameters) { space.SessionStateProxy.SetVariable(parameter.name, parameter.value); } }
static void RequestGridSpawn(long builderEntityId, DefinitionIdBlit definition, BuildData position, bool instantBuild, bool forceStatic, uint colorMaskHsv) { Debug.Assert(BuildComponent != null, "The build component was not set in cube builder!"); MyEntity builder = null; bool isAdmin = (MyEventContext.Current.IsLocallyInvoked || MySession.Static.HasPlayerAdminRights(MyEventContext.Current.Sender.Value) || MySession.Static.IsAdminModeEnabled(Sync.MyId)); MyEntities.TryGetEntityById(builderEntityId, out builder); var blockDefinition = MyDefinitionManager.Static.GetCubeBlockDefinition(definition); MatrixD worldMatrix = MatrixD.CreateWorld(position.Position, position.Forward, position.Up); float gridSize = MyDefinitionManager.Static.GetCubeSize(blockDefinition.CubeSize); BoundingBoxD localAABB = new BoundingBoxD(-blockDefinition.Size * gridSize * 0.5f, blockDefinition.Size * gridSize * 0.5f); MyGridPlacementSettings settings = CubeBuilderDefinition.BuildingSettings.GetGridPlacementSettings(blockDefinition.CubeSize); VoxelPlacementSettings voxelPlacementDef = new VoxelPlacementSettings() { PlacementMode = VoxelPlacementMode.OutsideVoxel }; settings.VoxelPlacement = voxelPlacementDef; bool isStatic = forceStatic || MyCubeGrid.IsAabbInsideVoxel(worldMatrix, localAABB, settings) || Static.m_stationPlacement; BuildComponent.GetGridSpawnMaterials(blockDefinition, worldMatrix, isStatic); bool hasBuildMat = (isAdmin && instantBuild) || MyCubeBuilder.BuildComponent.HasBuildingMaterials(builder); bool canSpawn = true; // Try spawning "fake" grid in that place, if fail it means something already there. // TODO: broken for armor blocks. Rendering instance stays on the screen after creating temp grid //if (isStatic) //{ // canSpawn = GridPlacementTest(builder, blockDefinition, worldMatrix); //} canSpawn = hasBuildMat & canSpawn; // It is not possible to create something in already occupied place, even if admin. ulong senderId = MyEventContext.Current.Sender.Value; MyMultiplayer.RaiseStaticEvent(s => SpawnGridReply, canSpawn, new EndpointId(senderId)); if (!canSpawn) return; MyCubeGrid grid = null; SpawnFlags flags = SpawnFlags.Default; if (isAdmin && instantBuild) { flags |= SpawnFlags.SpawnAsMaster; } Vector3 color = ColorExtensions.UnpackHSVFromUint(colorMaskHsv); if (isStatic) { grid = SpawnStaticGrid(blockDefinition, builder, worldMatrix, color, flags); } else grid = SpawnDynamicGrid(blockDefinition, builder, worldMatrix, color, spawnFlags: flags); if (grid != null) { if(grid.IsStatic && grid.GridSizeEnum != MyCubeSize.Small) { bool result = MyCoordinateSystem.Static.IsLocalCoordSysExist(ref worldMatrix, grid.GridSize); if (result) { MyCoordinateSystem.Static.RegisterCubeGrid(grid); } else { MyCoordinateSystem.Static.CreateCoordSys(grid, CubeBuilderDefinition.BuildingSettings.StaticGridAlignToCenter, true); } } AfterGridBuild(builder, grid, instantBuild); } }
private void OnGUI() { // Set the non static values when popup is started if (start) { // Try to find saved data bd = BuildData.Load(); if (bd == null) // Setting default data bd = new BuildData(); // Toggle start to false start = false; } //Popup Start GUILayout.BeginVertical(); //Tittle GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("Build options menu", EditorStyles.boldLabel); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Space(10); // Build Name GUILayout.Label("Build name:"); GUILayout.BeginHorizontal(); bd.buildName = EditorGUILayout.TextArea(bd.buildName); GUILayout.EndHorizontal(); GUILayout.Space(10); // Build Path GUILayout.Label("Build path:"); GUILayout.BeginHorizontal(); bd.workPath = EditorGUILayout.TextArea(bd.workPath); if (GUILayout.Button("Search", GUILayout.Width(80))) bd.workPath = SearchPath(bd.workPath); GUILayout.EndHorizontal(); GUILayout.Space(10); // Checks GUILayout.Label("Select target platforms:"); bd.win32 = EditorGUILayout.Toggle(" Windows32", bd.win32); bd.win64 = EditorGUILayout.Toggle(" Windows64", bd.win64); bd.lin = EditorGUILayout.Toggle(" Linux", bd.lin); bd.mac = EditorGUILayout.Toggle(" Mac", bd.mac); GUILayout.Space(10); // Use scene validation bd.countScenes = EditorGUILayout.Toggle("Scene validation: ", bd.countScenes); GUILayout.Space(10); // Share folder & Path bd.share = EditorGUILayout.Toggle("Send to shared folder: ", bd.share); if (bd.share) { GUILayout.Label("Shared folder path:"); GUILayout.BeginHorizontal(); bd.sharedFolderPath = EditorGUILayout.TextArea(bd.sharedFolderPath); if (GUILayout.Button("Search", GUILayout.Width(80))) bd.sharedFolderPath = SearchPath(bd.sharedFolderPath); GUILayout.EndHorizontal(); }else { // If option disable substitute it for an empty space GUILayout.Space(38); } GUILayout.Space(10); // Buttons GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Search zip.exe", GUILayout.Width(120))) SearchZipExe(); GUILayout.Space(40); if (GUILayout.Button("Cancel", GUILayout.Width(80))) Close(); if (GUILayout.Button("Save", GUILayout.Width(80))) Save(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); //Popup End GUILayout.EndVertical(); }
public void LogErrorInGlobalMap(Core.ErrorType type, string msg, string fileName = null, int line = -1, int col = -1, BuildData.WarningID buildId = BuildData.WarningID.kDefault, RuntimeData.WarningID runtimeId = RuntimeData.WarningID.kDefault) { ulong location = (((ulong)line) << 32 | ((uint)col)); Core.ErrorEntry newError = new Core.ErrorEntry { Type = type, FileName = fileName, Message = msg, Line = line, Col = col, BuildId = buildId, RuntimeId = runtimeId }; if (this.LocationErrorMap.ContainsKey(location)) { ProtoCore.Core.ErrorEntry error = this.LocationErrorMap[location]; // If there is a warning, replace it with an error if (error.Type == Core.ErrorType.Warning && type == Core.ErrorType.Error) { this.LocationErrorMap[location] = newError; } } else { this.LocationErrorMap.Add(location, newError); } }
protected override BuildResult OnBuild (IProgressMonitor monitor, ConfigurationSelector configuration) { DotNetProject project = Project; bool hasBuildableFiles = false; foreach (ProjectFile pf in project.Files) { if (pf.BuildAction == BuildAction.Compile || pf.BuildAction == BuildAction.EmbeddedResource) { hasBuildableFiles = true; break; } } if (!hasBuildableFiles) return new BuildResult (); if (project.LanguageBinding == null) { BuildResult langres = new BuildResult (); string msg = GettextCatalog.GetString ("Unknown language '{0}'. You may need to install an additional add-in to support this language.", project.LanguageName); langres.AddError (msg); monitor.ReportError (msg, null); return langres; } BuildResult refres = null; HashSet<ProjectItem> itemsToExclude = new HashSet<ProjectItem> (); foreach (ProjectReference pr in project.References) { if (pr.ReferenceType == ReferenceType.Project) { // Ignore non-dotnet projects Project p = project.ParentSolution != null ? project.ParentSolution.FindProjectByName (pr.Reference) : null; if (p != null && !(p is DotNetProject)) continue; if (p == null || pr.GetReferencedFileNames (configuration).Length == 0) { if (refres == null) refres = new BuildResult (); string msg = GettextCatalog.GetString ("Referenced project '{0}' not found in the solution.", pr.Reference); monitor.ReportWarning (msg); refres.AddWarning (msg); } } if (!pr.IsValid) { if (refres == null) refres = new BuildResult (); string msg; if (!pr.IsExactVersion && pr.SpecificVersion) { msg = GettextCatalog.GetString ("Reference '{0}' not found on system. Using '{1}' instead.", pr.StoredReference, pr.Reference); monitor.ReportWarning (msg); refres.AddWarning (msg); } else { bool errorsFound = false; foreach (string asm in pr.GetReferencedFileNames (configuration)) { if (!File.Exists (asm)) { msg = GettextCatalog.GetString ("Assembly '{0}' not found. Make sure that the assembly exists in disk. If the reference is required to build the project you may get compilation errors.", Path.GetFileName (asm)); refres.AddWarning (msg); monitor.ReportWarning (msg); errorsFound = true; itemsToExclude.Add (pr); } } msg = null; if (!errorsFound) { msg = GettextCatalog.GetString ("The reference '{0}' is not valid for the target framework of the project.", pr.StoredReference, pr.Reference); monitor.ReportWarning (msg); refres.AddWarning (msg); itemsToExclude.Add (pr); } } } } DotNetProjectConfiguration conf = (DotNetProjectConfiguration) project.GetConfiguration (configuration); // Create a copy of the data needed to compile the project. // This data can be modified by extensions. // Also filter out items whose condition evaluates to false BuildData buildData = new BuildData (); ProjectParserContext ctx = new ProjectParserContext (project, conf); buildData.Items = new ProjectItemCollection (); foreach (ProjectItem item in project.Items) { if (!itemsToExclude.Contains (item) && (string.IsNullOrEmpty (item.Condition) || ConditionParser.ParseAndEvaluate (item.Condition, ctx))) buildData.Items.Add (item); } buildData.Configuration = (DotNetProjectConfiguration) conf.Clone (); buildData.Configuration.SetParentItem (project); buildData.ConfigurationSelector = configuration; return ProjectExtensionUtil.Compile (monitor, project, buildData, delegate { ProjectItemCollection items = buildData.Items; BuildResult res = BuildResources (buildData.Configuration, ref items, monitor); if (res != null) return res; res = project.LanguageBinding.Compile (items, buildData.Configuration, buildData.ConfigurationSelector, monitor); if (refres != null) { refres.Append (res); return refres; } else return res; }); }
public WorldBuilder(SimEngine sim, BuildData data) { this.sim = sim; this.data = data; }
public bool ContainsWarning(BuildData.WarningID warnId) { foreach (BuildData.WarningEntry warn in warnings) { if (warnId == warn.id) return true; } return false; }
public void LogWarning(BuildData.WarningID warnId, string msg, string fileName = null, int line = -1, int col = -1) { //"> Warning: " + msg + "\n" /*if (fileName == null) { fileName = "N.A."; }*/ if (LogWarnings) { System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, msg); } BuildData.WarningEntry warningEntry = new BuildData.WarningEntry { id = warnId, msg = msg, line = line, col = col, FileName = fileName }; warnings.Add(warningEntry); if (compileState.Options.IsDeltaExecution) { compileState.LogErrorInGlobalMap(ProtoLanguage.CompileStateTracker.ErrorType.Warning, msg, fileName, line, col, warnId); } OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, msg.Trim(), fileName, line, col); if (MessageHandler != null) { MessageHandler.Write(outputmessage); if (WebMsgHandler != null) { OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, msg.Trim(), "", line, col); WebMsgHandler.Write(webOutputMsg); } if (!outputmessage.Continue) throw new BuildHaltException(msg); } }
private void PopulateCommonVariables(Runspace space, Mapping mapToRun, BuildData buildData) { space.SessionStateProxy.SetVariable( "TfsDeployerComputer", mapToRun.Computer ); space.SessionStateProxy.SetVariable( "TfsDeployerNewQuality", mapToRun.NewQuality ); space.SessionStateProxy.SetVariable( "TfsDeployerOriginalQuality", mapToRun.OriginalQuality ); space.SessionStateProxy.SetVariable( "TfsDeployerScript", mapToRun.Script ); space.SessionStateProxy.SetVariable( "TfsDeployerBuildData", buildData ); }
protected bool AddBlocksToBuildQueueOrSpawn(MyCubeBlockDefinition blockDefinition, ref MatrixD worldMatrixAdd, Vector3I min, Vector3I max, Vector3I center, Quaternion localOrientation) { bool added = false; BuildData position = new BuildData(); if (GridAndBlockValid) { if (PlacingSmallGridOnLargeStatic) { MatrixD gridWorldMatrix = worldMatrixAdd; position.Position = gridWorldMatrix.Translation; position.Forward = (Vector3) gridWorldMatrix.Forward; position.Up = (Vector3) gridWorldMatrix.Up; MyMultiplayer.RaiseStaticEvent(s => RequestGridSpawn, MySession.Static.LocalCharacterEntityId, (DefinitionIdBlit)blockDefinition.Id, position, MySession.Static.IsAdminModeEnabled(Sync.MyId), true, MyPlayer.SelectedColor.PackHSVToUint()); } else { m_blocksBuildQueue.Add(new MyCubeGrid.MyBlockLocation(blockDefinition.Id, min, max, center, localOrientation, MyEntityIdentifier.AllocateId(), MySession.Static.LocalPlayerId)); } added = true; } else { position.Position = worldMatrixAdd.Translation; position.Forward = worldMatrixAdd.Forward; position.Up = worldMatrixAdd.Up; MyMultiplayer.RaiseStaticEvent(s => RequestGridSpawn, MySession.Static.LocalCharacterEntityId, (DefinitionIdBlit)blockDefinition.Id, position, MySession.Static.IsAdminModeEnabled(Sync.MyId), false, MyPlayer.SelectedColor.PackHSVToUint()); MyGuiAudio.PlaySound(MyGuiSounds.HudPlaceBlock); added = true; } return added; }
private void GetBuildData(string buildUri) { try { _buildData = _bs.GetBuildDetails(buildUri); _buildNumber = _buildData.BuildNumber; _teamProject = _buildData.TeamProject; _buildUri = "vstfs:///Build/Build/" + _buildData.BuildUri; } catch (Exception ex) { Catcher(ex); } }
private void BuildList_MouseLeave(object sender, EventArgs e) { BuildListToolTip.Hide(BuildList); if(HoverItem != -1) { HoverItem = -1; BuildList.Invalidate(); } if(HoverBadge != null) { HoverBadge = null; BuildList.Invalidate(); } }
protected bool AddBlocksToBuildQueueOrSpawn(MyCubeBlockDefinition blockDefinition, ref MatrixD worldMatrixAdd, Vector3I min, Vector3I max, Vector3I center, Quaternion localOrientation) { bool added = true; BuildData position = new BuildData(); if (GridAndBlockValid) { if (PlacingSmallGridOnLargeStatic) { Vector3 offset = Vector3.Abs(Vector3.TransformNormal(MyCubeBlock.GetBlockGridOffset(blockDefinition), worldMatrixAdd)); MatrixD gridWorldMatrix = worldMatrixAdd; gridWorldMatrix.Translation -= offset; position.Position = gridWorldMatrix.Translation; position.Forward = (Vector3)gridWorldMatrix.Forward; position.Up = (Vector3)gridWorldMatrix.Up; MyMultiplayer.RaiseStaticEvent(s => RequestGridSpawn, MySession.Static.LocalCharacterEntityId, (DefinitionIdBlit)blockDefinition.Id, position, true, MySession.Static.IsAdminModeEnabled); } else { m_blocksBuildQueue.Add(new MyCubeGrid.MyBlockLocation(blockDefinition.Id, min, max, center, localOrientation, MyEntityIdentifier.AllocateId(), MySession.Static.LocalPlayerId)); } } else if (VoxelMapAndBlockValid && !DynamicMode) { Vector3 offset = Vector3.Abs(Vector3.TransformNormal(MyCubeBlock.GetBlockGridOffset(blockDefinition), worldMatrixAdd)); MatrixD gridWorldMatrix = worldMatrixAdd; gridWorldMatrix.Translation -= offset; position.Position = gridWorldMatrix.Translation; position.Forward = (Vector3)gridWorldMatrix.Forward; position.Up = (Vector3)gridWorldMatrix.Up; MyMultiplayer.RaiseStaticEvent(s => RequestGridSpawn, MySession.Static.LocalCharacterEntityId, (DefinitionIdBlit)blockDefinition.Id, position, true, MySession.Static.IsAdminModeEnabled); MyGuiAudio.PlaySound(MyGuiSounds.HudPlaceBlock); } else if (DynamicMode) { position.Position = worldMatrixAdd.Translation; position.Forward = (Vector3)worldMatrixAdd.Forward; position.Up = (Vector3)worldMatrixAdd.Up; MyMultiplayer.RaiseStaticEvent(s => RequestGridSpawn, MySession.Static.LocalCharacterEntityId, (DefinitionIdBlit)blockDefinition.Id, position, false, MySession.Static.IsAdminModeEnabled); MyGuiAudio.PlaySound(MyGuiSounds.HudPlaceBlock); } else { added = false; } return added; }
private void BuildList_MouseMove(object sender, MouseEventArgs e) { ListViewHitTestInfo HitTest = BuildList.HitTest(e.Location); int HitTestIndex = (HitTest.Item == null)? -1 : HitTest.Item.Index; if(HitTestIndex != HoverItem) { if(HoverItem != -1) { BuildList.RedrawItems(HoverItem, HoverItem, true); } HoverItem = HitTestIndex; if(HoverItem != -1) { BuildList.RedrawItems(HoverItem, HoverItem, true); } } BuildData NewHoverBadge = null; if(HitTest.Item != null && HitTest.Item.SubItems.IndexOf(HitTest.SubItem) == CISColumn.Index) { EventSummary Summary = EventMonitor.GetSummaryForChange(((PerforceChangeSummary)HitTest.Item.Tag).Number); if(Summary != null) { foreach(Tuple<BuildData, Rectangle> Badge in LayoutBadges(Summary.Builds, HitTest.SubItem.Bounds)) { if(Badge.Item2.Contains(e.Location)) { NewHoverBadge = Badge.Item1; break; } } } } if(NewHoverBadge != HoverBadge) { HoverBadge = NewHoverBadge; BuildList.Invalidate(); } bool bNewHoverSync = false; if(HitTest.Item != null) { bNewHoverSync = GetSyncBadgeRectangle(HitTest.Item.SubItems[StatusColumn.Index].Bounds).Contains(e.Location); } if(bNewHoverSync != bHoverSync) { bHoverSync = bNewHoverSync; BuildList.Invalidate(); } }
public void LogWarning(BuildData.WarningID warningID, string message, string fileName = null, int line = -1, int col = -1, AssociativeGraph.GraphNode graphNode = null) { var entry = new BuildData.WarningEntry { ID = warningID, Message = message, Line = line, Column = col, GraphNodeGuid = graphNode == null ? default(Guid) : graphNode.guid, AstID = graphNode == null? DSASM.Constants.kInvalidIndex : graphNode.OriginalAstID, FileName = fileName }; warnings.Add(entry); if (core.Options.IsDeltaExecution) { } if (LogWarnings) { System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, message); OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), fileName, line, col); if (MessageHandler != null) { MessageHandler.Write(outputmessage); if (WebMsgHandler != null) { OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), "", line, col); WebMsgHandler.Write(webOutputMsg); } if (!outputmessage.Continue) throw new BuildHaltException(message); } } }
public static void LogWarning(this Core core, BuildData.WarningID id, string msg, string fileName = null, int line = -1, int col = -1) { core.BuildStatus.LogWarning(id, msg, fileName, line, col); }