/// <summary>Process an incoming packet and raise the appropriate events</summary> /// <param name="sender">The sender</param> /// <param name="e">The EventArgs object containing the packet data</param> protected void GroupTitlesReplyHandler(object sender, PacketReceivedEventArgs e) { if (m_GroupTitles != null) { Packet packet = e.Packet; GroupTitlesReplyPacket titles = (GroupTitlesReplyPacket)packet; Dictionary<UUID, GroupTitle> groupTitleCache = new Dictionary<UUID, GroupTitle>(); foreach (GroupTitlesReplyPacket.GroupDataBlock block in titles.GroupData) { GroupTitle groupTitle = new GroupTitle(); groupTitle.GroupID = titles.AgentData.GroupID; groupTitle.RoleID = block.RoleID; groupTitle.Title = Utils.BytesToString(block.Title); groupTitle.Selected = block.Selected; groupTitleCache[block.RoleID] = groupTitle; } OnGroupTitles(new GroupTitlesReplyEventArgs(titles.AgentData.RequestID, titles.AgentData.GroupID, groupTitleCache)); } }
private void GroupTitlesHandler(Packet packet, Simulator simulator) { if (OnGroupTitles != null) { GroupTitlesReplyPacket titles = (GroupTitlesReplyPacket)packet; Dictionary<UUID, GroupTitle> groupTitleCache = new Dictionary<UUID, GroupTitle>(); foreach (GroupTitlesReplyPacket.GroupDataBlock block in titles.GroupData) { GroupTitle groupTitle = new GroupTitle(); groupTitle.GroupID = titles.AgentData.GroupID; groupTitle.RoleID = block.RoleID; groupTitle.Title = Utils.BytesToString(block.Title); groupTitle.Selected = block.Selected; groupTitleCache[block.RoleID] = groupTitle; } try { OnGroupTitles(titles.AgentData.RequestID, titles.AgentData.GroupID, groupTitleCache); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } }