private static void EventSink_HelpRequest(HelpRequestEventArgs e) { var from = e.Mobile; var state = from.Client; var gumps = state.Gumps; if (gumps == null) { // Temporary code Logger.Error("Help request with gumps == null, from={0}, state={1}", from, state); return; } foreach (Gump g in gumps) { if (g is HelpGump) { return; } } if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendGump(new HelpGump(e.Mobile)); } }
private static void EventSink_HelpRequest(HelpRequestEventArgs e) { var from = e.Mobile; var state = from.NetState; var gumps = state.Gumps; foreach (Gump g in gumps) { if (g is HelpGump) { return; } } if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendGump(new HelpGump(e.Mobile)); } }
protected virtual void FireAfterSave(HelpRequestEventArgs e) { if (AfterSave != null) { AfterSave(this, e); } }
private static void EventSink_HelpRequest( HelpRequestEventArgs e ) { foreach ( Gump g in e.Mobile.NetState.Gumps ) { if ( g is HelpGump ) return; } if ( !PageQueue.CheckAllowedToPage( e.Mobile ) ) return; if ( PageQueue.Contains( e.Mobile ) ) e.Mobile.SendMenu( new ContainedMenu( e.Mobile ) ); else e.Mobile.SendGump( new HelpGump( e.Mobile ) ); }
private static void EventSink_HelpRequest(HelpRequestEventArgs e) { PlayerMobile pm = (PlayerMobile)e.Mobile; if (AutoStaffTeam.Enabled) //If automated staff team enabled, begin the new gump process. { if (pm.LastTimePaged + CanHelpAgain <= DateTime.Now || pm.AccessLevel > AccessLevel.Player) { if (e.Mobile.HasGump(typeof(StaffKeyWordsGump))) { e.Mobile.CloseGump(typeof(StaffKeyWordsGump)); e.Mobile.SendMessage("Please close the key words gump before calling a staff member."); return; } StaffBot sb = new StaffBot(); sb.MoveToWorld(e.Mobile.Location, e.Mobile.Map); e.Mobile.SendGump(new StaffKeyWordsGump(e.Mobile)); pm.LastTimePaged = DateTime.Now; return; } e.Mobile.SendMessage("You may only page a staff member once every hour. If you need assistance now, please send an email to [email protected]."); return; } foreach (Gump g in e.Mobile.NetState.Gumps) { if (g is HelpGump) { return; } } if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendGump(new HelpGump(e.Mobile)); } }
public void Save() { HelpRequestEventArgs e = new HelpRequestEventArgs(); FireBeforeSave(e); if (!e.Cancel) { Data.SqlHelper.ExecuteNonQuery( "INSERT INTO wikiHelpRequest (section, application, applicationPage, url) VALUES(@section, @application, @applicationPage, @url)", Data.SqlHelper.CreateParameter("@section", Section), Data.SqlHelper.CreateParameter("@application", Application), Data.SqlHelper.CreateParameter("@applicationPage", ApplicationPage), Data.SqlHelper.CreateParameter("@url", Url)); FireAfterSave(e); } }
private static void EventSink_HelpRequest(HelpRequestEventArgs args) { Mobile m = args.Mobile; if (m.HasGump(typeof(HelpGump)) || !PageQueue.AllowedToPage(m)) { return; } if (PageQueue.Contains(m)) { m.SendMenu(new ContainedMenu(m)); } else { m.SendGump(new HelpGump(m)); } }
public void Save() { HelpRequestEventArgs e = new HelpRequestEventArgs(); FireBeforeSave(e); if (!e.Cancel) { Data.SqlHelper.ExecuteNonQuery( "INSERT INTO wikiHelpRequest (section, application, applicationPage, url) VALUES(@section, @application, @applicationPage, @url)", Data.SqlHelper.CreateParameter("@section", Section), Data.SqlHelper.CreateParameter("@application", Application), Data.SqlHelper.CreateParameter("@applicationPage", ApplicationPage), Data.SqlHelper.CreateParameter("@url", Url)); FireAfterSave(e); } }
private static void EventSink_HelpRequest(HelpRequestEventArgs e) { if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (StuckMenu.IsInSecondAgeArea(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendMenu(new HelpMenu()); //e.Mobile.SendGump( new HelpGump( e.Mobile ) ); } }
public void Save() { var helpRequestEventArgs = new HelpRequestEventArgs(); FireBeforeSave(helpRequestEventArgs); if (helpRequestEventArgs.Cancel) return; using (var sqlHelper = umbraco.BusinessLogic.Application.SqlHelper) { sqlHelper.ExecuteNonQuery( "INSERT INTO wikiHelpRequest (section, application, applicationPage, url) VALUES(@section, @application, @applicationPage, @url)", sqlHelper.CreateParameter("@section", Section), sqlHelper.CreateParameter("@application", Application), sqlHelper.CreateParameter("@applicationPage", ApplicationPage), sqlHelper.CreateParameter("@url", Url)); FireAfterSave(helpRequestEventArgs); } }
private static void EventSink_HelpRequest(HelpRequestEventArgs e) { if (e.Mobile.NetState.Gumps.OfType<HelpGump>().Any()) { return; } if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendGump(new HelpGump(e.Mobile)); } }
private static void EventSink_HelpRequest(HelpRequestEventArgs e) { if (e.Mobile.NetState.Gumps.OfType <HelpGump>().Any()) { return; } if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendGump(new HelpGump(e.Mobile)); } }
private static void EventSink_HelpRequest(HelpRequestEventArgs e) { /*foreach ( Gump g in e.Mobile.NetState.Gumps ) * { * if ( g is HelpGump ) * return; * }*/ if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendMenu(new HelpMenu(e.Mobile)); } }
private static void EventSink_HelpRequest(HelpRequestEventArgs e) { //foreach ( Gump g in e.Mobile.NetState.Gumps ) //{ // if ( g is HelpGump ) // return; //} //if ( !PageQueue.CheckAllowedToPage( e.Mobile ) ) // return; //if ( PageQueue.Contains( e.Mobile ) ) // e.Mobile.SendMenu( new ContainedMenu( e.Mobile ) ); //else // e.Mobile.SendGump( new HelpGump( e.Mobile ) ); foreach (Gump g in e.Mobile.NetState.Gumps) { if (g is HelpSystemGump) { return; } } if (!PageQueue.CheckAllowedToPage(e.Mobile)) { return; } if (PageQueue.Contains(e.Mobile)) { e.Mobile.SendMenu(new ContainedMenu(e.Mobile)); } else { e.Mobile.SendGump(new HelpSystemGump(e.Mobile)); } }
public void Save() { var helpRequestEventArgs = new HelpRequestEventArgs(); FireBeforeSave(helpRequestEventArgs); if (helpRequestEventArgs.Cancel) { return; } using (var sqlHelper = umbraco.BusinessLogic.Application.SqlHelper) { sqlHelper.ExecuteNonQuery( "INSERT INTO wikiHelpRequest (section, application, applicationPage, url) VALUES(@section, @application, @applicationPage, @url)", sqlHelper.CreateParameter("@section", Section), sqlHelper.CreateParameter("@application", Application), sqlHelper.CreateParameter("@applicationPage", ApplicationPage), sqlHelper.CreateParameter("@url", Url)); FireAfterSave(helpRequestEventArgs); } }
public void InvokeHelpRequest( HelpRequestEventArgs e ) { if ( HelpRequest != null ) HelpRequest( e ); }
protected virtual void FireAfterSave(HelpRequestEventArgs e) { if (AfterSave != null) AfterSave(this, e); }
protected virtual void FireBeforeSave(HelpRequestEventArgs e) { _e.FireCancelableEvent(BeforeSave, this, e); }
protected virtual void FireBeforeSave(HelpRequestEventArgs e) { _e.FireCancelableEvent(BeforeSave, this, e); }