private void StartAttributeWatch() { ErrorMessage = String.Empty; if (String.IsNullOrEmpty(_callId)) { return; } try { Interaction interaction = InteractionsManager.GetInstance(_session).CreateInteraction(new InteractionId(_callId)); if (interaction == null) { return; } _watchedInteraction = interaction; _watchedInteraction.AttributesChanged += OnInteractionAttributesChanged; _watchedInteraction.Deallocated += OnInteractionDeallocated; _watchedInteraction.StartWatching(_attributeNames.ToArray()); } catch (Exception ex) { ErrorMessage = ex.Message; } }
private void SetInteractionQueue() { if (InteractionQueue == null) { InteractionQueue = new InteractionQueue(InteractionsManager.GetInstance(Session), new QueueId(QueueType.MyInteractions, Session.UserId)); } InteractionQueue.InteractionAdded += InteractionQueueInteractionAdded; InteractionQueue.InteractionChanged += InteractionQueueInteractionChanged; InteractionQueue.InteractionRemoved += InteractionQueueInteractionRemoved; InteractionQueue.ConferenceInteractionAdded += InteractionQueueConferenceInteractionAdded; InteractionQueue.ConferenceInteractionChanged += InteractionQueueConferenceInteractionChanged; InteractionQueue.ConferenceInteractionRemoved += InteractionQueueConferenceInteractionRemoved; List <string> RequiredAttributes = new List <string>(); RequiredAttributes.Add(InteractionAttributeName.CallIdKey.ToString()); RequiredAttributes.Add(InteractionAttributeName.RemoteName.ToString()); RequiredAttributes.Add(InteractionAttributeName.RemoteAddress.ToString()); RequiredAttributes.Add(InteractionAttributeName.State.ToString()); //RequiredAttributes.Add(InteractionAttributeName.SupervisorRecorders.ToString()); //RequiredAttributes.Add(InteractionAttributeName.Recorders.ToString()); RequiredAttributes.Add(InteractionAttributeName.Muted.ToString()); InteractionQueue.StartWatchingAsync(RequiredAttributes.ToArray(), UpdateInteractionList, null); }
void Start() { rb = GetComponent <Rigidbody2D>(); sprite = transform.GetChild(0).GetComponent <SpriteRenderer>(); anim = transform.GetChild(0).GetComponent <Animator>(); inventory = GetComponent <PlayerInventory>(); nightCycle = GameObject.Find("Global Light (Sun)").GetComponent <DayNightCycleManager>(); playerSoundManager = GetComponent <PlayerSoundManager>(); cameraHandler = GameObject.Find("Camera Manager").GetComponent <CameraHandler>(); transitionHandler = GameObject.Find("Transition Handler").GetComponent <TransitionHandler>(); interactionsManager = GetComponent <InteractionsManager>(); individualInteractions = GameObject.Find("Interactions Manager").GetComponent <IndividualInteractions>(); playerCollider = GetComponent <BoxCollider2D>(); gm = GameObject.Find("Game Manager").GetComponent <GameManager>(); pickUpTarget = canoe.transform.GetChild(0).GetChild(0); montyObj = GameObject.Find("Monty"); montyStateActions = montyObj.GetComponent <MontyStateActions>(); montyStateManager = montyObj.GetComponent <MontyStateManager>(); montyStateVariables = montyObj.GetComponent <MontyStateVariables>(); firstPet = false; //canoe = GameObject.Find("Canoe"); //canoeTarget = GameObject.Find("canoeTarget"); xSpeed = defaultXSpeed; ySpeed = defaultYSpeed; canoeWalkSpeed = defaultCanoeWalkSpeed; }
private void Start() { player = GameObject.Find("Player"); interactionsManager = player.GetComponent <InteractionsManager>(); rangeToIgnore = transform.GetChild(0).GetChild(1).GetComponent <CircleCollider2D>(); gameManager = GameObject.Find("Game Manager").GetComponent <GameManager>(); grid = GameObject.Find("Pathfinding Grids").transform.GetChild(gameManager.GetCurrentIsland()).GetComponent <MyGrid>(); }
public InteractionManager(Session session, IQueueService queueService, ITraceContext traceContext) { _traceContext = traceContext; _interactionManager = InteractionsManager.GetInstance(session); _queueService = queueService; //We could use icelib to get the queue and interactions, but the AddIn API wraps things up to be a little simpler to use. _myInteractionsQueue = _queueService.GetMyInteractions(new[] { InteractionAttributes.State }); }
public void Load(Session session) { _interactionsManager = InteractionsManager.GetInstance(session); _peopleManager = PeopleManager.GetInstance(session); _queues = new Collection <InteractionQueue>(); _logging = Logging.GetInstance(); _lastReset = DateTime.Now; _agentsAvailable = -1; _isResetting = false; }
public void Intitialize(Fight fight, Type marktype) { var interactionDefinitions = InteractionsManager.GetEventsMethods(marktype); foreach (var data in interactionDefinitions) { fight.MarkInteractions.Add(new MarkInteraction(this, data.Value, data.Key)); } OnCasted(GetAffecteds(fight)); }
void Awake() { //Check if instance already exists if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(this); } }
public Player(NetPeer peer, PlayerAuth auth) { Id = peer.Id; Name = auth.Name; Ping = peer.Ping; //Should be invalid as game is (0;0) (10k;10k) Position = new Vector2(-12, -12); _peer = peer; _interactions = new InteractionsManager(this); }
public void Initialize(Session session, IInteractionSelector interactionSelector) { using (Trace.Main.scope()) { try { Trace.Main.always("Initializing VidyoPanelViewModel"); // Set things if (_session == null) { // Only do these things the first time around _session = session; _session.ConnectionStateChanged += SessionOnConnectionStateChanged; } _interactionSelector = interactionSelector; _customNotification = new CustomNotification(_session); MyInteractions = new InteractionQueue(InteractionsManager.GetInstance(_session), new QueueId(QueueType.User, _session.UserId)); // Watch queue MyInteractions.InteractionAdded += MyInteractionsOnInteractionAdded; MyInteractions.InteractionChanged += MyInteractionsOnInteractionChanged; MyInteractions.InteractionRemoved += MyInteractionsOnInteractionRemoved; MyInteractions.StartWatching(_watchedAttrs.ToArray()); // Watch for custom notifications _customNotification.CustomNotificationReceived += OnCustomNotificationReceived; WatchCustomNotifications(); // Get the Vidyo service client base URL SendCustomNotification(CustomMessageType.ApplicationRequest, VidyoServiceClientBaseUrlRequestOid, VidyoServiceClientBaseUrlRequestEid, _session.UserId.ToLower()); // Let everyone know we're ready IsInitialized = true; } catch (Exception ex) { Console.WriteLine(ex); Trace.Main.exception(ex, ex.Message); //MessageBox.Show( // "There was an error intializing the Vidyo addin. Please contact your system administrator.", // "Vidyo Addin - critical error"); throw; } } }
private void Start() { player = GameObject.Find("Player"); manager = player.GetComponent <InteractionsManager>(); playerController = player.GetComponent <PlayerController>(); spritesManager = GameObject.Find("ExtraSpritesManager").GetComponent <AdditionalSpritesManager>(); playerAnimator = player.transform.GetChild(0).GetComponent <Animator>(); montyStateManager = GameObject.Find("Monty").GetComponent <MontyStateManager>(); for (int i = 0; i < fish.Length; i++) { fish[i].timesCaught = 0; } }
private ChatInteraction GetChat(long interactionId) { using (Trace.Main.scope()) { try { return (InteractionsManager.GetInstance(_session).CreateInteraction(new InteractionId(interactionId)) as ChatInteraction); } catch (Exception ex) { Trace.Main.exception(ex); return(null); } } }
public void Unload() { try { foreach (var interactionQueue in _queues) { if (interactionQueue.IsWatching()) { interactionQueue.StopWatching(); } } _queues = null; } catch (Exception) { } _interactionsManager = null; }
private void Dial_Executed(object sender, ExecutedRoutedEventArgs executedRoutedEventArgs) { try { if (!CanDial) { return; } MainViewModel.Instance.LogMessage("Executing action: Dial (" + DialString + ")"); InteractionsManager.GetInstance(_session) .MakeCall(new CallInteractionParameters(DialString, CallMadeStage.None)); //DialString = ""; } catch (Exception ex) { MainViewModel.Instance.LogMessage(ex); } }
private void Conference_Executed(object sender, ExecutedRoutedEventArgs executedRoutedEventArgs) { try { if (!CanConference) { return; } var interactionsForConference = SelectedInteractions.ToArray(); //var interactionsForConference = Interactions.Where(i => !i.IsDisconnected).Select(i=>i.Interaction).ToArray(); MainViewModel.Instance.LogMessage("Making a conference with interactions: " + interactionsForConference.Select(i => i.InteractionId.Id.ToString()) .Aggregate((current, next) => current + ", " + next)); InteractionsManager.GetInstance(_session).MakeNewConference(interactionsForConference); } catch (Exception ex) { MainViewModel.Instance.LogMessage(ex); } }
public void MakeCall(string RemoteAddress) { InteractionsManager.GetInstance(Session).MakeCallAsync( new CallInteractionParameters(RemoteAddress, CallMadeStage.Allocated), MakeCallCompleted, null); }
public void Load(Session session) { _interactionsManager = InteractionsManager.GetInstance(session); _logging = Logging.GetInstance(); StartOrRefreshWatchingInteractions(); }
public QueueViewModel(Session session) { try { // Initialize objects //Interactions = new ObservableCollection<InteractionViewModel>(); // Set command bindings CommandBindings.Add(new CommandBinding(UiCommands.PickUpCommand, PickUp_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; })); CommandBindings.Add(new CommandBinding(UiCommands.DisconnectCommand, Disconnect_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; })); CommandBindings.Add(new CommandBinding(UiCommands.MuteCommand, Mute_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; })); CommandBindings.Add(new CommandBinding(UiCommands.HoldCommand, Hold_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; })); CommandBindings.Add(new CommandBinding(UiCommands.ConferenceCommand, Conference_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; })); CommandBindings.Add(new CommandBinding(UiCommands.DialCommand, Dial_Executed, (sender, e) => { e.CanExecute = true; e.Handled = true; })); // Set objects _session = session; _queue = new InteractionQueue(InteractionsManager.GetInstance(_session), new QueueId(QueueType.MyInteractions, _session.UserId)); _queue.QueueContentsChanged += QueueOnQueueContentsChanged; _queue.StartWatching(_queueAttributes); } catch (Exception ex) { MainViewModel.Instance.LogMessage(ex); } }
public ChatBotService() { using (Trace.Main.scope()) { try { var useWindowsAuth = false; // Parse some settings bool.TryParse(ConfigurationManager.AppSettings["CicUseWindowsAuth"], out useWindowsAuth); bool.TryParse(ConfigurationManager.AppSettings["EnableCommands"], out _enableCommands); // Connect IceLib if (useWindowsAuth) { _session.Connect(new SessionSettings(), new HostSettings(new HostEndpoint(ConfigurationManager.AppSettings["CicServer"])), new WindowsAuthSettings(), new StationlessSettings()); } else { _session.Connect(new SessionSettings(), new HostSettings(new HostEndpoint(ConfigurationManager.AppSettings["CicServer"])), new ICAuthSettings(ConfigurationManager.AppSettings["CicUser"], ConfigurationManager.AppSettings["CicPassword"]), new StationlessSettings()); } // Set up bot manager _botManager = new BotManager(new ServiceProviderDelegates { GetAttributeMethod = GetAttribute, GetAttributesMethod = GetAttributes, SetAttributeMethod = SetAttribute, SetAttributesMethod = SetAttributes, SendChatMessageMethod = SendChatMessage, ReassignChatMethod = ReassignChat }); _botManager.LoadBots(); // Watch queues var queueNames = ConfigurationManager.AppSettings["QueueList"].Split(new[] { '|' }); foreach (var queueName in queueNames) { try { Console.WriteLine("Watching queue " + queueName); var queue = new InteractionQueue(InteractionsManager.GetInstance(_session), new QueueId(QueueType.Workgroup, queueName)); queue.QueueContentsChanged += QueueOnQueueContentsChanged; queue.StartWatching(_queueAttributes); _queues.Add(queue); } catch (Exception ex) { Console.WriteLine(ex); Trace.Main.exception(ex); } } // Make sure we have some queues if (_queues.Count == 0) { throw new Exception("Not watching any queues after initialization!"); } } catch (Exception ex) { Console.WriteLine(ex); Trace.Main.exception(ex); throw; } } }