Esempio n. 1
0
        /// <summary>
        /// Sends message to destination service.
        /// </summary>
        /// <param name="destinationService">Destination service.</param>
        /// <param name="value">Message to be sent.</param>
        public void SendMessage(JigsawGameService destinationService, string value)
        {
            JigsawGameService defunct = null;

            try
            {
                destinationService.SendMessage(value);
            }
            catch
            {
                if (defunct == null)
                {
                    defunct = destinationService;
                }
            }

            if (defunct != null)
            {
                JigsawGameService buddyInstance = defunct.Context.PlayerInstance;
                string            defunctName   = defunct.Context.LogOnName;

                this.thisLock.EnterWriteLock();
                try
                {
                    this.innerCache.Remove(defunct);
                }
                finally
                {
                    this.thisLock.ExitWriteLock();
                }

                this.RemovePlayerPair(defunctName, buddyInstance);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Sends the message to the destination service.
        /// </summary>
        /// <param name="destinationService">Destination Service.</param>
        /// <param name="value">Message to be sent.</param>
        /// <param name="defunctList">List of defucnt services.</param>
        public static void Send(JigsawGameService destinationService, string value, List<JigsawGameService> defunctList)
        {
            try
            {
                destinationService.SendMessage(value);
            }
            catch
            {
                if (null == defunctList)
                {
                    defunctList = new List<JigsawGameService>();
                }

                defunctList.Add(destinationService);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Sends the message to the destination service.
        /// </summary>
        /// <param name="destinationService">Destination Service.</param>
        /// <param name="value">Message to be sent.</param>
        /// <param name="defunctList">List of defucnt services.</param>
        public static void Send(JigsawGameService destinationService, string value, List <JigsawGameService> defunctList)
        {
            try
            {
                destinationService.SendMessage(value);
            }
            catch
            {
                if (null == defunctList)
                {
                    defunctList = new List <JigsawGameService>();
                }

                defunctList.Add(destinationService);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Sends message to destination service.
        /// </summary>
        /// <param name="destinationService">Destination service.</param>
        /// <param name="value">Message to be sent.</param>
        public void SendMessage(JigsawGameService destinationService, string value)
        {
            JigsawGameService defunct = null;
            try
            {
                destinationService.SendMessage(value);
            }
            catch
            {
                if (defunct == null)
                {
                    defunct = destinationService;
                }
            }

            if (defunct != null)
            {
                JigsawGameService buddyInstance = defunct.Context.PlayerInstance;
                string defunctName = defunct.Context.LogOnName;

                this.thisLock.EnterWriteLock();
                try
                {
                    this.innerCache.Remove(defunct);
                }
                finally
                {
                    this.thisLock.ExitWriteLock();
                }

                this.RemovePlayerPair(defunctName, buddyInstance);
            }
        }