public ItemDropSoundAlertPlugin() { Enabled = true; Legendary = false; AncientLegendary = false; PrimalAncientLegendary = true; Set = false; AncientSet = false; PrimalAncientSet = true; Gambled = true; InTown = true; AncientLegendaryNamePrefix = string.Empty; PrimalAncientLegendaryNamePrefix = string.Empty; AncientSetNamePrefix = string.Empty; PrimalAncientSetNamePrefix = string.Empty; ItemSnos = new HashSet <uint>(); AncientItemSnos = new HashSet <uint>(); PrimalAncientItemSnos = new HashSet <uint>(); ItemCustomNames = new Dictionary <uint, string>(); SoundAlert = SoundAlertFactory.Create <IItem>((item) => GetItemName(item)); }
public SoundAlertDecorator(IController hud, SoundAlert <T> soundAlert = null) : this(hud) { SoundAlert = soundAlert ?? new SoundAlert <T>() { TextFunc = (actor) => actor.SnoActor.NameLocalized }; }
/// <summary> /// Sound����������Ϣ��ȡ�� /// </summary> /// <param name="AccessInformation"></param> /// <param name="AlertIndex"></param> /// <returns></returns> public GetSoundAlertResult GetSoundAlert(AccessControl AccessInformation, string AlertIndex) { GetSoundAlertResult Result = new GetSoundAlertResult(); SoundAlert sound = new SoundAlert(); string estr = ""; bool ret = true; ret = GetAccessControlInformation(AccessInformation); if (!ret) { estr = keytext[ErrorInfo.AccessControlError.ToString()]; } string strServer = "localhost"; string strUser = "******"; if (AccessInformation.LimitServer) { strServer = AccessInformation.SVDBServer; } if (AccessInformation.LimitUser) { strUser = AccessInformation.UserID; } while (ret) { if (this.iniFile == null) { this.iniFile = new IniFileDaoImpl(); } IDictionary<string, NameValueCollection> sectionlists = this.iniFile.GetIniFileBySection("alert.ini", AlertIndex); sound.BaseInfo = GetIniBaseAlertInfo(AlertIndex, sectionlists); sound.ServerName = sectionlists[AlertIndex]["Server"]; sound.LoginName = sectionlists[AlertIndex]["LoginName"]; sound.LoginPassword = sectionlists[AlertIndex]["LoginPwd"]; break; } Result.ErrorInformation = estr; Result.GetSoundAlertOK = ret; Result.ResponseData = sound; return Result; }
public AddAlertResult AddSoundAlert(AccessControl AccessInformation, SoundAlert AlertInformation) { AddAlertResult Result = new AddAlertResult(); string estr = ""; bool ret = true; string strServer = ""; string strUser = ""; while (ret) { ret = GetAccessControlInformation(AccessInformation); if (!ret) { estr = keytext[ErrorInfo.AccessControlError.ToString()]; } strServer = "localhost"; strUser = "******"; if (AccessInformation.LimitServer) { strServer = AccessInformation.SVDBServer; } if (AccessInformation.LimitUser) { strUser = AccessInformation.UserID; } if (IsAlertNameExist(AccessInformation, AlertInformation.BaseInfo.Name)) { ret = false; estr = keytext[ErrorInfo.AlertNameError.ToString()]; break; } //script���� break; } string strAlertIndex = ""; while (ret) { strAlertIndex = GenerateAlertIndex(AccessInformation); AlertInformation.BaseInfo.ID = strAlertIndex; //���ݴ洢���� ret = SetIniBaseAlertInfo(AccessInformation, AlertInformation.BaseInfo, estr); if (!ret) { break; } //email���� if (this.iniFile == null) { this.iniFile = new IniFileDaoImpl(); } this.iniFile.WriteIniFileString("alert.ini", strAlertIndex, "Server", AlertInformation.ServerName); this.iniFile.WriteIniFileString("alert.ini", strAlertIndex, "LoginName", AlertInformation.LoginName); this.iniFile.WriteIniFileString("alert.ini", strAlertIndex, "LoginPwd", AlertInformation.LoginPassword); if (queue == null) { this.queue = new QueueDaoImpl(); } //send message to service bool meseagebool = this.queue.PushStringMessage("SiteView70-Alert", "IniChange", "alert.ini," + strAlertIndex + ",ADD"); if (!meseagebool) { estr = keytext[ErrorInfo.PushMessageError.ToString()]; } break; } Result.ErrorInformation = estr; Result.AddAlertOK = ret; Result.AlertIndex = strAlertIndex; return Result; }