コード例 #1
0
 public void Add(RdlTag tag)
 {
     lock (_sendQueue)
     {
         _sendQueue.Enqueue(tag);
     }
 }
コード例 #2
0
 /// <summary>
 /// Adds a Tag instance to the context.
 /// </summary>
 /// <param name="tag">The Tag instance to add to the context.</param>
 public void Add(RdlTag tag)
 {
     lock (_receiveQueue)
     {
         _receiveQueue.Enqueue(tag);
     }
 }
コード例 #3
0
 public void Add(RdlTag tag)
 {
     if (tag is RdlMessage)
     {
         this.MessageReceived(new NpcMessageReceivedEventArgs(tag as RdlMessage));
     }
 }
コード例 #4
0
 public MapDetail(RdlTag tag)
 {
     this.Name   = tag.GetArg <string>(0);
     this.Width  = tag.GetArg <int>(1);
     this.Height = tag.GetArg <int>(2);
     this.StartX = tag.GetArg <int>(3);
     this.StartY = tag.GetArg <int>(4);
     this.EndX   = tag.GetArg <int>(5);
     this.EndY   = tag.GetArg <int>(6);
 }
コード例 #5
0
 /// <summary>
 /// Reads and removes the next tag in the queue and returns true if a tag was found.
 /// </summary>
 /// <param name="tag">The next available tag in the queue.</param>
 /// <returns>True if a tag exists; otherwise false.</returns>
 public bool Read(out RdlTag tag)
 {
     lock (_sendQueue)
     {
         if (_sendQueue.Count > 0)
         {
             tag = _sendQueue.Dequeue();
             return(true);
         }
     }
     tag = null;
     return(false);
 }
コード例 #6
0
ファイル: Place.cs プロジェクト: lionsguard/perenthia
        /// <summary>
        /// Sends the specified message to all avatars in the current place.
        /// </summary>
        /// <param name="tag">The RdlTag to send to all avatars in the place.</param>
        /// <param name="sender">The avatar sending the message.</param>
        public void SendAll(RdlTag tag, IAvatar sender)
        {
            var avatars = (from c in this.Children where c is Avatar select c as Avatar);

            RdlObject[] senderRdl = sender.ToSimpleRdl();
            foreach (var avatar in avatars)
            {
                if (avatar.ID != sender.ID)
                {
                    avatar.Context.Add(tag);
                }
            }
        }
コード例 #7
0
ファイル: Server.cs プロジェクト: lionsguard/perenthia
 /// <summary>
 /// Sends the specified Message to all connected clients.
 /// </summary>
 /// <param name="tag">The Tag to send to all connected clients.</param>
 public void SendAll(RdlTag tag, IAvatar sender)
 {
     RdlObject[] senderRdl = sender.ToSimpleRdl();
     for (int i = this.Clients.Count - 1; i >= 0; i--)
     {
         var client = this.Clients[i];
         if (client.Player != null)
         {
             if (sender != null && sender.ID == client.Player.ID)
             {
                 client.Context.Add(tag);
             }
         }
     }
 }
コード例 #8
0
ファイル: Depot.cs プロジェクト: lionsguard/perenthia
        public static RdlTagCollection GetMapNames()
        {
            RdlTagCollection tags = new RdlTagCollection();

            foreach (var detail in Game.Server.World.Map.MapDetails.Values)
            {
                RdlTag tag = new RdlTag("MAP", "MAP");
                tag.Args.Add(detail.Name);
                tag.Args.Add(detail.Width);
                tag.Args.Add(detail.Height);
                tag.Args.Add(detail.Key.StartX);
                tag.Args.Add(detail.Key.StartY);
                tag.Args.Add(detail.Key.EndX);
                tag.Args.Add(detail.Key.EndY);
                tags.Add(tag);
            }
            return(tags);
        }
コード例 #9
0
        private void border_BorderResized(object sender, EventArgs e)
        {
            MapBorder border = sender as MapBorder;
            Rect      bounds = border.Bounds;
            var       map    = Game.Maps.Where(m => (bounds.X >= m.StartX && bounds.X <= m.EndX) && (bounds.Y >= m.StartY && bounds.Y <= m.EndY)).FirstOrDefault();

            if (map != null)
            {
                RdlTag tag = new RdlTag("MAP", "MAP");
                tag.Args.Add(map.Name);
                tag.Args.Add(map.Width);
                tag.Args.Add(map.Height);
                tag.Args.Add(map.StartX);
                tag.Args.Add(map.StartY);
                tag.Args.Add(map.EndX);
                tag.Args.Add(map.EndY);

                // TODO: Save Map
                //BuilderServiceClient client = ServiceManager.CreateBuilderServiceClient();
                //client.SaveMapCompleted += new EventHandler<SaveMapCompletedEventArgs>(client_SaveMapCompleted);
                //client.SaveMapAsync(_token, tag.ToString());
            }
        }
コード例 #10
0
 public bool Read(out RdlTag tag)
 {
     tag = null;
     return(false);
 }
コード例 #11
0
 public void Add(RdlTag tag)
 {
     Console.WriteLine(tag.ToString());
 }
コード例 #12
0
ファイル: Player.cs プロジェクト: lionsguard/perenthia
 /// <summary>
 /// Adds an output tag specific to the current avatar. In the case of a player instance the tag might
 /// contain the results of an action, combat, chat, etc.
 /// </summary>
 /// <param name="tag">The Tag instance to add.</param>
 public override void AddTag(RdlTag tag)
 {
     this.Client.Context.Add(tag);
 }
コード例 #13
0
 public void Add(RdlTag tag)
 {
     this.Message.Add(tag);
     this.SendData();
 }
コード例 #14
0
ファイル: Avatar.cs プロジェクト: lionsguard/perenthia
 /// <summary>
 /// Adds an output tag specific to the current avatar. In the case of a player instance the tag might
 /// contain the results of an action, combat, chat, etc.
 /// </summary>
 /// <param name="tag">The Tag instance to add.</param>
 public virtual void AddTag(RdlTag tag)
 {
 }