public static void OnUpdated(Service service, UpdateFeatureMatrix op) { if (FeatureMatrix.onUpdated != null) { FeatureMatrix.onUpdated(service, op); } }
public void UpdateFeatureMatrix(string feature, bool on, int targetServiceID) { if (feature != null && feature.Length > 0) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); char[] separator = new char[] { ';' }; string[] array = feature.Split(separator); for (int i = 0; i < array.Length; i++) { string text = array[i]; string text2 = "0"; int num = array[i].IndexOf('['); int num2 = array[i].IndexOf(']'); if (num != -1 && num2 != -1 && num2 > num) { text = array[i].Substring(0, num); text2 = array[i].Substring(num + 1, num2 - num - 1); } if (text != null && text.Length > 0) { dictionary[text] = (on ? text2 : null); } } if (dictionary.Count > 0) { FeatureMatrix.OverrideFeature(dictionary); HashSet <string> exceptCategoryList = new HashSet <string>(); exceptCategoryList.Add("UnifiedNetwork.LocationService.LocationService"); exceptCategoryList.Add("AdminClientServiceCore.AdminClientService"); IEnumerable <int> enumerable = from x in base.LookUp.ReportLookUpInfo() where !exceptCategoryList.Contains(x.Key) select x.Value; foreach (int num3 in enumerable) { if (targetServiceID == -1 || num3 == targetServiceID) { UpdateFeatureMatrix op = new UpdateFeatureMatrix(dictionary); base.RequestOperation(num3, op); } } } } }
public bool SetDailyGPLimit() { string argString = base.Operation.GetArgString(0, ""); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary.Add("GuildLevel_DailyGPLimit", argString); FeatureMatrix.OverrideFeature(dictionary); GuildContents.LoadGuildDailyGPLimit(); GuildService guildService = base.Entity.Service; if (guildService != null) { UpdateFeatureMatrix op = new UpdateFeatureMatrix(dictionary); foreach (IEntity entity in guildService.Entities) { GuildEntity guildEntity = entity.Tag as GuildEntity; foreach (OnlineGuildMember onlineGuildMember in guildEntity.OnlineMembers.Values) { onlineGuildMember.FrontendConn.RequestOperation(op); } } } return(true); }
private void OnUpdatedFetureMatrix(UnifiedNetwork.OperationService.Service service, UpdateFeatureMatrix operation) { if (base.ID != service.ID) { return; } Log <DSService> .Logger.WarnFormat("Updating FeatureMatrix", new object[0]); SyncFeatureMatrixMessage message = new SyncFeatureMatrixMessage(FeatureMatrix.GetFeatureMatrixDic()); foreach (DSEntity dsentity in this.DSEntities.Values) { dsentity.SendMessage <SyncFeatureMatrixMessage>(message); } }