protected virtual int GetProgress(ConquestState state, LogoutEventArgs args) { if (state.User == null) return 0; if (args == null || args.Mobile is PlayerMobile && args.Mobile.Account != state.User.Account) { return 0; } if (Map != null && Map != Map.Internal && (args.Mobile.Map == null || args.Mobile.Map != Map)) { if (MapChangeReset) { return -state.Progress; } return 0; } if (!String.IsNullOrWhiteSpace(Region) && (args.Mobile.Region == null || !args.Mobile.Region.IsPartOf(Region))) { if (RegionChangeReset) { return -state.Progress; } return 0; } return 1; }
private static void EventSink_Logout( LogoutEventArgs e ) { Mobile from = e.Mobile; InstanceRegion region = from.Region as InstanceRegion; if ( region != null ) region.Owner.Kick( from ); }
static void EventSink_Logout(LogoutEventArgs e) { Logger.LogMessage("Logout: " + e.Mobile.RawName, "Logins"); foreach (Mobile mobile in m_HearAll) { mobile.SendMessage("Logout: " + e.Mobile.RawName); } }
private static void OnLogout(LogoutEventArgs e) { Mobile m = e.Mobile; if (m != null) { if (Follow.Collection.Contains(m)) Follow.Collection.Remove(m); } }
public static void EventSink_Logout(LogoutEventArgs e) { Mobile from = e.Mobile; Party p = Party.Get(from); if (p != null) { p.Remove(from); } from.Party = null; }
private static void OnLogout(LogoutEventArgs e) { Mobile m = e.Mobile; if (m != null) { if (Follow.Collection.Contains(m)) { Follow.Collection.Remove(m); } } }
public static void OnLogout(LogoutEventArgs e) { if (m_AFK.Contains(e.Mobile.Serial.Value)) { AFK afk = (AFK)m_AFK[e.Mobile.Serial.Value]; if (afk == null) { e.Mobile.SendMessage("Afk object missing!"); return; } afk.wakeUp(); } }
private void bt_rsRequest_Click(object sender, RoutedEventArgs e) { if (banker.applyForRes(cb_progName.Text, requestManager.getVector())) { LogoutEventArgs a = new LogoutEventArgs("success: 申请资源成功."); Logout.NewMsg(a); } else { LogoutEventArgs a = new LogoutEventArgs("申请资源失败."); Logout.NewMsg(a); } }
private void bt_addRes_Click(object sender, RoutedEventArgs e) { if (banker.getResNum() >= 26) { LogoutEventArgs a = new LogoutEventArgs("error: 最多支持26个种类的资源"); Logout.NewMsg(a); return; } newProgMax.newColumn(); request.newColumn(); banker.newRes(); tb_resCount.Text = ((Convert.ToInt32(tb_resCount.Text) + 1).ToString()); }
void OnLogout(object sender, LogoutEventArgs e) { var dataClient = (DataClient)sender; dataClient.Logout -= this.OnLogout; if (e.Reason == LogoutReason.InvalidCredentials) { this.eventArgs = e; } this.syncEvent.Set(); }
public static void EventSink_Logout(LogoutEventArgs e) { Mobile from = e.Mobile; TeleportingInfo info; if (from == null || !m_Table.TryGetValue(from, out info)) { return; } info.Timer.Stop(); m_Table.Remove(from); }
private static void HandleOnLogout(LogoutEventArgs args) { Mobile m = args.Mobile; try { StaticTile[] tiles = m.Map.Tiles.GetStaticTiles(m.X, m.Y, true); NetState state = (NetState)m.NetState; int tileID = 0; bool safe = false; int[] bedID = new int[] { 2651, 2653, 2654, 2656, 2659, 2660, 2662, 2663, 2665, 2666, 2682, 2684, 2688, 2690, 2692, 2696, 2702, 2704 }; foreach (Item item in m.GetItemsInRange(6)) { for (int i = 0; !safe && i < bedID.Length; i++) { for (int j = 0; !safe && j < tiles.Length; j++) { tileID = tiles[j].ID; if (tiles[j].Z == m.Z) { safe = (tileID == bedID[i]) || (item.ItemID == bedID[i]); } } } } if (safe) { ((PlayerMobile)m).BedrollLogout = true; if (state != null) { state.Dispose(); } } } catch (Exception e) { ExceptionManager.LogException("StartupSettings.cs", e); } }
/// <summary> /// On player logout, broadcast a message. /// </summary> public static void EventSink_Logout(LogoutEventArgs e) { if (e.Mobile.Player) { if (e.Mobile.AccessLevel <= m_AnnounceLevel) { CommandHandlers.BroadcastMessage(AccessLevel.Player, m_LogoutHue, String.Format(m_LogoutMessage, e.Mobile.Name)); } else //broadcast any other level to the staff { CommandHandlers.BroadcastMessage(AccessLevel.Counselor, m_LogoutHue, String.Format(m_LogoutMessage, e.Mobile.Name)); } } }
private static void EventSink_Logout( LogoutEventArgs e ) { Mobile mob = e.Mobile; Container pack = mob.Backpack; if ( pack == null ) return; Item[] sigils = pack.FindItemsByType( typeof( Sigil ) ); for ( int i = 0; i < sigils.Length; ++i ) ((Sigil)sigils[i]).ReturnHome(); }
private static void EventSink_Logout(LogoutEventArgs e) { ScriptMobile sm = e.Mobile as ScriptMobile; sm.Detection.ResetAlentours(); foreach (NetState state in NetState.Instances) { ScriptMobile m = state.Mobile as ScriptMobile; if (m != null) { m.Detection.RetirerJoueurDesAlentours(sm); } } }
private void bt_updateAvaliable_Click(object sender, RoutedEventArgs e) { List <int> newRes = resCountManager.getVector(); if (banker.modifyRes(newRes)) { LogoutEventArgs a = new LogoutEventArgs("success: 资源已更新."); Logout.NewMsg(a); } else { LogoutEventArgs a = new LogoutEventArgs("error: 资源更新失败."); Logout.NewMsg(a); } }
private static void EventSink_Logout( LogoutEventArgs args ) { Mobile m = args.Mobile; try { Stream fileStream = File.Open( "Logs/LoginLogout/" + m.Account + ".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite ); StreamWriter writeAdapter = new StreamWriter( fileStream ); writeAdapter.WriteLine( String.Format( "Disconnected: {0} logged out as {1} on {2}", m.Account, m.Name, DateTime.Now ) ); writeAdapter.Close(); } catch { Console.WriteLine( "Record Error... {0} Logout", m.Account ); } }
private static void EventSink_Logout(LogoutEventArgs e) { Mobile from = e.Mobile; List <Matchmaking> toremove = WaitingForParty.Where(match => match.Player == @from).ToList(); if (toremove.Count <= 0) { return; } foreach (Matchmaking drop in toremove.Where(drop => WaitingForParty.Contains(drop))) { WaitingForParty.Remove(drop); } }
private static void HandleOnLogout( LogoutEventArgs args ) { Mobile m = args.Mobile; try { StaticTile[] tiles = m.Map.Tiles.GetStaticTiles(m.X, m.Y, true); NetState state = (NetState)m.NetState; int tileID = 0; bool safe = false; int[] bedID = new int[] { 2651, 2653, 2654, 2656, 2659, 2660, 2662, 2663, 2665, 2666, 2682, 2684, 2688, 2690, 2692, 2696, 2702, 2704 }; foreach( Item item in m.GetItemsInRange(6) ) { for( int i = 0; !safe && i < bedID.Length; i++ ) { for( int j = 0; !safe && j < tiles.Length; j++ ) { tileID = tiles[j].ID; if( tiles[j].Z == m.Z ) safe = (tileID == bedID[i]) || (item.ItemID == bedID[i]); } } } if( safe ) { ((PlayerMobile)m).BedrollLogout = true; if( state != null ) state.Dispose(); } } catch( Exception e ) { ExceptionManager.LogException("StartupSettings.cs", e); } }
private static void EventSink_Logout(LogoutEventArgs args) { Mobile m = args.Mobile; try { Stream fileStream = File.Open("Logs/LoginLogout/" + m.Account + ".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite); StreamWriter writeAdapter = new StreamWriter(fileStream); writeAdapter.WriteLine(String.Format("Disconnected: {0} logged out as {1} on {2}", m.Account, m.Name, DateTime.Now)); writeAdapter.Close(); } catch { Console.WriteLine("Record Error... {0} Logout", m.Account); } }
void OnLogout(object sender, LogoutEventArgs e) { if (this.InvokeRequired) { this.InvokeInPrimaryThread(OnLogout, sender, e); return; } if (string.IsNullOrEmpty(e.Text)) { this.Log("Logout event is received; reason = {0}", e.Reason); } else { this.Log("Logout event is received; reason = {0}; Text = {1}", e.Reason, e.Text); } }
// Si un GM se déconnecte on le retire de la liste lui et ses PNJ écoutés private static void GMLogout(LogoutEventArgs args) { if (args.Mobile == null || args.Mobile.AccessLevel == AccessLevel.Player) { return; } Mobile gm = args.Mobile; for (int i = 0; i < ListenedMobiles.Length; i++) { if (ListenedMobiles[i] != null && ListenedMobiles[i][0] == gm) { ListenedMobiles[i] = null; } } }
private void newProgress_Click(object sender, RoutedEventArgs e) { if (tb_newProgName.Text == "") { LogoutEventArgs a = new LogoutEventArgs("error: 进程名为空"); Logout.NewMsg(a); return; } List <int> progMax = newProgMaxManager.getVector(); if (banker.newProgress(tb_newProgName.Text, progMax)) { cb_progName.ItemsSource = null; cb_progName.ItemsSource = banker.getProgressNameList(); tb_progressNum.Text = ((Convert.ToInt32(tb_progressNum.Text) + 1).ToString()); tb_newProgName.Clear(); } }
public static void OnLogoutImpl(LogoutEventArgs e) { var user = e.Mobile as PlayerMobile; if (user == null || !Instances.ContainsKey(user)) { return; } VitaNexCore.TryCatch( () => { foreach (SuperGump g in GetInstances <SuperGump>(user, true)) { g.Close(true); } }, x => x.ToConsole(true)); }
private static void EventSink_Logout(LogoutEventArgs args) { Stream fileStream = null; StreamWriter writeAdapter = null; Mobile m = args.Mobile; try { fileStream = File.Open("logs/Logout/" + args.Mobile.Name + ".log", FileMode.Append, FileAccess.Write, FileShare.ReadWrite); writeAdapter = new StreamWriter(fileStream); writeAdapter.WriteLine(args.Mobile.Name + " " + DateTime.Now + " Logout"); writeAdapter.Close(); } catch { Console.WriteLine("Record Error......{0} Logout", args.Mobile.Name); return; } }
public bool applyForRes(string name, List <int> request) { //清空workAllocation workAllocation.clearAll(); List <string> safetyList = bankerAlg(name, request); if (safetyList != null) { StringBuilder sb = new StringBuilder("安全序列:{"); foreach (string i in safetyList) { sb.Append(i + ","); } sb.Remove(sb.Length - 1, 1); sb.Append("}"); LogoutEventArgs e = new LogoutEventArgs(sb.ToString()); Logout.NewMsg(e); return(true); } return(false); }
private static void EventSink_Logout(LogoutEventArgs e) { Mobile m = e.Mobile; if (m == null) { return; } Duel duel; if (IsInDuel(m, out duel) && !m_TimeoutTable.ContainsKey(m.Serial)) { if (duel != null && duel.Started) { LogoutTimeoutTimer timer = new LogoutTimeoutTimer(m, duel); timer.Start(); m_TimeoutTable.Add(m.Serial, timer); } } }
public virtual bool newRow(string header) { if (progressName.Contains(header)) { LogoutEventArgs e = new LogoutEventArgs("error: 已存在同名进程,创建失败."); Logout.NewMsg(e); return(false); } else { progressName.Add(header); List <Int32> t = new List <int>(); for (int i = 0; i < columnNum; i++) { t.Add(0); } data.Add(t); row++; onDataChanged(null); return(true); } }
public bool newProgress(string name, List <int> vector) { //判断是否超过resCount向量,若超过,返回false报错 List <int> resCountList = resCount.getDataList(); if (!BankerHelper.VectorLess(vector, resCountList)) { LogoutEventArgs e = new LogoutEventArgs("error: 新建进程的最大需求资源数超过最大资源数."); Logout.NewMsg(e); return(false); } if (max.newRow(name)) { //修改max max.modify(name, vector); need.newRow(name); allocation.newRow(name); //增加进程数 progNum++; //计算need矩阵的值 List <List <Int32> > t = new List <List <int> >(); for (int i = 0; i < progNum; i++) { t.Add(new List <int>()); for (int j = 0; j < resNum; j++) { t[i].Add(0); } } BankerHelper.MatrixRed(max.getData(), allocation.getData(), ref t); need.modify(t); return(true); } return(false); }
private static void OnLogout(LogoutEventArgs e) { if (e.Mobile is PlayerMobile) { ((PlayerMobile)e.Mobile).AutoStablePets(); } #region Scroll of Alacrity if (((PlayerMobile)e.Mobile).AcceleratedStart > DateTime.UtcNow) { ((PlayerMobile)e.Mobile).AcceleratedStart = DateTime.UtcNow; ScrollofAlacrity.AlacrityEnd(e.Mobile); } #endregion }
private static void OnLogout(LogoutEventArgs e) { }
private static void EventSink_Logout(LogoutEventArgs args) { Mobile player = args.Mobile; HideChatFrom(player); }
private static void World_Logout(LogoutEventArgs args) { World.Broadcast(0x482, false, "{0} has left our world.", args.Mobile.Name); }
private static void OnLogout( LogoutEventArgs e ) { PlayerMobile pm = e.Mobile as PlayerMobile; if (pm != null) { pm.AbortCurrentPlayerAction(); ((PlayerMobile) e.Mobile).AutoStablePets(); } }
private static void EventSink_Logout(LogoutEventArgs e) { Mobile mob = e.Mobile; Container pack = mob.Backpack; if (pack == null) { return; } foreach (Sigil s in pack.FindItemsByType<Sigil>()) { s.ReturnHome(); } }
public static void RunOnLogout(LogoutEventArgs e) { AppSettings.SessionState.SessionId = ""; }
public void OnLogout( LogoutEventArgs e ) { /* Publish 59: Players can no longer log out without repercussions in Champ Spawn regions * - Players that log out in a champ spawn region will get teleported to a shrine * - If a player logs out in a champ spawn area all the non equipped "cursed" items on them will drop to the ground * - This will only affect players who log out beyond the 10 minute grace period; accidental disconnections will not be punished */ Mobile m = e.Mobile; if ( m.Region.IsPartOf( m_Region ) ) { if ( m.Backpack != null ) { List<Item> list = new List<Item>(); RecurseGetCursedItems( m.Backpack, list ); foreach ( Item item in list ) item.MoveToWorld( m.Location, m.Map ); } m.Location = ExorcismSpell.GetNearestShrine( m ); } }
private static void OnPlayerLogout(LogoutEventArgs args) { PlayerWeapons.Remove(args.Mobile.Serial.Value); }
void OnLogout(object sender, LogoutEventArgs e) { Console.WriteLine("OnLogout(): {0}", e); }
private void UserController_LogoutEvent(object source, LogoutEventArgs e) { switchToLoginController(); }
protected void OnLogout( LogoutEventArgs e ) { if ( GetMobiles().Contains( e.Mobile ) ) e.Mobile.MoveToWorld( new Point3D( 1071, 1057, -43 ), Map.TerMur ); }
private static void OnLogout(LogoutEventArgs e) { if (TestCenter.Enabled && e.Mobile is PlayerMobile) { ((PlayerMobile)e.Mobile).AutoStablePets(); } if (e.Mobile != null && e.Mobile.Account is Account) { ((Account)e.Mobile.Account).LogIPAccess(null, true); } #region SmoothMove if (((PlayerMobile)e.Mobile).Transport != null) ((PlayerMobile)e.Mobile).Transport.LeaveCommand((PlayerMobile)e.Mobile); #endregion }
public void InvokeLogout( LogoutEventArgs e ) { if ( Logout != null ) Logout( e ); }
private static void EventSink_Logout(LogoutEventArgs e) { Mobile mob = e.Mobile; Container pack = mob.Backpack; if (pack == null) return; Item[] sigils = pack.FindItemsByType(typeof(Sigil)); for (int i = 0; i < sigils.Length; ++i) ((Sigil)sigils[i]).ReturnHome(); }
private static void OnLogout(LogoutEventArgs e) { Mobile from = e.Mobile; if (m_Instruments.ContainsKey(from)) { m_LogoutCleanup[from] = Timer.DelayCall(TimeSpan.FromMinutes(60.0), ExpireInstrumentPick, from); } }
void OnLogout(Object sender, LogoutEventArgs e) { this.logoutReason = e.Reason; this.logoutEvent.Set(); }
private static void EventSink_Logout(LogoutEventArgs e) { Mobile m = e.Mobile; if (m == null) return; Duel duel; if (IsInDuel(m, out duel) && !m_TimeoutTable.ContainsKey(m.Serial)) { if (duel != null && duel.Started) { LogoutTimeoutTimer timer = new LogoutTimeoutTimer(m, duel); timer.Start(); m_TimeoutTable.Add(m.Serial, timer); } } }
private void OnLogout(Object sender, LogoutEventArgs e) { //_logger.InfoFormat("OnLogout() "); IsConnected = false; }
private static void OnLogout( LogoutEventArgs e ) { if( e.Mobile is PlayerMobile ) ((PlayerMobile)e.Mobile).AutoStablePets(); }
public static void EventSink_Logout( LogoutEventArgs e ) { Mobile from = e.Mobile; Party p = Get( from ); if ( p != null ) p.Remove( from ); from.Party = null; }