public ParamCollection() { E1 = new ParamList(); E2 = new ParamList(); E3 = new ParamList(); E4 = new ParamList(); E5 = new ParamList(); E6 = new ParamList(); E7 = new ParamList(); E8 = new ParamList(); E9 = new ParamList(); E10 = new ParamList(); E11 = new ParamList(); E12 = new ParamList(); E13 = new ParamList(); E14 = new ParamList(); E15 = new ParamList(); E16 = new ParamList(); E17 = new ParamList(); E18 = new ParamList(); E19 = new ParamList(); E20 = new ParamList(); E21 = new ParamList(); E22 = new ParamList(); E23 = new ParamList(); E24 = new ParamList(); E25 = new ParamList(); E26 = new ParamList(); E27 = new ParamList(); E28 = new ParamList(); E29 = new ParamList(); E30 = new ParamList(); 手动 = new ParamList(); }
static void DoStartup() { ParamList pl = new ParamList(); Form1 form = new Form1(); form.Show(); pl.Insert("WINDOW", form.Handle.ToString()); //Default mode is foreground exclusive..but, we want to show mouse - so nonexclusive pl.Insert("w32_mouse", "DISCL_FOREGROUND"); pl.Insert("w32_mouse", "DISCL_NONEXCLUSIVE"); //This never returns null.. it will raise an exception on errors g_InputManager = InputManager.CreateInputSystem(pl); uint v = InputManager.VersionNumber; Console.WriteLine("OIS Version: " + (v >> 16) + "." + ((v >> 8) & 0x000000FF) + "." + (v & 0x000000FF) + "\n\tRelease Name: " //+ InputManager.VersionName + "\n\tPlatform: " + g_InputManager.InputSystemName() + "\n\tNumber of Mice: " + g_InputManager.GetNumberOfDevices(MOIS.Type.OISMouse) + "\n\tNumber of Keyboards: " + g_InputManager.GetNumberOfDevices(MOIS.Type.OISKeyboard) + "\n\tNumber of Joys/Pads = " + g_InputManager.GetNumberOfDevices(MOIS.Type.OISJoyStick)); //List all devices DeviceList list = g_InputManager.ListFreeDevices(); foreach (KeyValuePair<MOIS.Type, string> pair in list) Console.WriteLine("\n\tDevice: " + g_DeviceType[(int)pair.Key] + " Vendor: " + pair.Value); g_kb = (Keyboard)g_InputManager.CreateInputObject(MOIS.Type.OISKeyboard, true); g_kb.KeyPressed += new KeyListener.KeyPressedHandler(KeyPressed); g_kb.KeyReleased += new KeyListener.KeyReleasedHandler(KeyReleased); g_m = (Mouse)g_InputManager.CreateInputObject(MOIS.Type.OISMouse, true); g_m.MouseMoved += new MouseListener.MouseMovedHandler(MouseMoved); g_m.MousePressed += new MouseListener.MousePressedHandler(MousePressed); g_m.MouseReleased += new MouseListener.MouseReleasedHandler(MouseReleased); MouseState_NativePtr ms = g_m.MouseState; ms.width = form.Width; ms.height = form.Height; //This demo only uses at max 4 joys int numSticks = g_InputManager.GetNumberOfDevices(MOIS.Type.OISJoyStick); if (numSticks > 4) numSticks = 4; g_joys = new JoyStick[numSticks]; for (int i = 0; i < numSticks; ++i) { g_joys[i] = (JoyStick)g_InputManager.CreateInputObject(MOIS.Type.OISJoyStick, true); g_joys[i].AxisMoved += new JoyStickListener.AxisMovedHandler(AxisMoved); g_joys[i].ButtonPressed += new JoyStickListener.ButtonPressedHandler(JoyButtonPressed); g_joys[i].ButtonReleased += new JoyStickListener.ButtonReleasedHandler(JoyButtonReleased); g_joys[i].PovMoved += new JoyStickListener.PovMovedHandler(PovMoved); g_joys[i].Vector3Moved += new JoyStickListener.Vector3MovedHandler(Vector3Moved); } }
public Controller(OgreForm ogreForm, int windowHnd) { this.mOgreForm = ogreForm; InputManager inputMgr; this.mKeyDown = new bool[256]; this.mKeyPressed = new bool[256]; this.mKeyReleased = new bool[256]; ParamList pl = new ParamList(); pl.Insert("WINDOW", windowHnd.ToString()); inputMgr = InputManager.CreateInputSystem(pl); if (inputMgr == null) { return; } // initialize keyboard this.mKeyBoard = (Keyboard)inputMgr.CreateInputObject(MOIS.Type.OISKeyboard, true); if (this.mKeyBoard == null) return; this.mKeyBoard.KeyPressed += OnKeyPressed; this.mKeyBoard.KeyReleased += OnKeyReleased; this.mMouseDown = new Dictionary<MouseButtons, bool>(); this.mMousePressed = new Dictionary<MouseButtons, bool>(); this.mMouseReleased = new Dictionary<MouseButtons, bool>(); foreach (MouseButtons button in Enum.GetValues(typeof(MouseButtons))) { this.mMouseDown.Add(button, false); this.mMousePressed.Add(button, false); this.mMouseReleased.Add(button, false); } this.mMousePos = new Mogre.Vector3(); this.BlockMouse = false; this.mCursorVisibility = true; this.mCommands = new XmlDocument(); this.LoadCommands(); this.mUserActions = new bool[Enum.GetValues(typeof(UserAction)).Length]; this.mUserActionsOccured = new bool[this.mUserActions.Length]; this.mUserActionsEnded = new bool[this.mUserActions.Length]; this.MovementFactor = new Mogre.Vector3(); this.mOgreForm.MouseMove += OnMouseMoved; this.mOgreForm.MouseWheel += OnMouseWheel; this.mOgreForm.MouseDown += OnMousePressed; this.mOgreForm.MouseUp += OnMouseReleased; this.mOgreForm.MouseLeave += OnMouseLeave; }
/// <summary> /// Retorna parametros por id, id padre, y filtra x vigentes o no vigentes La cultura puede se String.Empty /// en cuyo caso no la tendra en cuenta para el filtro /// </summary> /// <param name="parentId">Relacion con otro param</param> /// <param name="enabled">Vigentes o no</param> /// <param name="culture">Cultura que se desea consultar: th-TH, en-US, es-AR etc etc</param> /// <param name="cnnStringName">Cadena de coneccion</param> /// <returns></returns> public static ParamList RetriveByParams(int? parentId, bool? enabled,string culture, string cnnStringName) { ParamList wParamList = new ParamList(); ParamBE wParamBE = null; try { using (Fwk.ConfigData.FwkDatacontext dc = new Fwk.ConfigData.FwkDatacontext(System.Configuration.ConfigurationManager.ConnectionStrings[cnnStringName].ConnectionString)) { var rulesinCat = from s in dc.fwk_Params where (!parentId.HasValue || s.ParentId.Equals(parentId)) && (!enabled.HasValue || s.Enabled.Equals(enabled) && (string.IsNullOrEmpty(culture) || s.Culture.Equals(culture))) select s; foreach (Fwk.ConfigData.fwk_Param param_db in rulesinCat.ToList<Fwk.ConfigData.fwk_Param>()) { wParamBE = new ParamBE(); wParamBE.ParamId = param_db.ParamId; wParamBE.ParentId = param_db.ParentId; wParamBE.Name = param_db.Name; wParamBE.Description = param_db.Description; wParamBE.Enabled = param_db.Enabled; wParamBE.Culture = param_db.Culture; wParamBE.Id = param_db.Id; wParamList.Add(wParamBE); } } return wParamList; } catch (Exception ex) { throw ex; } }
public void Init(State state) { this.state = state; state.InputManger = this; var paramList = new ParamList(); paramList.Insert("w32_mouse", "DISCL_FOREGROUND"); paramList.Insert("w32_mouse", "DISCL_NONEXCLUSIVE"); paramList.Insert("w32_keyboard", "DISCL_FOREGROUND"); paramList.Insert("w32_keyboard", "DISCL_NONEXCLUSIVE"); paramList.Insert("WINDOW", state.MainWindow.Handle.ToString()); InputManager.CreateInputSystem(paramList); inputManager = InputManager.CreateInputSystem(paramList); //inputManager = InputManager.CreateInputSystem((uint)state.MainWindow.Handle.ToInt32()); CreateInputDevices(); }
internal bool Startup(int windowHandle, uint width, uint height) { mWindowHanldle = windowHandle; if (this.mInputMgr != null) return false; // initialize input manager ParamList pl = new ParamList(); pl.Insert("WINDOW", windowHandle.ToString()); pl.Insert("w32_mouse", "DISCL_NONEXCLUSIVE"); pl.Insert("w32_mouse", "DISCL_FOREGROUND"); pl.Insert("w32_keyboard", "DISCL_FOREGROUND"); pl.Insert("w32_keyboard", "DISCL_NONEXCLUSIVE"); this.mInputMgr = InputManager.CreateInputSystem(pl); if (this.mInputMgr == null) return false; // initialize keyboard this.KeyBoard = (Keyboard)this.mInputMgr.CreateInputObject(MOIS.Type.OISKeyboard, true); if (this.KeyBoard == null) return false; // set up keyboard event handlers this.KeyBoard.KeyPressed += OnKeyPressed; this.KeyBoard.KeyReleased += OnKeyReleased; // initialize mouse this.Mouse = (Mouse)this.mInputMgr.CreateInputObject(MOIS.Type.OISMouse, true); if (this.Mouse == null) return false; // set up area for absolute mouse positions MouseState_NativePtr state = this.Mouse.MouseState; state.width = (int)width; state.height = (int)height; // set up mouse event handlers this.Mouse.MouseMoved += OnMouseMoved; this.Mouse.MousePressed += OnMousePressed; this.Mouse.MouseReleased += OnMouseReleased; this.Clear(); return true; }
public InputController(string windowHandle, Camera camera, IBus bus, IClock clock, IPlayerId id) { m_Camera = camera; m_Bus = bus; m_Clock = clock; m_PlayerId = id; ParamList pl = new ParamList(); pl.Insert("WINDOW", windowHandle); pl.Insert("w32_mouse", "DISCL_FOREGROUND"); pl.Insert("w32_mouse", "DISCL_NONEXCLUSIVE"); pl.Insert("w32_keyboard", "DISCL_FOREGROUND"); pl.Insert("w32_keyboard", "DISCL_NONEXCLUSIVE"); m_Disposer = new Disposer(); bus.Subscribe<ChangeInputModeMessage>(OnModeChanged).AddTo(m_Disposer); }
public void CreateInput() { MOIS.ParamList pl = new ParamList(); IntPtr windHnd; this.mRenderWindow.GetCustomAttribute("WINDOW", out windHnd); pl.Insert("WINDOW", windHnd.ToString()); //Non-exclusive input, show OS cursor //If you want to see the mouse cursor and be able to move it outside your OGRE window and use the keyboard outside the running application pl.Insert("w32_mouse", "DISCL_FOREGROUND"); pl.Insert("w32_mouse", "DISCL_NONEXCLUSIVE"); pl.Insert("w32_keyboard", "DISCL_FOREGROUND"); pl.Insert("w32_keyboard", "DISCL_NONEXCLUSIVE"); inputManager = MOIS.InputManager.CreateInputSystem(pl); //Create all devices (except joystick, as most people have Keyboard/Mouse) using buffered input. inputKeyboard = (Keyboard)inputManager.CreateInputObject(MOIS.Type.OISKeyboard, true); inputMouse = (Mouse)inputManager.CreateInputObject(MOIS.Type.OISMouse, true); MOIS.MouseState_NativePtr mouseState = inputMouse.MouseState; mouseState.width = this.mViewport.ActualWidth;//update after resize window mouseState.height = this.mViewport.ActualHeight; CreateEventHandler(); }
/// <summary> /// 查询并且返回DataSet(游标分页) /// </summary> /// <param name="sql">要查询的SQL语句</param> /// <param name="lstParam">参数集合</param> /// <param name="objPage">分页对象</param> /// <param name="oper">数据库对象</param> /// <param name="curType">映射的实体类型(如果用回数据库的原列名,则此为null)</param> /// <returns></returns> public DataTable QueryDataTable(string sql, ParamList lstParam, PageContent objPage, DataBaseOperate oper, Type curType) { return(CursorPageCutter.QueryDataTable(sql, lstParam, objPage, oper, curType)); }
public static DomainObjectWithSpecialConstructor NewObject(object o) { return(NewObject <DomainObjectWithSpecialConstructor> (ParamList.CreateDynamic(o))); }
/// <summary> /// Edit information about a link /// </summary> /// <param name="accessToken">Access token of the user, obtained via <see cref="AuthorizeAsync"/> or <see cref="GetAccessTokenAsync(string)"/></param> /// <param name="link">Short Url (Bitlink) to edit</param> /// <param name="title">The title of your bitlink</param> /// <param name="note">Notes</param> /// <param name="privat"><code>true</code> if you want the bitlink to be private or <code>false</code> to be public</param> /// <param name="userTimeStamp">Change the timestamp</param> /// <param name="archived"><code>true</code> if you want the bitlink to be archived false otherwise</param> /// <returns></returns> public async Task <LinkEditResponseInfo> EditLinkAsync(string accessToken, string link, string title = null, string note = null, bool?privat = null, DateTime?userTimeStamp = null, bool?archived = null) { string escapedLink = Uri.EscapeUriString(link); ParamList pList = new ParamList(); pList.Add("access_token", accessToken); pList.Add("link", escapedLink); StringBuilder edit = new StringBuilder(); if (title != null) { pList.Add("title", Uri.EscapeDataString(title)); edit.Append("title,"); } if (note != null) { pList.Add("note", Uri.EscapeDataString(note)); edit.Append("note,"); } if (privat != null) { pList.Add("private", privat.Value.ToString().ToLower()); edit.Append("private,"); } if (userTimeStamp != null) { DateTime?epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); double user_ts = Math.Ceiling((userTimeStamp - epoch).Value.TotalSeconds); pList.Add("user_ts", user_ts.ToString()); edit.Append("user_ts,"); } if (archived != null) { pList.Add("archived", archived.Value.ToString().ToLower()); edit.Append("archived,"); } if (edit.Length != 0) { edit.Length--; pList.Add("edit", edit.ToString()); } Uri url = new Uri(Constants.HOST + Constants.USER_LINK_EDIT_URL + pList.ToString()); var response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); string json = await response.Content.ReadAsStringAsync(); LinkEditResponseInfo info = JsonConvert.DeserializeObject <LinkEditResponseInfo>(json, new JsonSerializerSettings() { MissingMemberHandling = MissingMemberHandling.Ignore }); info.JsonString = json; return(info); }
public override IPersistenceStrategy CreatePersistenceStrategy(ClientTransaction constructedTransaction) { ArgumentUtility.CheckNotNull("constructedTransaction", constructedTransaction); return(ObjectFactory.Create <RootPersistenceStrategy> (true, ParamList.Create(constructedTransaction.ID))); }
public static TypeWithReference Create(string displayName) { return(ObjectFactory.Create <TypeWithReference> (true, ParamList.Create(displayName))); }
/// <summary> /// 修改公司分组信息 /// </summary> /// <param name="groupModel"></param> /// <returns></returns> public static bool EditCompanyGroup(USER_SHARE_GROUPMODEL groupModel, List <USER_SHARE_VEHICLE_GROUPMODEL> lstVgModel, USER_SHARE_LOGMODEL log) { bool blSuccess = false; StringBuilder strSql = new StringBuilder(); strSql.Append("update USER_SHARE_GROUP set "); strSql.Append("COMPANYCODE=:COMPANYCODE,"); strSql.Append("GROUPNAME=:GROUPNAME,"); strSql.Append("PARENTID=:PARENTID,"); strSql.Append("STATE=:STATE,"); strSql.Append("GRADE=:GRADE,"); strSql.Append("VEHICLENUM=:VEHICLENUM,"); strSql.Append("GROUPDESC=:GROUPDESC"); strSql.Append(" where ID=:ID "); ParamList param = new ParamList(); param["ID"] = groupModel.ID; param["COMPANYCODE"] = groupModel.COMPANYCODE; param["GROUPNAME"] = groupModel.GROUPNAME; param["PARENTID"] = groupModel.PARENTID; param["STATE"] = groupModel.STATE; param["GRADE"] = groupModel.GRADE; param["VEHICLENUM"] = groupModel.VEHICLENUM; param["GROUPDESC"] = groupModel.GROUPDESC; IConnectionProvider connection = ConnectionProviderBuilder.CreateConnectionProvider(); try { using (connection) { connection.BeginTranscation(); //修改公司分组信息 connection.ExecuteNonQuery(strSql.ToString(), param); param.Clear(); //删除原来分组下的车辆信息 string strSqlFun = "DELETE FROM USER_SHARE_VEHICLE_GROUP WHERE SHAREGROUPID=" + groupModel.ID; StaticConnectionProvider.ExecuteNonQuery(strSqlFun); //分组车辆信息添加 foreach (USER_SHARE_VEHICLE_GROUPMODEL vgModel in lstVgModel) { strSqlFun = @"insert into USER_SHARE_VEHICLE_GROUP(SHAREGROUPID,TARGETID,MACID) values (:SHAREGROUPID,:TARGETID,:MACID)"; param.Clear(); param["SHAREGROUPID"] = groupModel.ID; param["TARGETID"] = vgModel.TARGETID; param["MACID"] = vgModel.MACID; connection.ExecuteNonQuery(strSqlFun, param); } param.Clear(); //操作日志 strSql = new StringBuilder(); strSql.Append("insert into USER_SHARE_LOG("); strSql.Append("LOGID,OPERATETYPE,OPERATORID,PROJECTID,COMPANYID,OPERATECONTENT,OPERATEDATE)"); strSql.Append(" values ("); strSql.Append(":LOGID,:OPERATETYPE,:OPERATORID,:PROJECTID,:COMPANYID,:OPERATECONTENT,:OPERATEDATE)"); param["LOGID"] = log.LOGID; param["OPERATETYPE"] = log.OPERATETYPE; param["OPERATORID"] = log.OPERATORID; param["PROJECTID"] = log.PROJECTID; param["COMPANYID"] = log.COMPANYID; param["OPERATECONTENT"] = log.OPERATECONTENT; param["OPERATEDATE"] = log.OPERATEDATE; connection.ExecuteNonQuery(strSql.ToString(), param); connection.CommitTranscation(); blSuccess = true; } } catch (Exception ex) { connection.RollbackTranscation(); LogHelper.WriteErr("修改公司分组信息时发生错误,分组Id:" + groupModel.ID, ex); } return(blSuccess); }
private ExprParamPair GenBlockExec(BlockExecute stmt, ParamList overlapCandidate) { Contract.Requires<ArgumentNullException>(stmt != null); Contract.Ensures(Contract.Result<ExprParamPair>() != null); var gen = new BlockGen(this); var block = gen.Generate(stmt.Block); return new ExprParamPair(block, null); }
public static IEnumerable<ParameterExpression> ToEnum(ParamList list) { while (list != null) { yield return list.Parameter; list = list.Next; } }
public static ParameterExpression Search(ParamList list, Predicate<ParameterExpression> pred) { for (var search = list; search != null; search = search.Next) if (pred(search.Parameter)) return search.Parameter; return null; }
public static ParamList Merge(ParamList left, ParamList right) { if (right == null) return left; for (; left != null; left = left.Next) { bool find = right.Contains(left.Parameter); if (find == false) right = new ParamList(left.Parameter, right); } return right; }
public static ParamList Intersect(ParamList left, ParamList right) { if (right == null) return right; ParamList result = null; for (; left != null; left = left.Next) { if (right.Contains(left.Parameter)) result = new ParamList(left.Parameter, result); } return result; }
public ParamList(ParameterExpression param, ParamList next) { Contract.Requires<ArgumentNullException>(param != null); this.Parameter = param; this.Next = next; }
// ----- ----- ----- ----- override ----- ----- ----- ----- protected override Expression GenLambdaParam(LambdaParameter elem) { var param = ParamList.Search(_params, p => p.Name == elem.Name); if (param != null) return param; param = Expression.Parameter(typeof(object), elem.Name); _params = new ParamList(param, _params); return param; }
/// <summary> /// 重建参数集合 /// </summary> /// <param name="lstPrm"></param> /// <returns></returns> public virtual ParamList RebuildParamList(ref string sql, ParamList lstPrm) { return(lstPrm); }
public IList <T> Execute <T>(string command, ParamList parameters) where T : class { return(PrepareSqlQuery <T>(command, parameters).ToArray()); }
private ExprParamPair GenChain(PhraseChain stmt, ParamList overlapCandidate) { Contract.Requires<ArgumentNullException>(stmt != null); Contract.Ensures(Contract.Result<ExprParamPair>() != null); Contract.Ensures(Contract.Result<ExprParamPair>().Expression != null); Contract.Ensures(Contract.Result<ExprParamPair>().Expression.Type != typeof(void)); ParamList assigned = null; Expression lastExpr = null; var exprs = new List<Expression>(); var local = new List<ParameterExpression>(); foreach (var ph in stmt.Phrases) { ParameterExpression tmpVar = null; if (lastExpr != null) { tmpVar = Expression.Parameter(lastExpr.Type); exprs.Add(Expression.Assign(tmpVar, lastExpr)); local.Add(tmpVar); } exprs.Add(DebugInfo(ph.Range)); var pair = GenPhrase(ph, tmpVar, assigned, overlapCandidate); assigned = ParamList.Merge(pair.Parameters, assigned); lastExpr = pair.Expression; } exprs.Add(lastExpr); return new ExprParamPair(Expression.Block(local, exprs), assigned); }
/// <summary> /// Invia richiesta con elenco parametri e buffer /// </summary> /// <param name="param"></param> /// <param name="buffer"></param> /// <returns></returns> private byte[] sendRequestQS(ParamList param, byte[] buffer, int offset, int length) { this.setResponse(0, string.Empty); try { using (WebClientEx oWebCli = new WebClientEx()) { oWebCli.TimeoutMSec = this.TimeoutMSec; // Imposta user e pass se non presenti if (!string.IsNullOrEmpty(this.mUser)) { this.mParams.Add(FS.PARAM_USER, this.mUser); this.mParams.Add(FS.PARAM_PASS, this.mPass); } // Reimposta valori path se necessario string sVPath = ""; if (param.TryGetValue(FS.PARAM_VPATH, out sVPath)) { try { param[FS.PARAM_VPATH] = this.getFullVPath(sVPath); } catch (Exception) { throw new ArgumentException("Il path virtuale fornito non e' valorizzato"); } } if (param.TryGetValue(FS.PARAM_VPATHDEST, out sVPath)) { try { param[FS.PARAM_VPATHDEST] = this.getFullVPath(sVPath); } catch (Exception) { throw new ArgumentException("Il path virtuale di destinazione fornito non e' valorizzato"); } } char cDelim = '?'; StringBuilder sbReq = new StringBuilder(); sbReq.Append(this.mUrl); foreach (KeyValuePair <string, string> oPair in param) { sbReq.Append(cDelim); sbReq.Append(oPair.Key); sbReq.Append("="); sbReq.Append(oPair.Value); cDelim = '&'; } // Esegue byte[] buf = null; if (buffer == null) { buf = oWebCli.DownloadData(sbReq.ToString()); } else { using (Stream oStream = oWebCli.OpenWrite(sbReq.ToString(), "POST")) { oStream.Write(buffer, offset, length); oStream.Flush(); oStream.Close(); } } // Testa esito this.checkResponse(oWebCli); // Ritorna buffer output return(buf); } } finally { this.mParams.Clear(); } }
private ExprParamPair GenDefValue(DefineValue ph, Expression prev, ParamList defined, ParamList overlapCandidate) { Contract.Requires<ArgumentNullException>(ph != null); if (ph.Value == null && prev == null) throw Error("値が指定されていません。", ph.Range.Start); if (ph.Value != null && prev != null) throw Error("値が二重に指定されています。", ph.Range.Start); ParameterExpression variable = ParamList.Search(overlapCandidate, p => p.Name == ph.Name) ?? Expression.Parameter(typeof(object), ph.Name); var value = prev ?? ElemGen.GenElem(ph.Value); var assign = Expression.Assign(variable, value); defined = new ParamList(variable, defined); return new ExprParamPair(assign, defined); }
public EnvironmentGraphics(AampFile aamp) { Root = aamp.RootNode; HemisphereLights.Clear(); FogObjects.Clear(); DirectionalLights.Clear(); BloomObjects.Clear(); SpotLights.Clear(); PointLights.Clear(); foreach (var obj in aamp.RootNode.childParams) { switch (obj.HashString) { case "AmbientLight": break; case "DirectionalLight": foreach (var child in obj.paramObjects) { DirectionalLights.Add(new DirectionalLight(child)); } break; case "HemisphereLight": foreach (var child in obj.paramObjects) { HemisphereLights.Add(new HemisphereLight(child)); } break; case "Fog": foreach (var child in obj.paramObjects) { FogObjects.Add(new Fog(child)); } break; case "BloomObj": foreach (var child in obj.paramObjects) { BloomObjects.Add(new BloomObj(child)); } break; case "PointLightRig": foreach (var child in obj.paramObjects) { PointLights.Add(new PointLightRig(child)); } Console.WriteLine($"PointLights {PointLights.Count}"); break; case "SpotLightRig": foreach (var child in obj.paramObjects) { SpotLights.Add(new SpotLightRig(child)); } Console.WriteLine($"SpotLights {SpotLights.Count}"); break; case "OfxLargeLensFlareRig": foreach (var child in obj.paramObjects) { LensFlareRigs.Add(new OfxLargeLensFlareRig(child)); } break; } } }
private void UpdateLocals(ParamList parameters, TextLocation location) { foreach (var param in ParamList.ToEnum(parameters)) { if (ParamList.Search(_locals, p => p.Name == param.Name) == null) { _locals = new ParamList(param, _locals); } else { throw Error("同じ名前の変数「" + param.Name + "」が二度宣言されています。", location); } } }
// ===== ===== ===== ===== ===== method ===== ===== ===== ===== ===== public Expression Generate(Block block) { Contract.Requires<ArgumentNullException>(block != null); Contract.Ensures(Contract.Result<Expression>() != null); if (block.Statements.Count == 0) return NullExpr; var list = new List<Expression> { DebugInfo(block.Range) }; foreach (var stmt in block.Statements) { var pair = GenStmt(stmt); if (pair.Parameters == null) { list.Add(pair.Expression); } else { var tmp = Expression.Parameter(pair.Expression.Type, "tmp_global_stmt"); var tmpLocal = new List<Expression>(); tmpLocal.Add(Expression.Assign(tmp, pair.Expression)); foreach (var p in ParamList.ToEnum(pair.Parameters)) tmpLocal.Add(AssignGlobal(p.Name, p)); tmpLocal.Add(tmp); var ps = new ParamList(tmp, pair.Parameters); list.Add(Expression.Block(ParamList.ToEnum(ps), tmpLocal)); Contract.Assume(list[list.Count - 1].Type == tmp.Type); } } var blockExpr = Expression.Block(list); if (Target == null) { return blockExpr; } else { return Expression.Label(Target, blockExpr); } }
private ExprParamPair GenNormalStmt(NormalStatement stmt, ParamList overlapCandidate) { Contract.Requires<ArgumentNullException>(stmt != null); Contract.Ensures(Contract.Result<ExprParamPair>() != null); if (stmt is Return) return GenReturn((Return)stmt, overlapCandidate); if (stmt is PhraseChain) return GenChain((PhraseChain)stmt, overlapCandidate); if (stmt is BlockExecute) return GenBlockExec((BlockExecute)stmt, overlapCandidate); Contract.Assert(false); throw new InvalidOperationException(); }
public IList <T> Execute <T>(string command, ParamList parameters) where T : class { return(new List <T>()); }
public void ProtectedNonDefaultConstructor_NonMixed_AllowProtected() { using (MixinConfiguration.BuildNew().EnterScope()) { Assert.That(ObjectFactory.Create <TargetClassWithProtectedCtors> (true, ParamList.Create(1)), Is.Not.Null); } }
public static DomainObjectWithSpecialConstructor NewObject(string s) { return(NewObject <DomainObjectWithSpecialConstructor>(ParamList.Create(s))); }
/// <summary> /// 清除值为空的条件,并给与1!=1的SQL /// </summary> private bool ClearCallSql() { if (ParamList != null && ParamList.Count > 0 && (ParamList.Last().Value == null || string.IsNullOrWhiteSpace(ParamList.Last().Value.ToString()))) { CurrentDbParameter = null; ParamList.RemoveAt(ParamList.Count - 1); SqlList.Pop(); SqlList.Pop(); SqlList.Push("1<>1"); return(true); } return(false); }
/// <summary> /// 游标分页 /// </summary> /// <typeparam name="T">实体类型</typeparam> /// <param name="lstParam">参数集合</param> /// <param name="sql">sql语句</param> /// <param name="objPage">分页实体</param> /// <param name="oper">数据库链接</param> /// <returns></returns> public IDataReader Query(string sql, ParamList lstParam, PageContent objPage, DataBaseOperate oper) { return(CursorPageCutter.Query(sql, lstParam, objPage, oper, null)); }
/// <summary> /// 获取总记录数 /// </summary> /// <param name="part">查询条件</param> /// <param name="list">变量列表</param> /// <param name="oper">通用类</param> private static long GetTotalRecord(ParamList list, DataBaseOperate oper, SelectCondition objCondition, PageContent objPage, Dictionary <string, bool> cacheTables) { long totalRecords = 0; StringBuilder sql = new StringBuilder(5000); if (objPage.MaxSelectRecords > 0) { sql.Append("select count(*) from (select top "); sql.Append(objPage.MaxSelectRecords.ToString()); sql.Append(" * from "); sql.Append(objCondition.Tables); sql.Append(""); if (objCondition.Condition.Length > 0) { sql.Append(" where "); sql.Append(objCondition.Condition.ToString()); } if (objCondition.GroupBy.Length > 0) { sql.Append(" group by "); sql.Append(objCondition.GroupBy.ToString()); } if (objCondition.Having.Length > 0) { sql.Append(" having "); sql.Append(objCondition.Having.ToString()); } sql.Append(") tab"); } else { sql.Append("select count(*) from "); sql.Append(objCondition.Tables); sql.Append(""); if (objCondition.Condition.Length > 0) { sql.Append(" where "); sql.Append(objCondition.Condition.ToString()); } if (objCondition.GroupBy.Length > 0) { sql.Append(" group by "); sql.Append(objCondition.GroupBy.ToString()); } if (objCondition.Having.Length > 0) { sql.Append(" having "); sql.Append(objCondition.Having.ToString()); } } IDataReader reader = oper.Query(sql.ToString(), list, cacheTables); try { if (reader.Read()) { if (!reader.IsDBNull(0)) { totalRecords = Convert.ToInt64(reader[0]); } } } finally { reader.Close(); } return(totalRecords); }
/// <summary> /// 生成分页SQL语句 /// </summary> /// <param name="list">参数列表</param> /// <param name="oper">连接对象</param> /// <param name="objCondition">条件对象</param> /// <param name="objPage">分页记录类</param> /// <returns></returns> public virtual string CreatePageSql(ParamList list, DataBaseOperate oper, SelectCondition objCondition, PageContent objPage, bool useCache) { return(CutPageSqlCreater.CreatePageSql(list, oper, objCondition, objPage, useCache)); }
/// <summary> /// Returns a new instance of a concrete domain object for the current <see cref="DomainObjects.ClientTransaction"/>. The object is constructed /// using the supplied constructor arguments in the <see cref="DomainObjects.ClientTransaction.Current"/> <see cref="DomainObjects.ClientTransaction"/>. /// </summary> /// <typeparam name="T">The concrete type to be implemented by the object.</typeparam> /// <param name="constructorParameters">A <see cref="ParamList"/> encapsulating the parameters to be passed to the constructor. Instantiate this /// by using one of the <see cref="ParamList.Create{A1,A2}"/> methods.</param> /// <returns>A new domain object instance.</returns> /// <remarks> /// <para> /// Objects created by this factory method are not directly instantiated; instead a proxy is dynamically created, which will assist in /// management tasks at runtime. /// </para> /// <para>This method should not be directly invoked by a user, but instead by static factory methods of classes derived from /// <see cref="DomainObject"/>.</para> /// <para>For more information, also see the constructor documentation (<see cref="DomainObject()"/>).</para> /// </remarks> /// <seealso cref="DomainObject()"/> /// <exception cref="ArgumentException">The type <typeparamref name="T"/> cannot be extended to a proxy, for example because it is sealed /// or abstract and non-instantiable.</exception> /// <exception cref="MissingMethodException">The given type <typeparamref name="T"/> does not implement the required protected /// constructor (see Remarks section). /// </exception> protected static T NewObject <T> (ParamList constructorParameters) where T : DomainObject { ArgumentUtility.CheckNotNull("constructorParameters", constructorParameters); return((T)LifetimeService.NewObject(ClientTransactionScope.CurrentTransaction, typeof(T), constructorParameters)); }
private ExprParamPair GenReturn(Return stmt, ParamList overlapCandidate) { Contract.Requires<ArgumentNullException>(stmt != null); Contract.Ensures(Contract.Result<ExprParamPair>() != null); var target = GetTarget(); var expr = Expression.Return(target, ElemGen.GenElem(stmt.Value), typeof(object)); return new ExprParamPair(expr, null); }
public void AllowNonPublic_True_WithoutModifications() { var instance1 = _nonModifyingPipeline.Create <DomainType> (ParamList.Create(7), allowNonPublicConstructor: true); var instance2 = (DomainType)_nonModifyingPipeline.Create(typeof(DomainType), ParamList.Create(8), allowNonPublicConstructor: true); Assert.That(instance1.String, Is.EqualTo("7")); Assert.That(instance2.String, Is.EqualTo("8")); }
/// <summary> /// 新增公司分组信息 /// </summary> /// <param name="groupModel"></param> /// <returns></returns> public static bool AddCompanyGroup(USER_SHARE_GROUPMODEL groupModel, List <USER_SHARE_VEHICLE_GROUPMODEL> lstVgModel, USER_SHARE_LOGMODEL log) { bool blSuccess = false; StringBuilder strSql = new StringBuilder(); strSql.Append("insert into USER_SHARE_GROUP("); strSql.Append("ID,COMPANYCODE,GROUPNAME,PARENTID,STATE,GRADE,VEHICLENUM,GROUPDESC)"); strSql.Append(" values ("); strSql.Append(":ID,:COMPANYCODE,:GROUPNAME,:PARENTID,:STATE,:GRADE,:VEHICLENUM,:GROUPDESC)"); ParamList param = new ParamList(); param["ID"] = groupModel.ID; param["COMPANYCODE"] = groupModel.COMPANYCODE; param["GROUPNAME"] = groupModel.GROUPNAME; param["PARENTID"] = groupModel.PARENTID; param["STATE"] = groupModel.STATE; param["GRADE"] = groupModel.GRADE; param["VEHICLENUM"] = groupModel.VEHICLENUM; param["GROUPDESC"] = groupModel.GROUPDESC; IConnectionProvider connection = ConnectionProviderBuilder.CreateConnectionProvider(); try { using (connection) { connection.BeginTranscation(); //增加分组信息 connection.ExecuteNonQuery(strSql.ToString(), param); param.Clear(); string strSqlFun = string.Empty; //分组车辆 foreach (USER_SHARE_VEHICLE_GROUPMODEL vgModel in lstVgModel) { strSqlFun = string.Format("insert into USER_SHARE_VEHICLE_GROUP(SHAREGROUPID,TARGETID,MACID)values(:SHAREGROUPID,:TARGETID,:MACID)"); param.Clear(); param["SHAREGROUPID"] = groupModel.ID; param["TARGETID"] = vgModel.TARGETID; param["MACID"] = vgModel.MACID; connection.ExecuteNonQuery(strSqlFun, param); } //操作日志 strSql = new StringBuilder(); strSql.Append("insert into USER_SHARE_LOG("); strSql.Append("LOGID,OPERATETYPE,OPERATORID,PROJECTID,COMPANYID,OPERATECONTENT,OPERATEDATE)"); strSql.Append(" values ("); strSql.Append(":LOGID,:OPERATETYPE,:OPERATORID,:PROJECTID,:COMPANYID,:OPERATECONTENT,:OPERATEDATE)"); param.Clear(); param["LOGID"] = log.LOGID; param["OPERATETYPE"] = log.OPERATETYPE; param["OPERATORID"] = log.OPERATORID; param["PROJECTID"] = log.PROJECTID; param["COMPANYID"] = log.COMPANYID; param["OPERATECONTENT"] = log.OPERATECONTENT; param["OPERATEDATE"] = log.OPERATEDATE; connection.ExecuteNonQuery(strSql.ToString(), param); connection.CommitTranscation(); blSuccess = true; } } catch (Exception ex) { connection.RollbackTranscation(); LogHelper.WriteErr("新增公司车辆分组信息时发生错误,分组名称:" + groupModel.GROUPNAME, ex); } return(blSuccess); }
/// <summary> /// 修改角色信息 /// </summary> /// <param name="roleModel"></param> /// <returns></returns> public static bool EditRole(USER_SHARE_ROLESMODEL roleModel, string strFunIds, string strGroupIds, List <RoleAccountModel> lstRaModel, USER_SHARE_LOGMODEL log) { bool blSuccess = false; StringBuilder strSql = new StringBuilder(); strSql.Append("update USER_SHARE_ROLES set "); strSql.Append("ROLENAME=:ROLENAME,"); strSql.Append("ROLEDESC=:ROLEDESC,"); strSql.Append("PROJECTID=:PROJECTID,"); strSql.Append("COMPANYID=:COMPANYID,"); strSql.Append("STATUS=:STATUS"); strSql.Append(" where ROLEID=:ROLEID "); ParamList param = new ParamList(); param["ROLEID"] = roleModel.ROLEID; param["ROLENAME"] = roleModel.ROLENAME; param["ROLEDESC"] = roleModel.ROLEDESC; param["PROJECTID"] = roleModel.PROJECTID; param["COMPANYID"] = roleModel.COMPANYID; param["STATUS"] = roleModel.STATUS; IConnectionProvider connection = ConnectionProviderBuilder.CreateConnectionProvider(); try { using (connection) { connection.BeginTranscation(); //修改账号信息 connection.ExecuteNonQuery(strSql.ToString(), param); param.Clear(); //角色功能 //删除旧的信息 string strSqlFun = "DELETE FROM USER_SHARE_ROLEFUN WHERE ROLEID=" + roleModel.ROLEID; connection.ExecuteNonQuery(strSqlFun); //新的信息插入 if (strFunIds.Trim().Length > 0) { string[] funId = strFunIds.Split(','); foreach (string str in funId) { if (str.Trim().Length > 0) { strSqlFun = string.Format("INSERT INTO USER_SHARE_ROLEFUN(ROLEID,FUNID) VALUES({0},{1}) ", roleModel.ROLEID, str); connection.ExecuteNonQuery(strSqlFun); } } } //角色下的账号更新 foreach (RoleAccountModel raModel in lstRaModel) { //修改时账号角色更新 if (raModel.IsChecked) { strSqlFun = string.Format(@"UPDATE USER_SHARE_ACCOUNT SET ROLEIDS=(CASE WHEN REPLACE(ROLEIDS,',{0},',',')=',' OR ROLEIDS IS NULL THEN ',{0},' ELSE REPLACE(ROLEIDS,',{0},',',')||'{0},' end) WHERE ACCOUNTID={1} ", roleModel.ROLEID, raModel.AccountId); } else { strSqlFun = string.Format(@"UPDATE USER_SHARE_ACCOUNT SET ROLEIDS=(CASE WHEN REPLACE(ROLEIDS,',{0},',',')=',' OR ROLEIDS IS NULL THEN '' ELSE REPLACE(ROLEIDS,',{0},',',') end) WHERE ACCOUNTID={1} ", roleModel.ROLEID, raModel.AccountId); } connection.ExecuteNonQuery(strSqlFun); } //车辆分组 //删除旧的信息 strSqlFun = "DELETE FROM USER_SHARE_ROLE_GROUP WHERE ROLEID=" + roleModel.ROLEID; connection.ExecuteNonQuery(strSqlFun); //新的信息插入 if (strGroupIds.Trim().Length > 0) { string[] funId = strGroupIds.Split(','); foreach (string str in funId) { if (str.Trim().Length > 0) { strSqlFun = string.Format("INSERT INTO USER_SHARE_ROLE_GROUP(ROLEID,SHAREGROUPID) VALUES({0},{1}) ", roleModel.ROLEID, str); connection.ExecuteNonQuery(strSqlFun); } } } //操作日志 strSql = new StringBuilder(); strSql.Append("insert into USER_SHARE_LOG("); strSql.Append("LOGID,OPERATETYPE,OPERATORID,PROJECTID,COMPANYID,OPERATECONTENT,OPERATEDATE)"); strSql.Append(" values ("); strSql.Append(":LOGID,:OPERATETYPE,:OPERATORID,:PROJECTID,:COMPANYID,:OPERATECONTENT,:OPERATEDATE)"); param["LOGID"] = log.LOGID; param["OPERATETYPE"] = log.OPERATETYPE; param["OPERATORID"] = log.OPERATORID; param["PROJECTID"] = log.PROJECTID; param["COMPANYID"] = log.COMPANYID; param["OPERATECONTENT"] = log.OPERATECONTENT; param["OPERATEDATE"] = log.OPERATEDATE; connection.ExecuteNonQuery(strSql.ToString(), param); connection.CommitTranscation(); blSuccess = true; } } catch (Exception ex) { connection.RollbackTranscation(); LogHelper.WriteErr("修改角色信息时发生错误,角色Id:" + roleModel.ROLEID, ex); } return(blSuccess); }
/// <summary> /// Invia richiesta /// </summary> /// <param name="param"></param> /// <returns></returns> private byte[] sendRequest(ParamList param) { return(this.sendRequest(param, null, 0, 0)); }
void SetupInput() { ParamList pl = new ParamList(); IntPtr windowHnd; window.GetCustomAttribute("WINDOW", out windowHnd); // window is your RenderWindow! pl.Insert("WINDOW", windowHnd.ToString()); InputManager = InputManager.CreateInputSystem(pl); InputKeyboard = (Keyboard) InputManager.CreateInputObject(MOIS.Type.OISKeyboard, true); InputKeyboard.KeyPressed += new KeyListener.KeyPressedHandler(InputKeyboard_KeyPressed); }
public static TypeWithReference Create(TypeWithReference firstValue, TypeWithReference secondValue) { return(ObjectFactory.Create <TypeWithReference> (true, ParamList.Create(firstValue, secondValue))); }
// ===== ===== ===== ===== ===== method ===== ===== ===== ===== ===== public ExprParamPair Generate(Defun stmt) { Contract.Requires<ArgumentNullException>(stmt != null); // prepare var funcType = ExpressionHelper.GetFuncType(stmt.Params.Count); var sfxFuncType = typeof(SuffixFunc<>).MakeGenericType(funcType); var funcTarget = Expression.Parameter(sfxFuncType, stmt.Name); var ps = ParamList.FromEnum(stmt.Params.Select(p => Expression.Parameter(typeof(object), p.Name))); _parameters = new ParamList(funcTarget, ps); // generate block var gen = new BlockGen(this); var block = gen.Generate(stmt.Block); // crean up var lambda = Expression.Lambda(block, stmt.Name, ParamList.ToEnum(_parameters.Next)); var ctorInfo = sfxFuncType.GetConstructor(new[] { funcType, typeof(string[]) }); var sfxs = stmt.Params.Select(pair => pair.Suffix).ToArray(); var createExpr = Expression.New(ctorInfo, lambda, Expression.Constant(sfxs)); return new ExprParamPair(Expression.Assign(funcTarget, createExpr), new ParamList(funcTarget, null)); }
public bool GenerateBgmPrcFile(List <BgmDbNewEntry> bgmEntries, string outputFilePath) { var saveNoIndex = (short)(_coreBgmDb.OrderByDescending(p => p.SaveNo).First().SaveNo + 1); var testDispOrderIndex = (short)(_coreBgmDb.OrderByDescending(p => p.TestDispOrder).First().TestDispOrder + 1); var menuValueIndex = _coreBgmDb.OrderByDescending(p => p.MenuValue).First().MenuValue + 1; var t = new ParamFile(); t.Open(_resourceService.GetBgmDbResource()); //DBROOT var dbRoot = t.Root.Nodes[HEX_CAT_DBROOT] as ParamList; foreach (var bgmEntry in bgmEntries) { var newEntry = dbRoot.Nodes[1].Clone() as ParamStruct; SetNodeParamValue(newEntry, HEX_UI_BGM_ID, bgmEntry.UiBgmId); SetNodeParamValue(newEntry, HEX_STREAM_SET_ID, bgmEntry.StreamSetId); SetNodeParamValue(newEntry, HEX_RARITY, bgmEntry.Rarity); SetNodeParamValue(newEntry, HEX_RECORD_TYPE, bgmEntry.RecordType); SetNodeParamValue(newEntry, HEX_UI_GAMETITLE_ID, bgmEntry.UiGameTitleId); SetNodeParamValue(newEntry, HEX_NAME_ID, bgmEntry.NameId); //SetNodeParamValue(newEntry, HEX_SAVE_NO, saveNoIndex); SetNodeParamValue(newEntry, HEX_TEST_DISP_ORDER, testDispOrderIndex); SetNodeParamValue(newEntry, HEX_MENU_VALUE, menuValueIndex); SetNodeParamValue(newEntry, HEX_SHOP_PRICE, (uint)0); dbRoot.Nodes.Add(newEntry); saveNoIndex++; testDispOrderIndex++; menuValueIndex++; } //STREAM_SET var streamSet = t.Root.Nodes[HEX_CAT_STREAM_SET] as ParamList; foreach (var bgmEntry in bgmEntries) { var newEntry = streamSet.Nodes[0].Clone() as ParamStruct; SetNodeParamValue(newEntry, HEX_STREAM_SET_ID, bgmEntry.StreamSetId); SetNodeParamValue(newEntry, HEX_INFO0, bgmEntry.Info0); streamSet.Nodes.Add(newEntry); } //ASSIGNED_INFO var assignedInfo = t.Root.Nodes[HEX_CAT_ASSIGNED_INFO] as ParamList; foreach (var bgmEntry in bgmEntries) { var newEntry = assignedInfo.Nodes[0].Clone() as ParamStruct; SetNodeParamValue(newEntry, HEX_INFO_ID, bgmEntry.InfoId); SetNodeParamValue(newEntry, HEX_STREAM_ID, bgmEntry.StreamId); assignedInfo.Nodes.Add(newEntry); } //STREAM_PROPERTY var streamProperty = t.Root.Nodes[HEX_CAT_STREAM_PROPERTY] as ParamList; foreach (var bgmEntry in bgmEntries) { var newEntry = streamProperty.Nodes[0].Clone() as ParamStruct; SetNodeParamValue(newEntry, HEX_STREAM_ID, bgmEntry.StreamId); SetNodeParamValue(newEntry, HEX_DATA_NAME0, bgmEntry.DataName0); streamProperty.Nodes.Add(newEntry); } //BGM PLAYLIST (QUICK & DIRTY) foreach (var bgmEntry in bgmEntries) { if (bgmEntry.Playlists == null) { continue; } foreach (var playlist in bgmEntry.Playlists) { var playlistId = playlist.Id; if (!playlistId.StartsWith("bgm")) { _logger.LogWarning("The playlist_id for song '{Song}' must start with 'bgm', skipping...", bgmEntry.ToneName); continue; } var hexValue = Hash40Util.StringToHash40(playlistId); ParamList bgmPlaylist = null; ParamStruct newEntry = null; //If the playlist doesn't exist... if (!t.Root.Nodes.ContainsKey(hexValue)) { var playlistToClone = t.Root.Nodes[HEX_PLAYLIST_EXAMPLE] as ParamList; bgmPlaylist = playlistToClone.Clone() as ParamList; t.Root.Nodes.Add(hexValue, bgmPlaylist); if (bgmPlaylist.Nodes.Count > 1) { bgmPlaylist.Nodes.RemoveRange(1, bgmPlaylist.Nodes.Count - 1); newEntry = bgmPlaylist.Nodes[0] as ParamStruct; } } else { bgmPlaylist = t.Root.Nodes[hexValue] as ParamList; newEntry = bgmPlaylist.Nodes[0].Clone() as ParamStruct; bgmPlaylist.Nodes.Add(newEntry); } //Add song SetNodeParamValue(newEntry, HEX_UI_BGM_ID, bgmEntry.UiBgmId); for (int i = 0; i <= 15; i++) { SetNodeParamValue(newEntry, string.Format(HEX_ORDERNBR, i), (short)(bgmPlaylist.Nodes.Count)); SetNodeParamValue(newEntry, string.Format(HEX_INCIDENCENBR, i), (ushort)500); } } } t.Save(outputFilePath); return(true); }
private void AutodetectSettings(bool bReset) { if (bReset) { EditorTargetsList = null; ClientCookedTargetsList = null; ServerCookedTargetsList = null; ProgramTargetsList = null; ProjectBinariesPath = null; ProjectGameExePath = null; } var Properties = ProjectUtils.GetProjectProperties(RawProjectPath, ClientTargetPlatforms); bUsesSteam = Properties.bUsesSteam; bUsesCEF3 = Properties.bUsesCEF3; bUsesSlate = Properties.bUsesSlate; bUsesSlateEditorStyle = Properties.bUsesSlateEditorStyle; bDebugBuildsActuallyUseDebugCRT = Properties.bDebugBuildsActuallyUseDebugCRT; bIsCodeBasedProject = Properties.bIsCodeBasedProject; DetectedTargets = Properties.Targets; LoadedEngineConfigs = Properties.EngineConfigs; LoadedGameConfigs = Properties.GameConfigs; var GameTarget = String.Empty; var EditorTarget = String.Empty; var ServerTarget = String.Empty; var ProgramTarget = String.Empty; var ProjectType = TargetRules.TargetType.Game; if (GlobalCommandLine.Rocket) { if (!CommandUtils.CmdEnv.HasCapabilityToCompile || !bIsCodeBasedProject) { if (bIsCodeBasedProject) { var ShortName = ProjectUtils.GetShortProjectName(RawProjectPath); GameTarget = ShortName; EditorTarget = ShortName + "Editor"; ServerTarget = ShortName + "Server"; } else { GameTarget = "UE4Game"; EditorTarget = "UE4Editor"; //ServerTarget = "RocketServer"; Build = false; } } else { SingleTargetProperties TargetData; if (DetectedTargets.TryGetValue(TargetRules.TargetType.Editor, out TargetData)) { EditorTarget = TargetData.TargetName; } if (DetectedTargets.TryGetValue(TargetRules.TargetType.Program, out TargetData)) { ProgramTarget = TargetData.TargetName; } //DetectedTargets.TryGetValue(TargetRules.TargetType.Server, out ServerTarget); if (string.IsNullOrEmpty(GameTarget)) { if (DetectedTargets.TryGetValue(TargetRules.TargetType.Game, out TargetData)) { GameTarget = TargetData.TargetName; } } } } else if (!bIsCodeBasedProject) { GameTarget = "UE4Game"; EditorTarget = "UE4Editor"; ServerTarget = "UE4Server"; } else if (!CommandUtils.CmdEnv.HasCapabilityToCompile) { var ShortName = ProjectUtils.GetShortProjectName(RawProjectPath); GameTarget = ShortName; EditorTarget = ShortName + "Editor"; ServerTarget = ShortName + "Server"; } else if (!CommandUtils.IsNullOrEmpty(Properties.Targets)) { SingleTargetProperties TargetData; var GameTargetType = TargetRules.TargetType.Game; if( Client ) { if( HasClientTargetDetected ) { GameTargetType = TargetRules.TargetType.Client; } else { throw new AutomationException( "Client target not found!" ); } } var ValidGameTargetTypes = new TargetRules.TargetType[] { GameTargetType, TargetRules.TargetType.Program }; foreach (var ValidTarget in ValidGameTargetTypes) { if (DetectedTargets.TryGetValue(ValidTarget, out TargetData)) { GameTarget = TargetData.TargetName; bDebugBuildsActuallyUseDebugCRT = TargetData.Rules.bDebugBuildsActuallyUseDebugCRT; bUsesSlate = TargetData.Rules.bUsesSlate; bUsesSlateEditorStyle = TargetData.Rules.bUsesSlateEditorStyle; bUsesSteam = TargetData.Rules.bUsesSteam; bUsesCEF3 = TargetData.Rules.bUsesCEF3; ProjectType = ValidTarget; break; } } if (DetectedTargets.TryGetValue(TargetRules.TargetType.Editor, out TargetData)) { EditorTarget = TargetData.TargetName; } if (DetectedTargets.TryGetValue(TargetRules.TargetType.Server, out TargetData)) { ServerTarget = TargetData.TargetName; } if (DetectedTargets.TryGetValue(TargetRules.TargetType.Program, out TargetData)) { ProgramTarget = TargetData.TargetName; } } else if (!CommandUtils.IsNullOrEmpty(Properties.Programs)) { SingleTargetProperties TargetData = Properties.Programs[0]; bDebugBuildsActuallyUseDebugCRT = TargetData.Rules.bDebugBuildsActuallyUseDebugCRT; bUsesSlate = TargetData.Rules.bUsesSlate; bUsesSlateEditorStyle = TargetData.Rules.bUsesSlateEditorStyle; bUsesSteam = TargetData.Rules.bUsesSteam; bUsesCEF3 = TargetData.Rules.bUsesCEF3; ProjectType = TargetRules.TargetType.Program; ProgramTarget = TargetData.TargetName; GameTarget = TargetData.TargetName; } else if (!this.Build) { var ShortName = ProjectUtils.GetShortProjectName(RawProjectPath); GameTarget = ShortName; EditorTarget = ShortName + "Editor"; ServerTarget = ShortName + "Server"; } else { throw new AutomationException("{0} does not look like uproject file but no targets have been found!", RawProjectPath); } IsProgramTarget = ProjectType == TargetRules.TargetType.Program; if (String.IsNullOrEmpty(EditorTarget) && ProjectType != TargetRules.TargetType.Program && CommandUtils.IsNullOrEmpty(EditorTargetsList) && !Rocket) { if (Properties.bWasGenerated) { EditorTarget = "UE4Editor"; } else { throw new AutomationException("Editor target not found!"); } } if (String.IsNullOrEmpty(GameTarget) && Run && !NoClient && (Cook || CookOnTheFly) && CommandUtils.IsNullOrEmpty(ClientCookedTargetsList) && !Rocket) { throw new AutomationException("Game target not found. Game target is required with -cook or -cookonthefly"); } if (EditorTargetsList == null) { if (!GlobalCommandLine.NoCompile && !GlobalCommandLine.NoCompileEditor && (ProjectType != TargetRules.TargetType.Program) && !String.IsNullOrEmpty(EditorTarget)) { EditorTargetsList = new ParamList<string>(EditorTarget); } else { EditorTargetsList = new ParamList<string>(); } } if (ProgramTargetsList == null) { if (ProjectType == TargetRules.TargetType.Program) { ProgramTargetsList = new ParamList<string>(ProgramTarget); } else { ProgramTargetsList = new ParamList<string>(); } } if (ClientCookedTargetsList == null && !NoClient && (Cook || CookOnTheFly || Prebuilt)) { if (String.IsNullOrEmpty(GameTarget)) { throw new AutomationException("Game target not found. Game target is required with -cook or -cookonthefly"); } else { ClientCookedTargetsList = new ParamList<string>(GameTarget); } } else if (ClientCookedTargetsList == null) { ClientCookedTargetsList = new ParamList<string>(); } if (ServerCookedTargetsList == null && DedicatedServer && (Cook || CookOnTheFly)) { if (String.IsNullOrEmpty(ServerTarget)) { throw new AutomationException("Server target not found. Server target is required with -server and -cook or -cookonthefly"); } ServerCookedTargetsList = new ParamList<string>(ServerTarget); } else if (ServerCookedTargetsList == null) { ServerCookedTargetsList = new ParamList<string>(); } if (String.IsNullOrEmpty(ProjectBinariesPath) || String.IsNullOrEmpty(ProjectGameExePath)) { if ( ClientTargetPlatforms.Count > 0 ) { var ProjectClientBinariesPath = ProjectUtils.GetClientProjectBinariesRootPath(RawProjectPath, ProjectType, Properties.bIsCodeBasedProject); ProjectBinariesPath = ProjectUtils.GetProjectClientBinariesFolder(ProjectClientBinariesPath, ClientTargetPlatforms[0]); ProjectGameExePath = CommandUtils.CombinePaths(ProjectBinariesPath, GameTarget + Platform.GetExeExtension(ClientTargetPlatforms[0])); } } // for the moment, allow the commandline to override the ini if set. This will keep us from breaking licensee packaging scripts until we have // the full solution for per-platform packaging settings. if (!Manifests) { ConfigCacheIni GameIni = new ConfigCacheIni("Game", Path.GetDirectoryName(RawProjectPath)); String IniPath = "/Script/UnrealEd.ProjectPackagingSettings"; bool bSetting = false; if (!GameIni.GetBool(IniPath, "bGenerateChunks", out bSetting)) { Manifests = bSetting; } } }
public EnvironmentGraphics() { Root = new ParamList(); InitiallizeArea(); }
private void AutodetectSettings(bool bReset) { if (bReset) { EditorTargetsList = null; ClientCookedTargetsList = null; ServerCookedTargetsList = null; ProgramTargetsList = null; ProjectBinariesPath = null; ProjectGameExePath = null; } List<UnrealTargetPlatform> ClientTargetPlatformTypes = ClientTargetPlatforms.ConvertAll(x => x.Type).Distinct().ToList(); var Properties = ProjectUtils.GetProjectProperties(RawProjectPath, ClientTargetPlatformTypes, RunAssetNativization); bUsesSteam = Properties.bUsesSteam; bUsesCEF3 = Properties.bUsesCEF3; bUsesSlate = Properties.bUsesSlate; bUsesSlateEditorStyle = Properties.bUsesSlateEditorStyle; bDebugBuildsActuallyUseDebugCRT = Properties.bDebugBuildsActuallyUseDebugCRT; bIsCodeBasedProject = Properties.bIsCodeBasedProject; DetectedTargets = Properties.Targets; LoadedEngineConfigs = Properties.EngineConfigs; LoadedGameConfigs = Properties.GameConfigs; var GameTarget = String.Empty; var EditorTarget = String.Empty; var ServerTarget = String.Empty; var ProgramTarget = String.Empty; var ProjectType = TargetRules.TargetType.Game; if (!bIsCodeBasedProject) { GameTarget = "UE4Game"; EditorTarget = "UE4Editor"; ServerTarget = "UE4Server"; } else if (!CommandUtils.CmdEnv.HasCapabilityToCompile) { var ShortName = ProjectUtils.GetShortProjectName(RawProjectPath); GameTarget = ShortName; EditorTarget = ShortName + "Editor"; ServerTarget = ShortName + "Server"; } else if (!CommandUtils.IsNullOrEmpty(Properties.Targets)) { SingleTargetProperties TargetData; var GameTargetType = TargetRules.TargetType.Game; if( Client ) { if( HasClientTargetDetected ) { GameTargetType = TargetRules.TargetType.Client; } else { throw new AutomationException( "Client target not found!" ); } } var ValidGameTargetTypes = new TargetRules.TargetType[] { GameTargetType, TargetRules.TargetType.Program }; foreach (var ValidTarget in ValidGameTargetTypes) { if (DetectedTargets.TryGetValue(ValidTarget, out TargetData)) { GameTarget = TargetData.TargetName; bDebugBuildsActuallyUseDebugCRT = TargetData.Rules.bDebugBuildsActuallyUseDebugCRT; bUsesSlate = TargetData.Rules.bUsesSlate; bUsesSlateEditorStyle = TargetData.Rules.bUsesSlateEditorStyle; bUsesSteam = TargetData.Rules.bUsesSteam; bUsesCEF3 = TargetData.Rules.bUsesCEF3; ProjectType = ValidTarget; break; } } if (DetectedTargets.TryGetValue(TargetRules.TargetType.Editor, out TargetData)) { EditorTarget = TargetData.TargetName; } if (DetectedTargets.TryGetValue(TargetRules.TargetType.Server, out TargetData)) { ServerTarget = TargetData.TargetName; } if (DetectedTargets.TryGetValue(TargetRules.TargetType.Program, out TargetData)) { ProgramTarget = TargetData.TargetName; } } else if (!CommandUtils.IsNullOrEmpty(Properties.Programs)) { SingleTargetProperties TargetData = Properties.Programs[0]; bDebugBuildsActuallyUseDebugCRT = TargetData.Rules.bDebugBuildsActuallyUseDebugCRT; bUsesSlate = TargetData.Rules.bUsesSlate; bUsesSlateEditorStyle = TargetData.Rules.bUsesSlateEditorStyle; bUsesSteam = TargetData.Rules.bUsesSteam; bUsesCEF3 = TargetData.Rules.bUsesCEF3; ProjectType = TargetRules.TargetType.Program; ProgramTarget = TargetData.TargetName; GameTarget = TargetData.TargetName; } else if (!this.Build) { var ShortName = ProjectUtils.GetShortProjectName(RawProjectPath); GameTarget = ShortName; EditorTarget = ShortName + "Editor"; ServerTarget = ShortName + "Server"; } else { throw new AutomationException("{0} does not look like uproject file but no targets have been found!", RawProjectPath); } IsProgramTarget = ProjectType == TargetRules.TargetType.Program; if (String.IsNullOrEmpty(EditorTarget) && ProjectType != TargetRules.TargetType.Program && CommandUtils.IsNullOrEmpty(EditorTargetsList)) { if (Properties.bWasGenerated) { EditorTarget = "UE4Editor"; } else { throw new AutomationException("Editor target not found!"); } } if (String.IsNullOrEmpty(GameTarget) && Run && !NoClient && (Cook || CookOnTheFly) && CommandUtils.IsNullOrEmpty(ClientCookedTargetsList)) { throw new AutomationException("Game target not found. Game target is required with -cook or -cookonthefly"); } if (EditorTargetsList == null) { if (!GlobalCommandLine.NoCompileEditor && (ProjectType != TargetRules.TargetType.Program) && !String.IsNullOrEmpty(EditorTarget)) { EditorTargetsList = new ParamList<string>(EditorTarget); } else { EditorTargetsList = new ParamList<string>(); } } if (ProgramTargetsList == null) { if (ProjectType == TargetRules.TargetType.Program) { ProgramTargetsList = new ParamList<string>(ProgramTarget); } else { ProgramTargetsList = new ParamList<string>(); } } if (ClientCookedTargetsList == null && !NoClient && (Cook || CookOnTheFly || Prebuilt)) { if (String.IsNullOrEmpty(GameTarget)) { throw new AutomationException("Game target not found. Game target is required with -cook or -cookonthefly"); } else { ClientCookedTargetsList = new ParamList<string>(GameTarget); } } else if (ClientCookedTargetsList == null) { ClientCookedTargetsList = new ParamList<string>(); } if (ServerCookedTargetsList == null && DedicatedServer && (Cook || CookOnTheFly)) { if (String.IsNullOrEmpty(ServerTarget)) { throw new AutomationException("Server target not found. Server target is required with -server and -cook or -cookonthefly"); } ServerCookedTargetsList = new ParamList<string>(ServerTarget); } else if (ServerCookedTargetsList == null) { ServerCookedTargetsList = new ParamList<string>(); } if (String.IsNullOrEmpty(ProjectBinariesPath) || String.IsNullOrEmpty(ProjectGameExePath)) { if ( ClientTargetPlatforms.Count > 0 ) { var ProjectClientBinariesPath = ProjectUtils.GetClientProjectBinariesRootPath(RawProjectPath, ProjectType, Properties.bIsCodeBasedProject); ProjectBinariesPath = ProjectUtils.GetProjectClientBinariesFolder(ProjectClientBinariesPath, ClientTargetPlatforms[0].Type); ProjectGameExePath = CommandUtils.CombinePaths(ProjectBinariesPath, GameTarget + Platform.GetExeExtension(ClientTargetPlatforms[0].Type)); } } }
/// <summary> /// 新增角色信息 /// </summary> /// <param name="roleModel"></param> /// <returns></returns> public static bool AddARole(USER_SHARE_ROLESMODEL roleModel, string strFunIds, string strGroupIds, List <RoleAccountModel> lstRaModel, USER_SHARE_LOGMODEL log) { bool blSuccess = false; StringBuilder strSql = new StringBuilder(); strSql.Append("insert into USER_SHARE_ROLES("); strSql.Append("ROLEID,ROLENAME,ROLEDESC,PROJECTID,COMPANYID,STATUS,CREATORID,CREATEDATE)"); strSql.Append(" values ("); strSql.Append(":ROLEID,:ROLENAME,:ROLEDESC,:PROJECTID,:COMPANYID,:STATUS,:CREATORID,:CREATEDATE)"); ParamList param = new ParamList(); param["ROLEID"] = roleModel.ROLEID; param["ROLENAME"] = roleModel.ROLENAME; param["ROLEDESC"] = roleModel.ROLEDESC; param["PROJECTID"] = roleModel.PROJECTID; param["COMPANYID"] = roleModel.COMPANYID; param["STATUS"] = roleModel.STATUS; param["CREATORID"] = roleModel.CreatorId; param["CREATEDATE"] = roleModel.CreateDate; IConnectionProvider connection = ConnectionProviderBuilder.CreateConnectionProvider(); try { using (connection) { connection.BeginTranscation(); //增加角色信息 connection.ExecuteNonQuery(strSql.ToString(), param); param.Clear(); string strSqlFun = string.Empty; //角色功能 if (strFunIds.Trim().Length > 0) { string[] funId = strFunIds.Split(','); foreach (string str in funId) { if (str.Trim().Length > 0) { strSqlFun = string.Format("INSERT INTO USER_SHARE_ROLEFUN(ROLEID,FUNID) VALUES({0},{1}) ", roleModel.ROLEID, str); connection.ExecuteNonQuery(strSqlFun); } } } //角色下的账号更新 foreach (RoleAccountModel raModel in lstRaModel) { //新增时选中的账号,角色更新,未选中的不用做处理 if (raModel.IsChecked) { strSqlFun = string.Format("UPDATE USER_SHARE_ACCOUNT SET ROLEIDS=(ROLEIDS||(CASE WHEN ROLEIDS IS NULL THEN ',{0},' ELSE '{0},' END )) WHERE ACCOUNTID={1} ", roleModel.ROLEID, raModel.AccountId); connection.ExecuteNonQuery(strSqlFun); } } //拥有权限的车辆分组 if (strGroupIds.Trim().Length > 0) { string[] funId = strGroupIds.Split(','); foreach (string str in funId) { if (str.Trim().Length > 0) { strSqlFun = string.Format("INSERT INTO USER_SHARE_ROLE_GROUP(ROLEID,SHAREGROUPID) VALUES({0},{1}) ", roleModel.ROLEID, str); connection.ExecuteNonQuery(strSqlFun); } } } //操作日志 strSql = new StringBuilder(); strSql.Append("insert into USER_SHARE_LOG("); strSql.Append("LOGID,OPERATETYPE,OPERATORID,PROJECTID,COMPANYID,OPERATECONTENT,OPERATEDATE)"); strSql.Append(" values ("); strSql.Append(":LOGID,:OPERATETYPE,:OPERATORID,:PROJECTID,:COMPANYID,:OPERATECONTENT,:OPERATEDATE)"); param["LOGID"] = log.LOGID; param["OPERATETYPE"] = log.OPERATETYPE; param["OPERATORID"] = log.OPERATORID; param["PROJECTID"] = log.PROJECTID; param["COMPANYID"] = log.COMPANYID; param["OPERATECONTENT"] = log.OPERATECONTENT; param["OPERATEDATE"] = log.OPERATEDATE; connection.ExecuteNonQuery(strSql.ToString(), param); connection.CommitTranscation(); blSuccess = true; } } catch (Exception ex) { connection.RollbackTranscation(); LogHelper.WriteErr("新增角色信息时发生错误,角色名称:" + roleModel.ROLENAME, ex); } return(blSuccess); }
public ExprParamPair(Expression expr, ParamList paramList) { Contract.Requires<ArgumentNullException>(expr != null); Contract.Requires<ArgumentException>(expr.Type != typeof(void)); this.Expression = expr; this.Parameters = paramList; }
/// <summary> /// Creates the instance. /// </summary> /// <param name="parameters">The parameters.</param> /// <returns></returns> public static InputManager CreateInstance(ParamList parameters) { int count; NameValueItem[] items = NameValueItem.ToArray(parameters, out count); IInputManager native = Static.CreateInputSystem(items, count); if (native == null) throw new OISException("Could not create an InputManager instance"); return new InputManager(native); }
/// <summary> /// 将查询命令和条件转换为 SQL 语句 /// </summary> /// <returns></returns> public string ToSQL() { Type mastertype = typeof(T); string tableName = MyStagingUtils.GetMapping(mastertype); // master table StringBuilder sqlText = new StringBuilder(); sqlText.AppendLine($"SELECT {string.Join(",", Fields)} FROM {tableName} {masterAlisName}"); // union int _index = 2; foreach (var item in UnionList) { DbExpressionVisitor expression = new DbExpressionVisitor { TypeMaster = item.MasterType, AliasMaster = item.AlisName, AliasUnion = item.UnionAlisName }; expression.Visit(item.Body); string unionTableName = MyStagingUtils.GetMapping(item.Model); sqlText.AppendLine(item.UnionType.ToString().Replace("_", " ") + " " + unionTableName + " " + expression.AliasUnion + " ON " + expression.SqlText.Builder.ToString()); ParamList.AddRange(expression.SqlText.Parameters); _index++; } // condition if (WhereExpressionList.Count > 0) { foreach (var item in WhereExpressionList) { DbExpressionVisitor expression = new DbExpressionVisitor(); if (UnionList.Count == 0) { expression.TypeMaster = item.Model; expression.AliasMaster = masterAlisName; } else { ExpressionUnionModel union = null; if (item.UnionAlisName == null) { union = UnionList.FirstOrDefault(f => f.Model == item.Model); } else { union = UnionList.FirstOrDefault(f => f.Model == item.Model && f.UnionAlisName == item.UnionAlisName); } if (union == null && typeof(T) == item.Model) { expression.TypeMaster = item.Model; expression.AliasMaster = masterAlisName; } else if (union != null) { expression.AliasMaster = union.AlisName; expression.AliasUnion = union.UnionAlisName; } else { throw new NotSupportedException($"找不到 where {item.Body.ToString()}条件的表,不支持的表查询条件"); } } expression.Visit(item.Body); WhereList.Add(expression.SqlText.Builder.ToString().ToLower()); ParamList.AddRange(expression.SqlText.Parameters); } } if (WhereList.Count > 0) { sqlText.AppendLine("WHERE " + string.Join("\nAND ", WhereList)); } if (!string.IsNullOrEmpty(GroupByText)) { sqlText.AppendLine(GroupByText); } if (!string.IsNullOrEmpty(GroupByText) && !string.IsNullOrEmpty(HavingText)) { sqlText.AppendLine(HavingText); } if (!string.IsNullOrEmpty(OrderByText)) { sqlText.AppendLine(OrderByText); } if (!string.IsNullOrEmpty(LimitText)) { sqlText.AppendLine(LimitText); } this.commandtext = sqlText.ToString(); return(this.commandtext); }
public ProjectParams(ProjectParams InParams) { // //// Use this.Name with properties and fields! // this.RawProjectPath = InParams.RawProjectPath; this.MapsToCook = InParams.MapsToCook; this.DirectoriesToCook = InParams.DirectoriesToCook; this.InternationalizationPreset = InParams.InternationalizationPreset; this.CulturesToCook = InParams.CulturesToCook; this.BasedOnReleaseVersion = InParams.BasedOnReleaseVersion; this.CreateReleaseVersion = InParams.CreateReleaseVersion; this.DLCName = InParams.DLCName; this.NewCook = InParams.NewCook; this.AdditionalCookerOptions = InParams.AdditionalCookerOptions; this.ClientCookedTargets = InParams.ClientCookedTargets; this.ServerCookedTargets = InParams.ServerCookedTargets; this.EditorTargets = InParams.EditorTargets; this.ProgramTargets = InParams.ProgramTargets; this.ClientTargetPlatforms = InParams.ClientTargetPlatforms; this.ClientDependentPlatformMap = InParams.ClientDependentPlatformMap; this.ServerTargetPlatforms = InParams.ServerTargetPlatforms; this.ServerDependentPlatformMap = InParams.ServerDependentPlatformMap; this.Build = InParams.Build; this.Run = InParams.Run; this.Cook = InParams.Cook; this.IterativeCooking = InParams.IterativeCooking; this.CookFlavor = InParams.CookFlavor; this.SkipCook = InParams.SkipCook; this.SkipCookOnTheFly = InParams.SkipCookOnTheFly; this.Prebuilt = InParams.Prebuilt; this.RunTimeoutSeconds = InParams.RunTimeoutSeconds; this.Clean = InParams.Clean; this.Pak = InParams.Pak; this.SignPak = InParams.SignPak; this.SignedPak = InParams.SignedPak; this.SkipPak = InParams.SkipPak; this.NoXGE = InParams.NoXGE; this.CookOnTheFly = InParams.CookOnTheFly; this.CookOnTheFlyStreaming = InParams.CookOnTheFlyStreaming; this.FileServer = InParams.FileServer; this.DedicatedServer = InParams.DedicatedServer; this.Client = InParams.Client; this.NoClient = InParams.NoClient; this.LogWindow = InParams.LogWindow; this.Stage = InParams.Stage; this.SkipStage = InParams.SkipStage; this.StageDirectoryParam = InParams.StageDirectoryParam; this.StageNonMonolithic = InParams.StageNonMonolithic; this.Manifests = InParams.Manifests; this.CreateChunkInstall = InParams.CreateChunkInstall; this.UE4Exe = InParams.UE4Exe; this.NoDebugInfo = InParams.NoDebugInfo; this.NoCleanStage = InParams.NoCleanStage; this.MapToRun = InParams.MapToRun; this.AdditionalServerMapParams = InParams.AdditionalServerMapParams; this.Foreign = InParams.Foreign; this.ForeignCode = InParams.ForeignCode; this.StageCommandline = InParams.StageCommandline; this.BundleName = InParams.BundleName; this.RunCommandline = InParams.RunCommandline; this.Package = InParams.Package; this.Deploy = InParams.Deploy; this.IterativeDeploy = InParams.IterativeDeploy; this.Device = InParams.Device; this.DeviceName = InParams.DeviceName; this.ServerDevice = InParams.ServerDevice; this.NullRHI = InParams.NullRHI; this.FakeClient = InParams.FakeClient; this.EditorTest = InParams.EditorTest; this.RunAutomationTests = InParams.RunAutomationTests; this.RunAutomationTest = InParams.RunAutomationTest; this.CrashIndex = InParams.CrashIndex; this.Port = InParams.Port; this.SkipServer = InParams.SkipServer; this.Rocket = InParams.Rocket; this.Unattended = InParams.Unattended; this.ServerDeviceAddress = InParams.ServerDeviceAddress; this.DeviceUsername = InParams.DeviceUsername; this.DevicePassword = InParams.DevicePassword; this.CrashReporter = InParams.CrashReporter; this.ClientConfigsToBuild = InParams.ClientConfigsToBuild; this.ServerConfigsToBuild = InParams.ServerConfigsToBuild; this.NumClients = InParams.NumClients; this.Compressed = InParams.Compressed; this.UseDebugParamForEditorExe = InParams.UseDebugParamForEditorExe; this.bUsesSteam = InParams.bUsesSteam; this.bUsesCEF3 = InParams.bUsesCEF3; this.bUsesSlate = InParams.bUsesSlate; this.bUsesSlateEditorStyle = InParams.bUsesSlateEditorStyle; this.bDebugBuildsActuallyUseDebugCRT = InParams.bDebugBuildsActuallyUseDebugCRT; this.Archive = InParams.Archive; this.ArchiveDirectoryParam = InParams.ArchiveDirectoryParam; this.ArchiveMetaData = InParams.ArchiveMetaData; this.Distribution = InParams.Distribution; this.Prereqs = InParams.Prereqs; this.NoBootstrapExe = InParams.NoBootstrapExe; this.Prebuilt = InParams.Prebuilt; this.RunTimeoutSeconds = InParams.RunTimeoutSeconds; }
public DelegateMethodCall(Delegate f, IParameterSetter Params) { _f = f; ParamList.Add(Params); }
/// <summary> /// Constructor. Be sure to use this.ParamName to set the actual property name as parameter names and property names /// overlap here. /// If a parameter value is not set, it will be parsed from the command line if the command is null, the default value will be used. /// </summary> public ProjectParams( string RawProjectPath, CommandUtils Command = null, string Device = null, string MapToRun = null, string AdditionalServerMapParams = null, ParamList<string> Port = null, string RunCommandline = null, string StageCommandline = null, string BundleName = null, string StageDirectoryParam = null, bool? StageNonMonolithic = null, string UE4Exe = null, string SignPak = null, List<UnrealTargetConfiguration> ClientConfigsToBuild = null, List<UnrealTargetConfiguration> ServerConfigsToBuild = null, ParamList<string> MapsToCook = null, ParamList<string> DirectoriesToCook = null, string InternationalizationPreset = null, ParamList<string> CulturesToCook = null, ParamList<string> ClientCookedTargets = null, ParamList<string> EditorTargets = null, ParamList<string> ServerCookedTargets = null, List<UnrealTargetPlatform> ClientTargetPlatforms = null, Dictionary<UnrealTargetPlatform, UnrealTargetPlatform> ClientDependentPlatformMap = null, List<UnrealTargetPlatform> ServerTargetPlatforms = null, Dictionary<UnrealTargetPlatform, UnrealTargetPlatform> ServerDependentPlatformMap = null, bool? Build = null, bool? Cook = null, string CookFlavor = null, bool? Run = null, bool? SkipServer = null, bool? Clean = null, bool? Compressed = null, bool? UseDebugParamForEditorExe = null, bool? IterativeCooking = null, bool? CookAll = null, bool? CookMapsOnly = null, bool? CookOnTheFly = null, bool? CookOnTheFlyStreaming = null, bool? UnversionedCookedContent = null, string AdditionalCookerOptions = null, string BasedOnReleaseVersion = null, string CreateReleaseVersion = null, bool? GeneratePatch = null, string DLCName = null, bool? DLCIncludeEngineContent = null, bool? NewCook = null, bool? OldCook = null, bool? CrashReporter = null, bool? DedicatedServer = null, bool? Client = null, bool? Deploy = null, bool? FileServer = null, bool? Foreign = null, bool? ForeignCode = null, bool? LogWindow = null, bool? NoCleanStage = null, bool? NoClient = null, bool? NoDebugInfo = null, bool? NoXGE = null, bool? Package = null, bool? Pak = null, bool? Prereqs = null, bool? NoBootstrapExe = null, bool? SignedPak = null, bool? NullRHI = null, bool? FakeClient = null, bool? EditorTest = null, bool? RunAutomationTests = null, string RunAutomationTest = null, int? CrashIndex = null, bool? Rocket = null, bool? SkipCook = null, bool? SkipCookOnTheFly = null, bool? SkipPak = null, bool? SkipStage = null, bool? Stage = null, bool? Manifests = null, bool? CreateChunkInstall = null, bool? Unattended = null, int? NumClients = null, bool? Archive = null, string ArchiveDirectoryParam = null, bool? ArchiveMetaData = null, ParamList<string> ProgramTargets = null, bool? Distribution = null, bool? Prebuilt = null, int? RunTimeoutSeconds = null, string SpecifiedArchitecture = null, bool? IterativeDeploy = null, bool? FastCook = null, bool? IgnoreCookErrors = null ) { // //// Use this.Name with properties and fields! // this.RawProjectPath = RawProjectPath; if (DirectoriesToCook != null) { this.DirectoriesToCook = DirectoriesToCook; } this.InternationalizationPreset = ParseParamValueIfNotSpecified(Command, InternationalizationPreset, "i18npreset"); if (CulturesToCook != null) { this.CulturesToCook = CulturesToCook; } if (ClientCookedTargets != null) { this.ClientCookedTargets = ClientCookedTargets; } if (ServerCookedTargets != null) { this.ServerCookedTargets = ServerCookedTargets; } if (EditorTargets != null) { this.EditorTargets = EditorTargets; } if (ProgramTargets != null) { this.ProgramTargets = ProgramTargets; } // Parse command line params for client platforms "-TargetPlatform=Win64+Mac", "-Platform=Win64+Mac" and also "-Win64", "-Mac" etc. if (ClientDependentPlatformMap != null) { this.ClientDependentPlatformMap = ClientDependentPlatformMap; } this.ClientTargetPlatforms = SetupTargetPlatforms(ref this.ClientDependentPlatformMap, Command, ClientTargetPlatforms, new ParamList<UnrealTargetPlatform>() { HostPlatform.Current.HostEditorPlatform }, true, "TargetPlatform", "Platform"); // Parse command line params for server platforms "-ServerTargetPlatform=Win64+Mac", "-ServerPlatform=Win64+Mac". "-Win64" etc is not allowed here if (ServerDependentPlatformMap != null) { this.ServerDependentPlatformMap = ServerDependentPlatformMap; } this.ServerTargetPlatforms = SetupTargetPlatforms(ref this.ServerDependentPlatformMap, Command, ServerTargetPlatforms, this.ClientTargetPlatforms, false, "ServerTargetPlatform", "ServerPlatform"); this.Build = GetParamValueIfNotSpecified(Command, Build, this.Build, "build"); this.Run = GetParamValueIfNotSpecified(Command, Run, this.Run, "run"); this.Cook = GetParamValueIfNotSpecified(Command, Cook, this.Cook, "cook"); this.CookFlavor = ParseParamValueIfNotSpecified(Command, CookFlavor, "cookflavor", String.Empty); this.NewCook = GetParamValueIfNotSpecified(Command, NewCook, this.NewCook, "NewCook"); this.OldCook = GetParamValueIfNotSpecified(Command, OldCook, this.OldCook, "OldCook"); this.CreateReleaseVersion = ParseParamValueIfNotSpecified(Command, CreateReleaseVersion, "createreleaseversion", String.Empty); this.BasedOnReleaseVersion = ParseParamValueIfNotSpecified(Command, BasedOnReleaseVersion, "basedonreleaseversion", String.Empty); this.GeneratePatch = GetParamValueIfNotSpecified(Command, GeneratePatch, this.GeneratePatch, "GeneratePatch"); this.AdditionalCookerOptions = ParseParamValueIfNotSpecified(Command, AdditionalCookerOptions, "AdditionalCookerOptions", String.Empty); this.DLCName = ParseParamValueIfNotSpecified(Command, DLCName, "DLCName", String.Empty); this.DLCIncludeEngineContent = GetParamValueIfNotSpecified(Command, DLCIncludeEngineContent, this.DLCIncludeEngineContent, "DLCIncludeEngineContent"); this.SkipCook = GetParamValueIfNotSpecified(Command, SkipCook, this.SkipCook, "skipcook"); if (this.SkipCook) { this.Cook = true; } this.Clean = GetOptionalParamValueIfNotSpecified(Command, Clean, this.Clean, "clean", null); this.SignPak = ParseParamValueIfNotSpecified(Command, SignPak, "signpak", String.Empty); this.SignedPak = !String.IsNullOrEmpty(this.SignPak) || GetParamValueIfNotSpecified(Command, SignedPak, this.SignedPak, "signedpak"); this.Pak = this.SignedPak || GetParamValueIfNotSpecified(Command, Pak, this.Pak, "pak"); this.SkipPak = GetParamValueIfNotSpecified(Command, SkipPak, this.SkipPak, "skippak"); if (this.SkipPak) { this.Pak = true; } this.NoXGE = GetParamValueIfNotSpecified(Command, NoXGE, this.NoXGE, "noxge"); this.CookOnTheFly = GetParamValueIfNotSpecified(Command, CookOnTheFly, this.CookOnTheFly, "cookonthefly"); if (this.CookOnTheFly && this.SkipCook) { this.Cook = false; } this.CookOnTheFlyStreaming = GetParamValueIfNotSpecified(Command, CookOnTheFlyStreaming, this.CookOnTheFlyStreaming, "cookontheflystreaming"); this.UnversionedCookedContent = GetParamValueIfNotSpecified(Command, UnversionedCookedContent, this.UnversionedCookedContent, "UnversionedCookedContent"); this.Compressed = GetParamValueIfNotSpecified(Command, Compressed, this.Compressed, "compressed"); this.UseDebugParamForEditorExe = GetParamValueIfNotSpecified(Command, UseDebugParamForEditorExe, this.UseDebugParamForEditorExe, "UseDebugParamForEditorExe"); this.IterativeCooking = GetParamValueIfNotSpecified(Command, IterativeCooking, this.IterativeCooking, new string[] { "iterativecooking", "iterate" } ); this.SkipCookOnTheFly = GetParamValueIfNotSpecified(Command, SkipCookOnTheFly, this.SkipCookOnTheFly, "skipcookonthefly"); this.CookAll = GetParamValueIfNotSpecified(Command, CookAll, this.CookAll, "CookAll"); this.CookMapsOnly = GetParamValueIfNotSpecified(Command, CookMapsOnly, this.CookMapsOnly, "CookMapsOnly"); this.FileServer = GetParamValueIfNotSpecified(Command, FileServer, this.FileServer, "fileserver"); this.DedicatedServer = GetParamValueIfNotSpecified(Command, DedicatedServer, this.DedicatedServer, "dedicatedserver", "server"); this.Client = GetParamValueIfNotSpecified(Command, Client, this.Client, "client"); if( this.Client ) { this.DedicatedServer = true; } this.NoClient = GetParamValueIfNotSpecified(Command, NoClient, this.NoClient, "noclient"); this.LogWindow = GetParamValueIfNotSpecified(Command, LogWindow, this.LogWindow, "logwindow"); this.Stage = GetParamValueIfNotSpecified(Command, Stage, this.Stage, "stage"); this.SkipStage = GetParamValueIfNotSpecified(Command, SkipStage, this.SkipStage, "skipstage"); if (this.SkipStage) { this.Stage = true; } this.StageDirectoryParam = ParseParamValueIfNotSpecified(Command, StageDirectoryParam, "stagingdirectory", String.Empty, true); this.StageNonMonolithic = GetParamValueIfNotSpecified(Command, StageNonMonolithic, this.StageNonMonolithic, "StageNonMonolithic"); this.Manifests = GetParamValueIfNotSpecified(Command, Manifests, this.Manifests, "manifests"); this.CreateChunkInstall = GetParamValueIfNotSpecified(Command, CreateChunkInstall, this.CreateChunkInstall, "createchunkinstall"); this.ChunkInstallDirectory = ParseParamValueIfNotSpecified(Command, ChunkInstallDirectory, "chunkinstalldirectory", String.Empty, true); this.ChunkInstallVersionString = ParseParamValueIfNotSpecified(Command, ChunkInstallVersionString, "chunkinstallversion", String.Empty, true); this.Archive = GetParamValueIfNotSpecified(Command, Archive, this.Archive, "archive"); this.ArchiveDirectoryParam = ParseParamValueIfNotSpecified(Command, ArchiveDirectoryParam, "archivedirectory", String.Empty, true); this.ArchiveMetaData = GetParamValueIfNotSpecified(Command, ArchiveMetaData, this.ArchiveMetaData, "archivemetadata"); this.Distribution = GetParamValueIfNotSpecified(Command, Distribution, this.Distribution, "distribution"); this.Prereqs = GetParamValueIfNotSpecified(Command, Prereqs, this.Prereqs, "prereqs"); this.NoBootstrapExe = GetParamValueIfNotSpecified(Command, NoBootstrapExe, this.NoBootstrapExe, "nobootstrapexe"); this.Prebuilt = GetParamValueIfNotSpecified(Command, Prebuilt, this.Prebuilt, "prebuilt"); if (this.Prebuilt) { this.SkipCook = true; /*this.SkipPak = true; this.SkipStage = true; this.Pak = true; this.Stage = true;*/ this.Cook = true; this.Archive = true; this.Deploy = true; this.Run = true; //this.StageDirectoryParam = this.PrebuiltDir; } this.NoDebugInfo = GetParamValueIfNotSpecified(Command, NoDebugInfo, this.NoDebugInfo, "nodebuginfo"); this.NoCleanStage = GetParamValueIfNotSpecified(Command, NoCleanStage, this.NoCleanStage, "nocleanstage"); this.MapToRun = ParseParamValueIfNotSpecified(Command, MapToRun, "map", String.Empty); this.AdditionalServerMapParams = ParseParamValueIfNotSpecified(Command, AdditionalServerMapParams, "AdditionalServerMapParams", String.Empty); this.Foreign = GetParamValueIfNotSpecified(Command, Foreign, this.Foreign, "foreign"); this.ForeignCode = GetParamValueIfNotSpecified(Command, ForeignCode, this.ForeignCode, "foreigncode"); this.StageCommandline = ParseParamValueIfNotSpecified(Command, StageCommandline, "cmdline"); this.BundleName = ParseParamValueIfNotSpecified(Command, BundleName, "bundlename"); this.RunCommandline = ParseParamValueIfNotSpecified(Command, RunCommandline, "addcmdline"); this.Package = GetParamValueIfNotSpecified(Command, Package, this.Package, "package"); this.Deploy = GetParamValueIfNotSpecified(Command, Deploy, this.Deploy, "deploy"); this.IterativeDeploy = GetParamValueIfNotSpecified(Command, IterativeDeploy, this.IterativeDeploy, new string[] {"iterativedeploy", "iterate" } ); this.FastCook = GetParamValueIfNotSpecified(Command, FastCook, this.FastCook, "FastCook"); this.IgnoreCookErrors = GetParamValueIfNotSpecified(Command, IgnoreCookErrors, this.IgnoreCookErrors, "IgnoreCookErrors"); this.Device = ParseParamValueIfNotSpecified(Command, Device, "device", String.Empty).Trim(new char[] { '\"' }); // strip the platform prefix the specified device. if (this.Device.Contains("@")) { this.DeviceName = this.Device.Substring(this.Device.IndexOf("@") + 1); } else { this.DeviceName = this.Device; } this.ServerDevice = ParseParamValueIfNotSpecified(Command, ServerDevice, "serverdevice", this.Device); this.NullRHI = GetParamValueIfNotSpecified(Command, NullRHI, this.NullRHI, "nullrhi"); this.FakeClient = GetParamValueIfNotSpecified(Command, FakeClient, this.FakeClient, "fakeclient"); this.EditorTest = GetParamValueIfNotSpecified(Command, EditorTest, this.EditorTest, "editortest"); this.RunAutomationTest = ParseParamValueIfNotSpecified(Command, RunAutomationTest, "RunAutomationTest"); this.RunAutomationTests = this.RunAutomationTest != "" || GetParamValueIfNotSpecified(Command, RunAutomationTests, this.RunAutomationTests, "RunAutomationTests"); this.SkipServer = GetParamValueIfNotSpecified(Command, SkipServer, this.SkipServer, "skipserver"); this.Rocket = GetParamValueIfNotSpecified(Command, Rocket, this.Rocket || GlobalCommandLine.Rocket, "rocket"); this.UE4Exe = ParseParamValueIfNotSpecified(Command, UE4Exe, "ue4exe", "UE4Editor-Cmd.exe"); this.Unattended = GetParamValueIfNotSpecified(Command, Unattended, this.Unattended, "unattended"); this.DeviceUsername = ParseParamValueIfNotSpecified(Command, DeviceUsername, "deviceuser", String.Empty); this.DevicePassword = ParseParamValueIfNotSpecified(Command, DevicePassword, "devicepass", String.Empty); this.CrashReporter = GetParamValueIfNotSpecified(Command, CrashReporter, this.CrashReporter, "crashreporter"); this.SpecifiedArchitecture = ParseParamValueIfNotSpecified(Command, SpecifiedArchitecture, "specifiedarchitecture", String.Empty); if (ClientConfigsToBuild == null) { if (Command != null) { var ClientConfig = Command.ParseParamValue("clientconfig"); if (ClientConfig != null) { this.ClientConfigsToBuild = new List<UnrealTargetConfiguration>(); var Configs = new ParamList<string>(ClientConfig.Split('+')); foreach (var ConfigName in Configs) { this.ClientConfigsToBuild.Add((UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), ConfigName, true)); } } } } else { this.ClientConfigsToBuild = ClientConfigsToBuild; } if (Port == null) { if( Command != null ) { this.Port = new ParamList<string>(); var PortString = Command.ParseParamValue("port"); if (String.IsNullOrEmpty(PortString) == false) { var Ports = new ParamList<string>(PortString.Split('+')); foreach (var P in Ports) { this.Port.Add(P); } } } } else { this.Port = Port; } if (MapsToCook == null) { if (Command != null) { this.MapsToCook = new ParamList<string>(); var MapsString = Command.ParseParamValue("MapsToCook"); if (String.IsNullOrEmpty(MapsString) == false) { var MapNames = new ParamList<string>(MapsString.Split('+')); foreach ( var M in MapNames ) { this.MapsToCook.Add( M ); } } } } else { this.MapsToCook = MapsToCook; } if (String.IsNullOrEmpty(this.MapToRun) == false) { this.MapsToCook.Add(this.MapToRun); } if (ServerConfigsToBuild == null) { if (Command != null) { var ServerConfig = Command.ParseParamValue("serverconfig"); if (ServerConfig != null && ServerConfigsToBuild == null) { this.ServerConfigsToBuild = new List<UnrealTargetConfiguration>(); var Configs = new ParamList<string>(ServerConfig.Split('+')); foreach (var ConfigName in Configs) { this.ServerConfigsToBuild.Add((UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), ConfigName, true)); } } } } else { this.ServerConfigsToBuild = ServerConfigsToBuild; } if (NumClients.HasValue) { this.NumClients = NumClients.Value; } else if (Command != null) { this.NumClients = Command.ParseParamInt("numclients"); } if (CrashIndex.HasValue) { this.CrashIndex = CrashIndex.Value; } else if (Command != null) { this.CrashIndex = Command.ParseParamInt("CrashIndex"); } if (RunTimeoutSeconds.HasValue) { this.RunTimeoutSeconds = RunTimeoutSeconds.Value; } else if (Command != null) { this.RunTimeoutSeconds = Command.ParseParamInt("runtimeoutseconds"); } AutodetectSettings(false); ValidateAndLog(); }
public DynamicMethodCall(object obj, MethodInfo method, IParameterSetter setter) { _obj = obj; _method = method; ParamList.Add(setter); }
/// <summary> /// Constructor. Be sure to use this.ParamName to set the actual property name as parameter names and property names /// overlap here. /// If a parameter value is not set, it will be parsed from the command line; if the command is null, the default value will be used. /// </summary> public ProjectParams( FileReference RawProjectPath, CommandUtils Command = null, string Device = null, string MapToRun = null, string AdditionalServerMapParams = null, ParamList<string> Port = null, string RunCommandline = null, string StageCommandline = null, string BundleName = null, string StageDirectoryParam = null, string UE4Exe = null, string SignPak = null, List<UnrealTargetConfiguration> ClientConfigsToBuild = null, List<UnrealTargetConfiguration> ServerConfigsToBuild = null, ParamList<string> MapsToCook = null, ParamList<string> DirectoriesToCook = null, string InternationalizationPreset = null, ParamList<string> CulturesToCook = null, ParamList<string> ClientCookedTargets = null, ParamList<string> EditorTargets = null, ParamList<string> ServerCookedTargets = null, List<TargetPlatformDescriptor> ClientTargetPlatforms = null, Dictionary<TargetPlatformDescriptor, TargetPlatformDescriptor> ClientDependentPlatformMap = null, List<TargetPlatformDescriptor> ServerTargetPlatforms = null, Dictionary<TargetPlatformDescriptor, TargetPlatformDescriptor> ServerDependentPlatformMap = null, bool? Build = null, bool? Cook = null, bool? Run = null, bool? SkipServer = null, bool? Clean = null, bool? Compressed = null, bool? UseDebugParamForEditorExe = null, bool? IterativeCooking = null, bool? CookAll = null, bool? CookPartialGC = null, bool? CookMapsOnly = null, bool? CookOnTheFly = null, bool? CookOnTheFlyStreaming = null, bool? UnversionedCookedContent = null, bool? EncryptIniFiles = null, bool? SkipCookingEditorContent = null, int? NumCookersToSpawn = null, string AdditionalCookerOptions = null, string BasedOnReleaseVersion = null, string CreateReleaseVersion = null, string CreateReleaseVersionBasePath = null, string BasedOnReleaseVersionBasePath = null, bool? GeneratePatch = null, string DLCName = null, string DiffCookedContentPath = null, bool? DLCIncludeEngineContent = null, bool? NewCook = null, bool? OldCook = null, bool? CrashReporter = null, bool? DedicatedServer = null, bool? Client = null, bool? Deploy = null, bool? FileServer = null, bool? Foreign = null, bool? ForeignCode = null, bool? LogWindow = null, bool? NoCleanStage = null, bool? NoClient = null, bool? NoDebugInfo = null, bool? NoXGE = null, bool? Package = null, bool? Pak = null, bool? Prereqs = null, string AppLocalDirectory = null, bool? NoBootstrapExe = null, bool? SignedPak = null, bool? NullRHI = null, bool? FakeClient = null, bool? EditorTest = null, bool? RunAutomationTests = null, string RunAutomationTest = null, int? CrashIndex = null, bool? SkipCook = null, bool? SkipCookOnTheFly = null, bool? SkipPak = null, bool? SkipStage = null, bool? Stage = null, bool? Manifests = null, bool? CreateChunkInstall = null, bool? Unattended = null, int? NumClients = null, bool? Archive = null, string ArchiveDirectoryParam = null, bool? ArchiveMetaData = null, bool? CreateAppBundle = null, ParamList<string> ProgramTargets = null, bool? Distribution = null, bool? Prebuilt = null, int? RunTimeoutSeconds = null, string SpecifiedArchitecture = null, bool? IterativeDeploy = null, bool? FastCook = null, bool? IgnoreCookErrors = null, bool? RunAssetNativization = null, bool? CodeSign = null, bool? TreatNonShippingBinariesAsDebugFiles = null, string Provision = null, string Certificate = null, ParamList<string> InMapsToRebuildLightMaps = null, ParamList<string> TitleID = null ) { // //// Use this.Name with properties and fields! // this.RawProjectPath = RawProjectPath; if (DirectoriesToCook != null) { this.DirectoriesToCook = DirectoriesToCook; } this.InternationalizationPreset = ParseParamValueIfNotSpecified(Command, InternationalizationPreset, "i18npreset"); // If not specified in parameters, check commandline. if (CulturesToCook == null) { if (Command != null) { var CookCulturesString = Command.ParseParamValue("CookCultures"); if (CookCulturesString != null) { this.CulturesToCook = new ParamList<string>(CookCulturesString.Split(',')); } } } else { this.CulturesToCook = CulturesToCook; } if (ClientCookedTargets != null) { this.ClientCookedTargets = ClientCookedTargets; } if (ServerCookedTargets != null) { this.ServerCookedTargets = ServerCookedTargets; } if (EditorTargets != null) { this.EditorTargets = EditorTargets; } if (ProgramTargets != null) { this.ProgramTargets = ProgramTargets; } // Parse command line params for client platforms "-TargetPlatform=Win64+Mac", "-Platform=Win64+Mac" and also "-Win64", "-Mac" etc. if (ClientDependentPlatformMap != null) { this.ClientDependentPlatformMap = ClientDependentPlatformMap; } List<TargetPlatformDescriptor> DefaultTargetPlatforms = new ParamList<TargetPlatformDescriptor>(new TargetPlatformDescriptor(HostPlatform.Current.HostEditorPlatform)); this.ClientTargetPlatforms = SetupTargetPlatforms(ref this.ClientDependentPlatformMap, Command, ClientTargetPlatforms, DefaultTargetPlatforms, true, "TargetPlatform", "Platform"); // Parse command line params for server platforms "-ServerTargetPlatform=Win64+Mac", "-ServerPlatform=Win64+Mac". "-Win64" etc is not allowed here if (ServerDependentPlatformMap != null) { this.ServerDependentPlatformMap = ServerDependentPlatformMap; } this.ServerTargetPlatforms = SetupTargetPlatforms(ref this.ServerDependentPlatformMap, Command, ServerTargetPlatforms, this.ClientTargetPlatforms, false, "ServerTargetPlatform", "ServerPlatform"); this.Build = GetParamValueIfNotSpecified(Command, Build, this.Build, "build"); this.Run = GetParamValueIfNotSpecified(Command, Run, this.Run, "run"); this.Cook = GetParamValueIfNotSpecified(Command, Cook, this.Cook, "cook"); this.NewCook = GetParamValueIfNotSpecified(Command, NewCook, this.NewCook, "NewCook"); this.OldCook = GetParamValueIfNotSpecified(Command, OldCook, this.OldCook, "OldCook"); this.CreateReleaseVersionBasePath = ParseParamValueIfNotSpecified(Command, CreateReleaseVersionBasePath, "createreleaseversionroot", String.Empty); this.BasedOnReleaseVersionBasePath = ParseParamValueIfNotSpecified(Command, BasedOnReleaseVersionBasePath, "basedonreleaseversionroot", String.Empty); this.CreateReleaseVersion = ParseParamValueIfNotSpecified(Command, CreateReleaseVersion, "createreleaseversion", String.Empty); this.BasedOnReleaseVersion = ParseParamValueIfNotSpecified(Command, BasedOnReleaseVersion, "basedonreleaseversion", String.Empty); this.GeneratePatch = GetParamValueIfNotSpecified(Command, GeneratePatch, this.GeneratePatch, "GeneratePatch"); this.AdditionalCookerOptions = ParseParamValueIfNotSpecified(Command, AdditionalCookerOptions, "AdditionalCookerOptions", String.Empty); this.DLCName = ParseParamValueIfNotSpecified(Command, DLCName, "DLCName", String.Empty); this.DiffCookedContentPath = ParseParamValueIfNotSpecified(Command, DiffCookedContentPath, "DiffCookedContentPath", String.Empty); this.DLCIncludeEngineContent = GetParamValueIfNotSpecified(Command, DLCIncludeEngineContent, this.DLCIncludeEngineContent, "DLCIncludeEngineContent"); this.SkipCook = GetParamValueIfNotSpecified(Command, SkipCook, this.SkipCook, "skipcook"); if (this.SkipCook) { this.Cook = true; } this.Clean = GetOptionalParamValueIfNotSpecified(Command, Clean, this.Clean, "clean", null); this.SignPak = ParseParamValueIfNotSpecified(Command, SignPak, "signpak", String.Empty); this.SignedPak = !String.IsNullOrEmpty(this.SignPak) || GetParamValueIfNotSpecified(Command, SignedPak, this.SignedPak, "signedpak"); if (string.IsNullOrEmpty(this.SignPak)) { this.SignPak = Path.Combine(RawProjectPath.Directory.FullName, @"Build\NoRedist\Keys.txt"); if (!File.Exists(this.SignPak)) { this.SignPak = null; } } this.Pak = GetParamValueIfNotSpecified(Command, Pak, this.Pak, "pak"); this.SkipPak = GetParamValueIfNotSpecified(Command, SkipPak, this.SkipPak, "skippak"); if (this.SkipPak) { this.Pak = true; } this.NoXGE = GetParamValueIfNotSpecified(Command, NoXGE, this.NoXGE, "noxge"); this.CookOnTheFly = GetParamValueIfNotSpecified(Command, CookOnTheFly, this.CookOnTheFly, "cookonthefly"); if (this.CookOnTheFly && this.SkipCook) { this.Cook = false; } this.CookOnTheFlyStreaming = GetParamValueIfNotSpecified(Command, CookOnTheFlyStreaming, this.CookOnTheFlyStreaming, "cookontheflystreaming"); this.UnversionedCookedContent = GetParamValueIfNotSpecified(Command, UnversionedCookedContent, this.UnversionedCookedContent, "UnversionedCookedContent"); this.EncryptIniFiles = GetParamValueIfNotSpecified(Command, EncryptIniFiles, this.EncryptIniFiles, "EncryptIniFiles"); this.SkipCookingEditorContent = GetParamValueIfNotSpecified(Command, SkipCookingEditorContent, this.SkipCookingEditorContent, "SkipCookingEditorContent"); if (NumCookersToSpawn.HasValue) { this.NumCookersToSpawn = NumCookersToSpawn.Value; } else if (Command != null) { this.NumCookersToSpawn = Command.ParseParamInt("NumCookersToSpawn"); } this.Compressed = GetParamValueIfNotSpecified(Command, Compressed, this.Compressed, "compressed"); this.UseDebugParamForEditorExe = GetParamValueIfNotSpecified(Command, UseDebugParamForEditorExe, this.UseDebugParamForEditorExe, "UseDebugParamForEditorExe"); this.IterativeCooking = GetParamValueIfNotSpecified(Command, IterativeCooking, this.IterativeCooking, new string[] { "iterativecooking", "iterate" } ); this.SkipCookOnTheFly = GetParamValueIfNotSpecified(Command, SkipCookOnTheFly, this.SkipCookOnTheFly, "skipcookonthefly"); this.CookAll = GetParamValueIfNotSpecified(Command, CookAll, this.CookAll, "CookAll"); this.CookPartialGC = GetParamValueIfNotSpecified(Command, CookPartialGC, this.CookPartialGC, "CookPartialGC"); this.CookMapsOnly = GetParamValueIfNotSpecified(Command, CookMapsOnly, this.CookMapsOnly, "CookMapsOnly"); this.FileServer = GetParamValueIfNotSpecified(Command, FileServer, this.FileServer, "fileserver"); this.DedicatedServer = GetParamValueIfNotSpecified(Command, DedicatedServer, this.DedicatedServer, "dedicatedserver", "server"); this.Client = GetParamValueIfNotSpecified(Command, Client, this.Client, "client"); /*if( this.Client ) { this.DedicatedServer = true; }*/ this.NoClient = GetParamValueIfNotSpecified(Command, NoClient, this.NoClient, "noclient"); this.LogWindow = GetParamValueIfNotSpecified(Command, LogWindow, this.LogWindow, "logwindow"); this.Stage = GetParamValueIfNotSpecified(Command, Stage, this.Stage, "stage"); this.SkipStage = GetParamValueIfNotSpecified(Command, SkipStage, this.SkipStage, "skipstage"); if (this.SkipStage) { this.Stage = true; } this.StageDirectoryParam = ParseParamValueIfNotSpecified(Command, StageDirectoryParam, "stagingdirectory", String.Empty, true); this.bCodeSign = GetParamValueIfNotSpecified(Command, CodeSign, CommandUtils.IsBuildMachine, "CodeSign"); this.bTreatNonShippingBinariesAsDebugFiles = GetParamValueIfNotSpecified(Command, TreatNonShippingBinariesAsDebugFiles, false, "TreatNonShippingBinariesAsDebugFiles"); this.Manifests = GetParamValueIfNotSpecified(Command, Manifests, this.Manifests, "manifests"); this.CreateChunkInstall = GetParamValueIfNotSpecified(Command, CreateChunkInstall, this.CreateChunkInstall, "createchunkinstall"); this.ChunkInstallDirectory = ParseParamValueIfNotSpecified(Command, ChunkInstallDirectory, "chunkinstalldirectory", String.Empty, true); this.ChunkInstallVersionString = ParseParamValueIfNotSpecified(Command, ChunkInstallVersionString, "chunkinstallversion", String.Empty, true); this.Archive = GetParamValueIfNotSpecified(Command, Archive, this.Archive, "archive"); this.ArchiveDirectoryParam = ParseParamValueIfNotSpecified(Command, ArchiveDirectoryParam, "archivedirectory", String.Empty, true); this.ArchiveMetaData = GetParamValueIfNotSpecified(Command, ArchiveMetaData, this.ArchiveMetaData, "archivemetadata"); this.CreateAppBundle = GetParamValueIfNotSpecified(Command, CreateAppBundle, true, "createappbundle"); this.Distribution = GetParamValueIfNotSpecified(Command, Distribution, this.Distribution, "distribution"); this.Prereqs = GetParamValueIfNotSpecified(Command, Prereqs, this.Prereqs, "prereqs"); this.AppLocalDirectory = ParseParamValueIfNotSpecified(Command, AppLocalDirectory, "applocaldirectory", String.Empty, true); this.NoBootstrapExe = GetParamValueIfNotSpecified(Command, NoBootstrapExe, this.NoBootstrapExe, "nobootstrapexe"); this.Prebuilt = GetParamValueIfNotSpecified(Command, Prebuilt, this.Prebuilt, "prebuilt"); if (this.Prebuilt) { this.SkipCook = true; /*this.SkipPak = true; this.SkipStage = true; this.Pak = true; this.Stage = true;*/ this.Cook = true; this.Archive = true; this.Deploy = true; this.Run = true; //this.StageDirectoryParam = this.PrebuiltDir; } this.NoDebugInfo = GetParamValueIfNotSpecified(Command, NoDebugInfo, this.NoDebugInfo, "nodebuginfo"); this.NoCleanStage = GetParamValueIfNotSpecified(Command, NoCleanStage, this.NoCleanStage, "nocleanstage"); this.MapToRun = ParseParamValueIfNotSpecified(Command, MapToRun, "map", String.Empty); this.AdditionalServerMapParams = ParseParamValueIfNotSpecified(Command, AdditionalServerMapParams, "AdditionalServerMapParams", String.Empty); this.Foreign = GetParamValueIfNotSpecified(Command, Foreign, this.Foreign, "foreign"); this.ForeignCode = GetParamValueIfNotSpecified(Command, ForeignCode, this.ForeignCode, "foreigncode"); this.StageCommandline = ParseParamValueIfNotSpecified(Command, StageCommandline, "cmdline"); this.BundleName = ParseParamValueIfNotSpecified(Command, BundleName, "bundlename"); this.RunCommandline = ParseParamValueIfNotSpecified(Command, RunCommandline, "addcmdline"); this.RunCommandline = this.RunCommandline.Replace('\'', '\"'); // replace any single quotes with double quotes this.ServerCommandline = ParseParamValueIfNotSpecified(Command, ServerCommandline, "servercmdline"); this.ServerCommandline = this.ServerCommandline.Replace('\'', '\"'); // replace any single quotes with double quotes this.Package = GetParamValueIfNotSpecified(Command, Package, this.Package, "package"); this.Deploy = GetParamValueIfNotSpecified(Command, Deploy, this.Deploy, "deploy"); this.IterativeDeploy = GetParamValueIfNotSpecified(Command, IterativeDeploy, this.IterativeDeploy, new string[] {"iterativedeploy", "iterate" } ); this.FastCook = GetParamValueIfNotSpecified(Command, FastCook, this.FastCook, "FastCook"); this.IgnoreCookErrors = GetParamValueIfNotSpecified(Command, IgnoreCookErrors, this.IgnoreCookErrors, "IgnoreCookErrors"); this.RunAssetNativization = GetParamValueIfNotSpecified(Command, RunAssetNativization, this.RunAssetNativization, "nativizeAssets"); string DeviceString = ParseParamValueIfNotSpecified(Command, Device, "device", String.Empty).Trim(new char[] { '\"' }); if(DeviceString == "") { this.Devices = new ParamList<string>(""); this.DeviceNames = new ParamList<string>(""); } else { this.Devices = new ParamList<string>(DeviceString.Split('+')); this.DeviceNames = new ParamList<string>(); foreach (var d in this.Devices) { // strip the platform prefix the specified device. if (d.Contains("@")) { this.DeviceNames.Add(d.Substring(d.IndexOf("@") + 1)); } else { this.DeviceNames.Add(d); } } } this.Provision = ParseParamValueIfNotSpecified(Command, Provision, "provision", String.Empty, true); this.Certificate = ParseParamValueIfNotSpecified(Command, Certificate, "certificate", String.Empty, true); this.ServerDevice = ParseParamValueIfNotSpecified(Command, ServerDevice, "serverdevice", this.Devices.Count > 0 ? this.Devices[0] : ""); this.NullRHI = GetParamValueIfNotSpecified(Command, NullRHI, this.NullRHI, "nullrhi"); this.FakeClient = GetParamValueIfNotSpecified(Command, FakeClient, this.FakeClient, "fakeclient"); this.EditorTest = GetParamValueIfNotSpecified(Command, EditorTest, this.EditorTest, "editortest"); this.RunAutomationTest = ParseParamValueIfNotSpecified(Command, RunAutomationTest, "RunAutomationTest"); this.RunAutomationTests = this.RunAutomationTest != "" || GetParamValueIfNotSpecified(Command, RunAutomationTests, this.RunAutomationTests, "RunAutomationTests"); this.SkipServer = GetParamValueIfNotSpecified(Command, SkipServer, this.SkipServer, "skipserver"); this.UE4Exe = ParseParamValueIfNotSpecified(Command, UE4Exe, "ue4exe", "UE4Editor-Cmd.exe"); this.Unattended = GetParamValueIfNotSpecified(Command, Unattended, this.Unattended, "unattended"); this.DeviceUsername = ParseParamValueIfNotSpecified(Command, DeviceUsername, "deviceuser", String.Empty); this.DevicePassword = ParseParamValueIfNotSpecified(Command, DevicePassword, "devicepass", String.Empty); this.CrashReporter = GetParamValueIfNotSpecified(Command, CrashReporter, this.CrashReporter, "crashreporter"); this.SpecifiedArchitecture = ParseParamValueIfNotSpecified(Command, SpecifiedArchitecture, "specifiedarchitecture", String.Empty); if (ClientConfigsToBuild == null) { if (Command != null) { var ClientConfig = Command.ParseParamValue("clientconfig"); if (ClientConfig == null) ClientConfig = Command.ParseParamValue("config"); if (ClientConfig != null) { this.ClientConfigsToBuild = new List<UnrealTargetConfiguration>(); var Configs = new ParamList<string>(ClientConfig.Split('+')); foreach (var ConfigName in Configs) { this.ClientConfigsToBuild.Add((UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), ConfigName, true)); } } } } else { this.ClientConfigsToBuild = ClientConfigsToBuild; } if (Port == null) { if( Command != null ) { this.Port = new ParamList<string>(); var PortString = Command.ParseParamValue("port"); if (String.IsNullOrEmpty(PortString) == false) { var Ports = new ParamList<string>(PortString.Split('+')); foreach (var P in Ports) { this.Port.Add(P); } } } } else { this.Port = Port; } if (MapsToCook == null) { if (Command != null) { this.MapsToCook = new ParamList<string>(); var MapsString = Command.ParseParamValue("MapsToCook"); if (String.IsNullOrEmpty(MapsString) == false) { var MapNames = new ParamList<string>(MapsString.Split('+')); foreach ( var M in MapNames ) { this.MapsToCook.Add( M ); } } } } else { this.MapsToCook = MapsToCook; } if (String.IsNullOrEmpty(this.MapToRun) == false) { this.MapsToCook.Add(this.MapToRun); } if (InMapsToRebuildLightMaps == null) { if (Command != null) { this.MapsToRebuildLightMaps = new ParamList<string>(); var MapsString = Command.ParseParamValue("MapsToRebuildLightMaps"); if (String.IsNullOrEmpty(MapsString) == false) { var MapNames = new ParamList<string>(MapsString.Split('+')); foreach (var M in MapNames) { this.MapsToRebuildLightMaps.Add(M); } } } } else { this.MapsToRebuildLightMaps = InMapsToRebuildLightMaps; } if (TitleID == null) { if (Command != null) { this.TitleID = new ParamList<string>(); var TitleString = Command.ParseParamValue("TitleID"); if (String.IsNullOrEmpty(TitleString) == false) { var TitleIDs = new ParamList<string>(TitleString.Split('+')); foreach (var T in TitleIDs) { this.TitleID.Add(T); } } } } else { this.TitleID = TitleID; } if (ServerConfigsToBuild == null) { if (Command != null) { var ServerConfig = Command.ParseParamValue("serverconfig"); if (ServerConfig == null) ServerConfig = Command.ParseParamValue("config"); if (ServerConfig != null) { this.ServerConfigsToBuild = new List<UnrealTargetConfiguration>(); var Configs = new ParamList<string>(ServerConfig.Split('+')); foreach (var ConfigName in Configs) { this.ServerConfigsToBuild.Add((UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), ConfigName, true)); } } } } else { this.ServerConfigsToBuild = ServerConfigsToBuild; } if (NumClients.HasValue) { this.NumClients = NumClients.Value; } else if (Command != null) { this.NumClients = Command.ParseParamInt("numclients"); } if (CrashIndex.HasValue) { this.CrashIndex = CrashIndex.Value; } else if (Command != null) { this.CrashIndex = Command.ParseParamInt("CrashIndex"); } if (RunTimeoutSeconds.HasValue) { this.RunTimeoutSeconds = RunTimeoutSeconds.Value; } else if (Command != null) { this.RunTimeoutSeconds = Command.ParseParamInt("runtimeoutseconds"); } AutodetectSettings(false); ValidateAndLog(); }
protected abstract void VisitParamList(ParamList tree);