private void AvatarGroupsHandler(Packet packet, Simulator simulator) { if (OnAvatarGroups != null) { AvatarGroupsReplyPacket groups = (AvatarGroupsReplyPacket)packet; List <AvatarGroup> avatarGroups = new List <AvatarGroup>(groups.GroupData.Length); for (int i = 0; i < groups.GroupData.Length; i++) { AvatarGroup avatarGroup = new AvatarGroup(); avatarGroup.AcceptNotices = groups.GroupData[i].AcceptNotices; avatarGroup.GroupID = groups.GroupData[i].GroupID; avatarGroup.GroupInsigniaID = groups.GroupData[i].GroupInsigniaID; avatarGroup.GroupName = Utils.BytesToString(groups.GroupData[i].GroupName); avatarGroup.GroupPowers = (GroupPowers)groups.GroupData[i].GroupPowers; avatarGroup.GroupTitle = Utils.BytesToString(groups.GroupData[i].GroupTitle); avatarGroup.ListInProfile = groups.NewGroupData.ListInProfile; avatarGroups.Add(avatarGroup); } try { OnAvatarGroups(groups.AgentData.AvatarID, avatarGroups); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } }
public void ShowGroupProfile(AvatarGroup group) { ShowGroupProfile(new OpenMetaverse.Group() { ID = group.GroupID, InsigniaID = group.GroupInsigniaID, Name = group.GroupName } ); }
/// <summary> /// Crossed region handler for message that comes across the EventQueue. Sent to an agent /// when the agent crosses a sim border into a new region. /// </summary> /// <param name="capsKey">The message key</param> /// <param name="message">the IMessage object containing the deserialized data sent from the simulator</param> /// <param name="simulator">The <see cref="Simulator"/> which originated the packet</param> protected void AvatarGroupsReplyMessageHandler(string capsKey, IMessage message, Simulator simulator) { AgentGroupDataUpdateMessage msg = (AgentGroupDataUpdateMessage)message; List<AvatarGroup> avatarGroups = new List<AvatarGroup>(msg.GroupDataBlock.Length); for (int i = 0; i < msg.GroupDataBlock.Length; i++) { AvatarGroup avatarGroup = new AvatarGroup(); avatarGroup.AcceptNotices = msg.GroupDataBlock[i].AcceptNotices; avatarGroup.GroupID = msg.GroupDataBlock[i].GroupID; avatarGroup.GroupInsigniaID = msg.GroupDataBlock[i].GroupInsigniaID; avatarGroup.GroupName = msg.GroupDataBlock[i].GroupName; avatarGroup.GroupPowers = msg.GroupDataBlock[i].GroupPowers; avatarGroup.ListInProfile = msg.NewGroupDataBlock[i].ListInProfile; avatarGroups.Add(avatarGroup); } OnAvatarGroupsReply(new AvatarGroupsReplyEventArgs(msg.AgentID, avatarGroups)); }
/// <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 AvatarGroupsReplyHandler(object sender, PacketReceivedEventArgs e) { if (m_AvatarGroupsReply != null) { Packet packet = e.Packet; AvatarGroupsReplyPacket groups = (AvatarGroupsReplyPacket)packet; List<AvatarGroup> avatarGroups = new List<AvatarGroup>(groups.GroupData.Length); for (int i = 0; i < groups.GroupData.Length; i++) { AvatarGroup avatarGroup = new AvatarGroup(); avatarGroup.AcceptNotices = groups.GroupData[i].AcceptNotices; avatarGroup.GroupID = groups.GroupData[i].GroupID; avatarGroup.GroupInsigniaID = groups.GroupData[i].GroupInsigniaID; avatarGroup.GroupName = Utils.BytesToString(groups.GroupData[i].GroupName); avatarGroup.GroupPowers = (GroupPowers)groups.GroupData[i].GroupPowers; avatarGroup.GroupTitle = Utils.BytesToString(groups.GroupData[i].GroupTitle); avatarGroup.ListInProfile = groups.NewGroupData.ListInProfile; avatarGroups.Add(avatarGroup); } OnAvatarGroupsReply(new AvatarGroupsReplyEventArgs(groups.AgentData.AvatarID, avatarGroups)); } }
private void AvatarGroupsHandler(Packet packet, Simulator simulator) { if (OnAvatarGroups != null) { AvatarGroupsReplyPacket groups = (AvatarGroupsReplyPacket)packet; List<AvatarGroup> avatarGroups = new List<AvatarGroup>(groups.GroupData.Length); for (int i = 0; i < groups.GroupData.Length; i++) { AvatarGroup avatarGroup = new AvatarGroup(); avatarGroup.AcceptNotices = groups.GroupData[i].AcceptNotices; avatarGroup.GroupID = groups.GroupData[i].GroupID; avatarGroup.GroupInsigniaID = groups.GroupData[i].GroupInsigniaID; avatarGroup.GroupName = Utils.BytesToString(groups.GroupData[i].GroupName); avatarGroup.GroupPowers = (GroupPowers)groups.GroupData[i].GroupPowers; avatarGroup.GroupTitle = Utils.BytesToString(groups.GroupData[i].GroupTitle); avatarGroup.ListInProfile = groups.NewGroupData.ListInProfile; avatarGroups.Add(avatarGroup); } try { OnAvatarGroups(groups.AgentData.AvatarID, avatarGroups); } catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); } } }