public void ClientMoved(ClientMovedEventArgs e) { // czy klient był na obserwowanym kanale if (WasOnTackedChannel(e.ClientId)) { LeftTrackedChannel(e.ClientId); } if (channels.ContainsKey(e.TargetChannelId)) { UpdateTimers(); log.Info($"{DateTime.Now}: Client (clid:{e.ClientId}) moved to channel (cid:{e.TargetChannelId})."); ChannelData ch = channels[e.TargetChannelId]; if (ch.WasStaff) { return; } ClientData cd = GetClientData(e.ClientId); if (cd == null) { return; } ch.Join(cd); if (ch.NeedHelp) { InitializeTimer(ch); } return; } }
/// <summary> /// Handles the ClientMoved event of the Teamspeak Server. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientMovedEventArgs"/> instance containing the event data.</param> public void Notifications_ClientMoved(object sender, ClientMovedEventArgs e) { try { ManagerFactory.Invoke(e); } catch (Exception ex) { LogService.Error(ex.ToString()); } }
private static void ClientJoinToChannel(object sender, ClientMovedEventArgs e) { lock (eventLock) { if (events.ContainsKey(e.ClientId)) { events.Remove(e.ClientId); return; } events.Add(e.ClientId, true); channelService.ClientMoved(e); } }
private static void ClientMoved(object sender, ClientMovedEventArgs e) { if (DoubleEvent(e.ClientId)) { return; } lock (ClientLock(e.ClientId)) { if (clients.ContainsKey(e.ClientId)) { // TODO: pobrać więcej danych, albo oznaczyć, że wymaga aktualizacji grup kanałowych itp.. clients[e.ClientId].MovedToChannel(e.TargetChannelId); } } }
public async Task RegisterOnChannel(ClientMovedEventArgs e) { try { var clientInfo = new ClientInfoCommand(e.ClientId).ExecuteAsync(Interface.XfQueryBot.QueryClient) .Result; if (_config.RegisterChannels.ContainsKey((int)e.TargetChannelId)) { var channelId = Convert.ToInt16(e.TargetChannelId); if (clientInfo.TotalConnections < _config.RegisterChannels[channelId].ConnectionsNeeded || clientInfo.ConnectedTime.TotalSeconds < _config.RegisterChannels[channelId].SecondsNeeded || clientInfo.ServerGroups.Any(x => _config.RegisterChannels[channelId].RestrictedRanks.Any(y => y == x))) { await new ClientPokeCommand(e.ClientId, _config.KickMessage[CheckClientLang(clientInfo)]) .ExecuteAsync(Interface.XfQueryBot.QueryClient); await new ClientKickCommand(e.ClientId, KickReason.Channel, _config.KickMessage[CheckClientLang(clientInfo)]) .ExecuteAsync(Interface.XfQueryBot.QueryClient); } else { await new ServerGroupAddClientCommand( (uint)_config.RegisterChannels[(int)e.TargetChannelId].RankId, clientInfo.DatabaseId) .ExecuteAsync(Interface.XfQueryBot.QueryClient); await new ClientPokeCommand(e.ClientId, _config.SucessMessage[CheckClientLang(clientInfo)]) .ExecuteAsync(Interface.XfQueryBot.QueryClient); await new ClientKickCommand(e.ClientId, KickReason.Channel, _config.SucessMessage[CheckClientLang(clientInfo)]) .ExecuteAsync(Interface.XfQueryBot.QueryClient); } } } catch (Exception ex) { _log.Error($"({_addon.Name}) : {ex}"); } }
//Client moved by temporary channel (double-evented) private void Notifications_ClientMovedByTemporaryChannelCreate(object sender, ClientMovedEventArgs e) { //addonManager.addons.ForEach(f => f.onClientMovedByTemporaryChannelCreate(sender, e)); }
/// <summary> /// Invokes the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientMovedEventArgs"/> instance containing the event data.</param> public virtual void Invoke(ClientMovedEventArgs e) { Manager.Where(m => m.CanInvoke(e)).ForEach(m => m.Invoke(e)); }
/// <summary> /// Invokes the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientMovedEventArgs"/> instance containing the event data.</param> public override void Invoke(ClientMovedEventArgs e) { StickyChannel(e); }
private static void ClientMoved_JoiningChannel(object sender, ClientMovedEventArgs e) { ClientJoinToChannel(sender, e); }
/// <summary> /// Determines whether this instance can invoke the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientMovedEventArgs"/> instance containing the event data.</param> /// <returns> /// <c>true</c> if this instance can invoke the specified e; otherwise, <c>false</c>. /// </returns> public virtual bool CanInvoke(ClientMovedEventArgs e) { return(false); }
/// <summary> /// Invokes the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientMovedEventArgs"/> instance containing the event data.</param> public virtual void Invoke(ClientMovedEventArgs e) { }
/// <summary> /// Invokes the specified e. /// </summary> /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientMovedEventArgs"/> instance containing the event data.</param> public override void Invoke(ClientMovedEventArgs e) { PunishVoted(e); }
public virtual void onClientMovedByTemporaryChannelCreate(object sender, ClientMovedEventArgs e) { }
private static void ClientMoved_CreatingTemporaryChannel(object sender, ClientMovedEventArgs e) { ClientMoved(sender, e); }