public bool CanHandle(UpdateObject updateObject) { string[] _commands = GetCommands(); var text = updateObject.message.text; return(string.Equals(text, EmojiUtils.SettingsIcon + strings.Settings, StringComparison.InvariantCultureIgnoreCase) || string.Equals(text, "/settings", StringComparison.InvariantCultureIgnoreCase) || _commands.Any(s => s.Equals(text, StringComparison.InvariantCultureIgnoreCase))); }
public bool CanHandle(UpdateObject updateObject) { var text = updateObject.message.text; return((text.StartsWith(EmojiUtils.NowIcon + strings.Now, StringComparison.InvariantCultureIgnoreCase)) || text.StartsWith("/now", StringComparison.InvariantCultureIgnoreCase)); }
public bool BuildPacket(out UpdateObject packet) { packet = new UpdateObject(); packet.NumObjUpdates = BlockCount; packet.MapID = (ushort)MapId; WorldPacket buffer = new WorldPacket(); if (buffer.WriteBit(!outOfRangeGUIDs.Empty())) { buffer.WriteUInt16(0); // object limit to instantly destroy - objects before this index on m_outOfRangeGUIDs list get "smoothly phased out" buffer.WriteUInt32(outOfRangeGUIDs.Count); foreach (var guid in outOfRangeGUIDs) { buffer.WritePackedGuid(guid); } } var bytes = data.GetData(); buffer.WriteUInt32(bytes.Length); buffer.WriteBytes(bytes); packet.Data = buffer.GetData(); return(true); }
private DbParameter[] GetEntityParams(UpdateObject updateObject) { List <DbParameter> list = new List <DbParameter> (); // 更新字段参数 if (updateObject.DitUpdateInfo.Count > 0) { foreach (KeyValuePair <string, object> item in updateObject.DitUpdateInfo) { list.Add(dalInfo.Provider.CreateParameter(string.Format("@u{0}", item.Key), item.Value)); } } // 条件参数 if (updateObject.Where.ListWhereEntity != null && updateObject.Where.ListWhereEntity.Count > 0) { foreach (WhereEntity item in updateObject.Where.ListWhereEntity) { if (item.RelationType == RelationTypeEnum.IsNull) { continue; } list.Add(dalInfo.Provider.CreateParameter(string.Format("@{0}", item.ColumnName), item.Value)); } } if (list.Count == 0) { return(null); } return(list.ToArray()); }
private void UpdateLikes(List <Guid> likes) { UpdateObject updateObject = new UpdateObject(new List <UpdatedField>() { new UpdatedField("Likes", UpdateModifier.Set, likes) }); AppManager.Instance.Activities().Update(this.currentActivity.Id, updateObject).TryExecute( delegate(RequestResult <bool> result) { if (result.Success) { AppManager.Instance.InvokeInUIThread(delegate() { this.currentActivity.Likes = likes; this.RefreshApplicationBar(); }); } else { AppManager.Instance.ShowErrorMessage(result.Error.Message); } } ); }
private void Awake() { UpdateObject tobj = new UpdateObject("UIManager", new Method.Method_Action(UIUpdate), null); tobj.MaxTime = 0; GameUpdateManager.RegUpdate(tobj); }
// POST api/values public HttpResponseMessage Post(UpdateObject input) { BotHandler botHandler = new BotHandler(); botHandler.Process(input); return(new HttpResponseMessage(HttpStatusCode.OK)); }
protected override bool CanHandleInternal(UpdateObject updateObject) { var text = updateObject.message.text; return(text.StartsWith(EmojiUtils.ScheduleIcon + strings.Schedule, StringComparison.InvariantCultureIgnoreCase) || text.StartsWith("/schedule", StringComparison.InvariantCultureIgnoreCase)); }
private async Task UpdateControl() { var currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); var exePath = Assembly.GetExecutingAssembly().Location; var updater = new UpdateManager($"{ServerURL}{UpdateEndpoint}", exePath); _globalVariables = await updater.CheckUpdate(); if (_globalVariables == null) { ShowError("Launcher bilgilerini okuyamadım. İnternet bağlantınızda veya sunucumuzda sorun olabilir."); } else { if (_globalVariables.Version.Equals(currentVersion)) { UpdateKontrolEdildi(); return; } var isDownloaded = await updater.DownloadUpdate(); if (!isDownloaded) { ShowInformation("Güncelleme kontrol edilirken bir hata oluştu."); UpdateKontrolEdildi(); return; } ShowInformation("Launcher güncellenecektir. Kapatılıp açılırken lütfen bekleyiniz...", Visibility.Hidden); updater.InstallUpdate(); } }
private bool NeedToUpdate() { if (this._LocalUpdateCollection != null) { this._UpdateCollection = new UpdateCollection(); foreach (UpdateObject UO in _RemoteUpdateCollection) { UpdateObject tUO = _LocalUpdateCollection[UO.name]; if (tUO == null) { _UpdateCollection.AddObject(UO); } else if (tUO.version != UO.version) { _UpdateCollection.AddObject(UO); } else if (tUO.localpath != UO.localpath) { MoveFile(tUO.name, tUO.localpath, UO.localpath); } } } this._UpdateCollection = (this._UpdateCollection != null) ? this._UpdateCollection : this._RemoteUpdateCollection; if (this._UpdateCollection.Count > 0) { return(true); } else { return(false); } }
public bool CanHandle(UpdateObject updateObject) { var text = updateObject.message.text; DateTime date; return(text == strings.Today || text == EmojiUtils.HomeIcon + strings.Home || DateTime.TryParseExact(text, "dd.MM", null, DateTimeStyles.None, out date) || CanHandleInternal(updateObject)); }
private TaskManager() { UpdateObject tobj = new UpdateObject("TaskManager", new Method.Method_Action(Update), null); tobj.MaxTime = MaxStep; GameUpdateManager.RegUpdate(tobj); }
/// <summary> /// 被更新字段参数名加上前缀"u", 如 Name=@uName,以此来使其与条件参数不同 /// </summary> /// <param name="updateObject"></param> /// <returns></returns> private string GetEntityCmd(UpdateObject updateObject) { StringBuilder sbText = new StringBuilder(); sbText.Append("UPDATE "); sbText.Append(typeof(T).Name); sbText.Append(" SET "); if (updateObject != null) { int n = 0; foreach (KeyValuePair <string, object> item in updateObject.DitUpdateInfo) { if (n != 0) { sbText.Append(","); } sbText.Append(item.Key); sbText.Append("=@u"); sbText.Append(item.Key); n++; } if (updateObject.Where != null) { sbText.Append(" "); sbText.Append(Common.GetWhereText(updateObject.Where)); } } sbText.Append(";"); return(sbText.ToString()); }
public bool BuildPacket(out UpdateObject packet) { packet = new UpdateObject(); packet.NumObjUpdates = BlockCount; packet.MapID = (ushort)MapId; WorldPacket buffer = new WorldPacket(); if (buffer.WriteBit(!outOfRangeGUIDs.Empty() || !destroyGUIDs.Empty())) { buffer.WriteUInt16((ushort)destroyGUIDs.Count); buffer.WriteInt32(destroyGUIDs.Count + outOfRangeGUIDs.Count); foreach (var destroyGuid in destroyGUIDs) { buffer.WritePackedGuid(destroyGuid); } foreach (var outOfRangeGuid in outOfRangeGUIDs) { buffer.WritePackedGuid(outOfRangeGuid); } } var bytes = data.GetData(); buffer.WriteInt32(bytes.Length); buffer.WriteBytes(bytes); packet.Data = buffer.GetData(); return(true); }
public bool CanHandle(UpdateObject updateObject) { var text = updateObject.message.text; int value; return(string.Equals(text, "/timezone") || string.Equals(text, EmojiUtils.CancelIcon + strings.Cancel) || int.TryParse(text, out value) || updateObject.message.location != null); }
public void Add(UpdateObject updateObject) { _list.Add(updateObject); if (_list.Count > 10) { _list.RemoveAt(0); } }
public Server(int port, UpdateObject function, ResetConnectionButtonState resetButtonFunction, ResetServer resetServerFunction) : base(port) { Sockets = new List <Socket>(); Function = function; ResetButtonFunction = resetButtonFunction; ResetServerFunction = resetServerFunction; }
IDisposable Update() { if (updateObject == null) { updateObject = new UpdateObject(this); } updateObject.Start(); return(updateObject); }
/// <summary> /// Update User | Used to update a `User`. **id** is the unique EMS User identifier (UID) in the EMS database. /// </summary> /// <param name="id">A user ID</param> /// <param name="body">Add any fieldName</param> /// <param name="xEmbarcaderoApplicationId"></param> /// <param name="xEmbarcaderoAppSecret"></param> /// <param name="xEmbarcaderoMasterSecret"></param> /// <returns>UpdatedObject</returns> public UpdatedObject UpdateUser(string id, UpdateObject body, string xEmbarcaderoApplicationId, string xEmbarcaderoAppSecret, string xEmbarcaderoMasterSecret) { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing required parameter 'id' when calling UpdateUser"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling UpdateUser"); } var path = "/users/{id}"; path = path.Replace("{format}", "json"); path = path.Replace("{" + "id" + "}", ApiClient.ParameterToString(id)); var queryParams = new Dictionary <String, String>(); var headerParams = new Dictionary <String, String>(); var formParams = new Dictionary <String, String>(); var fileParams = new Dictionary <String, FileParameter>(); String postBody = null; if (xEmbarcaderoApplicationId != null) { headerParams.Add("X-Embarcadero-Application-Id", ApiClient.ParameterToString(xEmbarcaderoApplicationId)); // header parameter } if (xEmbarcaderoAppSecret != null) { headerParams.Add("X-Embarcadero-App-Secret", ApiClient.ParameterToString(xEmbarcaderoAppSecret)); // header parameter } if (xEmbarcaderoMasterSecret != null) { headerParams.Add("X-Embarcadero-Master-Secret", ApiClient.ParameterToString(xEmbarcaderoMasterSecret)); // header parameter } postBody = ApiClient.Serialize(body); // http body (model) parameter // authentication setting, if any String[] authSettings = new String[] { }; // make the HTTP request IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, authSettings); if (((int)response.StatusCode) >= 400) { throw new ApiException((int)response.StatusCode, "Error calling UpdateUser: "******"Error calling UpdateUser: " + response.ErrorMessage, response.ErrorMessage); } return((UpdatedObject)ApiClient.Deserialize(response.Content, typeof(UpdatedObject), response.Headers)); }
private static void DespawnPlayer(PlayerEntity remote, PlayerEntity playerEntity) { List <ObjectEntity> despawnPlayer = new List <ObjectEntity> { playerEntity }; remote.Session.SendPacket(UpdateObject.CreateOutOfRangeUpdate(despawnPlayer)); remote.KnownPlayers.Remove(playerEntity); }
public UpdateObjectResponse UpdateObject(UpdateObjectRequest request) { EnsureAbsoluteUri(request); var command = new UpdateObject(_userId, _secret, _builder, _authenticator) { Parameters = request }; return((UpdateObjectResponse)((ICommandExecutor)this).Execute(command)); }
public bool CanHandle(UpdateObject updateObject) { if (updateObject.message.text.Equals("/15")) { return(true); } int value; return(int.TryParse(updateObject.message.text, out value) && value >= 1 && value <= 15); }
public static UpdateObject read(BinaryReader binaryReader) { UpdateObject newObj = new UpdateObject(); newObj.object_id = binaryReader.ReadUInt32(); newObj.objdesc = ObjDesc.read(binaryReader); newObj.physicsdesc = PhysicsDesc.read(binaryReader); newObj.wdesc = PublicWeenieDesc.read(binaryReader); return(newObj); }
} // end of UpdateObj c'tor public override void Update() { // Make sure camera resolution is always matching the screen resolution. shared.camera.Resolution = new Point((int)BokuGame.ScreenSize.X, (int)BokuGame.ScreenSize.Y); shared.camera.Update(); for (int i = 0; i < updateList.Count; i++) { UpdateObject obj = updateList[i]; obj.Update(); } }
// POST api/values public HttpResponseMessage Post(UpdateObject input) { try { _botHandler.Process(input); } catch (Exception) { } return(new HttpResponseMessage(HttpStatusCode.OK)); }
/// <summary> /// need to decide how to handle the /// </summary> /// <param name="upd"></param> private void UpdateIngredientXref(UpdateObject upd) { var linkedingredients = new MenuItemIngredient(); linkedingredients.menuitemingredientid = upd.xrefpk; linkedingredients.menuitemid = upd.menuid; linkedingredients.ingredientid = upd.ingredientid; linkedingredients.sortindex = upd.sortindex; linkedingredients.ServiceObjectId = upd.ServiceObjectId ?? new Guid(); linkedingredients.DataObjectId = upd.DataObjectId ?? new Guid(); linkedingredients.Insert(); }
public override void Update() { // Update the parent's list of objects. for (int i = 0; i < updateList.Count; i++) { UpdateObject obj = updateList[i] as UpdateObject; Debug.Assert(obj != null); obj.Update(); } // Ensure this reflex is at the correct indent position. parent.AnimatePanelIndent(false); }
public void Dispose() { if (TableExists != null) { TableExists.Dispose(); TableExists = null; } if (GetVersion != null) { GetVersion.Dispose(); GetVersion = null; } if (CreateSchema != null) { CreateSchema.Dispose(); CreateSchema = null; } if (UpsertObject != null) { UpsertObject.Dispose(); UpsertObject = null; } if (GetObject != null) { GetObject.Dispose(); GetObject = null; } if (QueryObjects != null) { QueryObjects.Dispose(); QueryObjects = null; } if (UpdateObject != null) { UpdateObject.Dispose(); UpdateObject = null; } if (GetQueuedRefreshes != null) { GetQueuedRefreshes.Dispose(); GetQueuedRefreshes = null; } }
public PsMovement(RealmServerSession session, MsgMoveInfo handler, RealmCMD opcode) : base(opcode) { if (session.Entity.Caindo) { return; } byte[] packedGuid = UpdateObject.GenerateGuidBytes((ulong)session.Character.Id); UpdateObject.WriteBytes(this, packedGuid); UpdateObject.WriteBytes(this, (handler.BaseStream as MemoryStream)?.ToArray()); // We then overwrite the original moveTime (sent from the client) with ours ((MemoryStream)BaseStream).Position = 4 + packedGuid.Length; UpdateObject.WriteBytes(this, BitConverter.GetBytes((uint)Environment.TickCount)); }
private void Initialize() { AnimationInstancing instance = GetComponent <AnimationInstancing>(); if (instance) { int count = instance.GetAnimationCount(); //instance.PlayAnimation(Random.Range(0, count)); AnimationInstancing attachmentScript = attachment.GetComponent <AnimationInstancing>(); instance.Attach("ik_hand_r", attachmentScript); } updateObject = new UpdateObject(this, UpdateRender); PlayableUpdateManager.Reg(updateObject); }
internal bool MergeDataProvider(DataProvider obj, PatternInstanceElement c, UpdateObject uo, ObjectTemplate t) { int saveObject = 0; bool overwrite = (uo == UpdateObject.OverWrite ? true : false); saveObject += MergeVariables(obj.Variables, c, t.Variables, overwrite); saveObject += MergeRules(obj.Rules, c, t.Rules, overwrite); saveObject += MergeDataProviderSource(obj.DataProviderSource, c, t.Source, overwrite); return saveObject > 0; }
internal bool MergeProcedure(Procedure obj, PatternInstanceElement c, UpdateObject uo, ObjectTemplate t) { int saveObject = 0; bool overwrite = (uo == UpdateObject.OverWrite ? true : false); saveObject += MergeVariables(obj.Variables, c, t.Variables, overwrite); saveObject += MergeConditions(obj.Conditions, c, t.Conditons, overwrite); saveObject += MergeRules(obj.Rules, c, t.Rules, overwrite); saveObject += MergeProcedureSource(obj.ProcedurePart, c, t.Source, overwrite); return saveObject > 0; }
internal bool MergeSDT(SDT obj, PatternInstanceElement c, UpdateObject uo, ObjectTemplate t) { int saveObject = 0; bool overwrite = (uo == UpdateObject.OverWrite ? true : false); saveObject += MergeSDTStructure(obj.SDTStructure, c, t.Source, overwrite); return saveObject > 0; }
internal bool MergeWebPanel(WebPanel obj, PatternInstanceElement c, UpdateObject uo, ObjectTemplate t) { int saveObject = 0; bool overwrite = (uo == UpdateObject.OverWrite ? true : false); saveObject += MergeVariables(obj.Variables, c, t.Variables, overwrite); saveObject += MergeConditions(obj.Conditions, c, t.Conditons, overwrite); if (uo != UpdateObject.OnlySource) { saveObject += MergeWebForm(obj.WebForm, c, t.WebForm, overwrite); } saveObject += MergeRules(obj.Rules, c, t.Rules, overwrite); saveObject += MergeEvents(obj.Events, c, t.Events, overwrite); saveObject += t.DeleteVariables(c, obj, overwrite); return saveObject > 0; }