Beispiel #1
0
        /// <summary>
        /// Sequentialitemsprocessor triggers this tasked based
        /// </summary>
        /// <param name="parameter"></param>
        public void HandlePacket(MapPacket parameter)
        {
            //handle iterative operations

            //notify clients about changes
            OnBroadCast(parameter);
        }
Beispiel #2
0
        public void OnBroadCast(MapPacket mapPacket)
        {
            var handler = NotifyClients;

            if (handler != null)
            {
                handler(mapPacket, new EventArgs());
            }
        }
Beispiel #3
0
        /// <summary>
        /// Get notificated from outside the Session.
        /// </summary>
        /// <param name="sender">Sender of the packet.</param>
        /// <param name="e">Eventargs e.</param>
        private void GetNotification(object sender, EventArgs e)
        {
            MapPacket mapPacket = (MapPacket)sender;

            switch (mapPacket.Receiver)
            {
            case ReceiverType.All:
            {
                _client.SendPacket(mapPacket.Content);
                break;
            }

            case ReceiverType.AllExceptMe:
            {
                if (mapPacket.Session.Client.ClientId != this.Client.ClientId)
                {
                    _client.SendPacket(mapPacket.Content);
                }
                break;
            }

            case ReceiverType.OnlyMe:
            {
                if (mapPacket.Session.Client.ClientId == this.Client.ClientId)
                {
                    _client.SendPacket(mapPacket.Content);
                }
                break;
            }

            default:
            {
                Logger.Log.ErrorFormat("Unknown Notification ReceiverType for client, {0}", Client.ClientId);
                break;
            }
            }
        }
Beispiel #4
0
 public static void OnBroadCast(MapPacket mapPacket)
 {
     var handler = NotifyChildren;
     if (handler != null)
     {
         handler(mapPacket, new EventArgs());
     }
 }
Beispiel #5
0
 /// <summary>
 /// Send packet to all clients
 /// </summary>
 /// <param name="mapPacket">The MapPacket to send.</param>
 public void BroadCast(MapPacket mapPacket)
 {
     QueuePacket(mapPacket);
 }
Beispiel #6
0
 /// <summary>
 /// Enqueue a packet for the Map.
 /// </summary>
 /// <param name="mapPacket"></param>
 private void QueuePacket(MapPacket mapPacket)
 {
     threadedBase.Queue.EnqueueMessage(mapPacket);
 }
Beispiel #7
0
        /// <summary>
        /// Sequentialitemsprocessor triggers this tasked based
        /// </summary>
        /// <param name="parameter"></param>
        public void HandlePacket(MapPacket parameter)
        {
            //handle iterative operations

            //notify clients about changes
            OnBroadCast(parameter);
        }
Beispiel #8
0
 /// <summary>
 /// Send packet to all clients
 /// </summary>
 /// <param name="mapPacket">The MapPacket to send.</param>
 public void BroadCast(MapPacket mapPacket)
 {
     QueuePacket(mapPacket);
 }
Beispiel #9
0
 /// <summary>
 /// Enqueue a packet for the Map.
 /// </summary>
 /// <param name="mapPacket"></param>
 private void QueuePacket(MapPacket mapPacket)
 {
     threadedBase.Queue.EnqueueMessage(mapPacket);
 }