public void Add(RdlTag tag) { lock (_sendQueue) { _sendQueue.Enqueue(tag); } }
/// <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); } }
public void Add(RdlTag tag) { if (tag is RdlMessage) { this.MessageReceived(new NpcMessageReceivedEventArgs(tag as RdlMessage)); } }
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); }
/// <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); }
/// <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); } } }
/// <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); } } } }
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); }
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()); } }
public bool Read(out RdlTag tag) { tag = null; return(false); }
public void Add(RdlTag tag) { Console.WriteLine(tag.ToString()); }
/// <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); }
public void Add(RdlTag tag) { this.Message.Add(tag); this.SendData(); }
/// <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) { }