Пример #1
0
        public frmGroupInfo(Group group, GridClient client)
        {
            InitializeComponent();

            while (!IsHandleCreated)
            {
                // Force handle creation
                IntPtr temp = Handle;
            }

            GroupProfileCallback = new GroupManager.GroupProfileCallback(GroupProfileHandler);
            GroupMembersCallback = new GroupManager.GroupMembersCallback(GroupMembersHandler);
            GroupTitlesCallback = new GroupManager.GroupTitlesCallback(GroupTitlesHandler);
            AvatarNamesCallback = new AvatarManager.AvatarNamesCallback(AvatarNamesHandler);
            ImageReceivedCallback = new AssetManager.ImageReceivedCallback(Assets_OnImageReceived);

            Group = group;
            Client = client;
            
            // Register the callbacks for this form
            Client.Assets.OnImageReceived += ImageReceivedCallback;
            Client.Groups.OnGroupProfile += GroupProfileCallback;
            Client.Groups.OnGroupMembers += GroupMembersCallback;
            Client.Groups.OnGroupTitles += GroupTitlesCallback;
            Client.Avatars.OnAvatarNames += AvatarNamesCallback;

            // Request the group information
            Client.Groups.RequestGroupProfile(Group.ID);
            Client.Groups.RequestGroupMembers(Group.ID);
            Client.Groups.RequestGroupTitles(Group.ID);
        }
Пример #2
0
        public frmGroupInfo(Group group, GridClient client)
        {
            InitializeComponent();

            while (!IsHandleCreated)
            {
                // Force handle creation
                // warning CS0219: The variable `temp' is assigned but its value is never used
                IntPtr temp = Handle;
            }

            GroupProfileCallback = new GroupManager.GroupProfileCallback(GroupProfileHandler);
            GroupMembersCallback = new GroupManager.GroupMembersCallback(GroupMembersHandler);
            GroupTitlesCallback = new GroupManager.GroupTitlesCallback(GroupTitlesHandler);
            AvatarNamesCallback = new AvatarManager.AvatarNamesCallback(AvatarNamesHandler);

            Group = group;
            Client = client;
            
            // Register the callbacks for this form
            Client.Groups.OnGroupProfile += GroupProfileCallback;
            Client.Groups.OnGroupMembers += GroupMembersCallback;
            Client.Groups.OnGroupTitles += GroupTitlesCallback;
            Client.Avatars.OnAvatarNames += AvatarNamesCallback;

            // Request the group information
            Client.Groups.RequestGroupProfile(Group.ID);
            Client.Groups.RequestGroupMembers(Group.ID);
            Client.Groups.RequestGroupTitles(Group.ID);
        }
Пример #3
0
        public GroupInvite(RadegastInstance instance, Group group, Dictionary<UUID, GroupRole> roles)
            : base(instance)
        {
            InitializeComponent();
            Disposed += new EventHandler(GroupInvite_Disposed);
            AutoSavePosition = true;

            this.instance = instance;
            this.roles = roles;
            this.group = group;
            this.netcom = instance.Netcom;

            picker = new AvatarPicker(instance) { Dock = DockStyle.Fill };
            Controls.Add(picker);
            picker.SelectionChaged += new EventHandler(picker_SelectionChaged);
            picker.BringToFront();

            netcom.ClientDisconnected += new EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected);

            cmbRoles.Items.Add(roles[UUID.Zero]);
            cmbRoles.SelectedIndex = 0;

            foreach (KeyValuePair<UUID, GroupRole> role in roles)
                if (role.Key != UUID.Zero)
                    cmbRoles.Items.Add(role.Value);
        }
Пример #4
0
        private void GroupProfileHandler(Group profile)
        {
            Profile = profile;

            if (Group.InsigniaID != UUID.Zero)
                Client.Assets.RequestImage(Group.InsigniaID, ImageType.Normal,
                    delegate(TextureRequestState state, AssetTexture assetTexture)
                        {
                            ManagedImage imgData;
                            Image bitmap;

                            if (state != TextureRequestState.Timeout || state != TextureRequestState.NotFound)
                            {
                                OpenJPEG.DecodeToImage(assetTexture.AssetData, out imgData, out bitmap);
                                picInsignia.Image = bitmap;
                                UpdateInsigniaProgressText("Progress...");
                            }
                            if (state == TextureRequestState.Finished)
                            {
                                UpdateInsigniaProgressText("");
                            }
                        }, true);

            if (this.InvokeRequired)
                this.BeginInvoke(new MethodInvoker(UpdateProfile));
        }
 public GroupChannel(GridClient client, IIdentityMapper mapper, Group group)
 {
     slName = group.Name;
     ircName = mapper.MapGroup(group);
     topic = slName;
     this.mapper = mapper;
     this.client = client;
     this.group = group;
 }
Пример #6
0
        private void GroupProfileHandler(Group profile)
        {
            Profile = profile;

            if (Group.InsigniaID != UUID.Zero)
                Client.Assets.RequestImage(Group.InsigniaID, ImageType.Normal, 113000.0f, 0, 0);

            if (this.InvokeRequired)
                this.BeginInvoke(new MethodInvoker(UpdateProfile));
        }
Пример #7
0
        internal GroupIMSession(PluginControl pc, UUID session)
            : base(pc, session)
        {
            AgentID = session;
            group = control.instance.Groups[session];
            Title = group.Name;
            shortGroupName = Title.Split(' ')[0];

            Talker.Say("New group I.M. from " + Title, Talk.BeepType.Comm);
        }
Пример #8
0
        public IMTabWindowGroup(METAboltInstance instance, UUID session, UUID target, string toName, OpenMetaverse.Group grp)
        {
            InitializeComponent();

            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            label1.Text    = "Starting session with " + grp.Name + " please wait...";
            label1.Visible = true;

            this.instance = instance;
            netcom        = this.instance.Netcom;
            client        = this.instance.Client;

            afffile = this.instance.AffFile = instance.Config.CurrentConfig.SpellLanguage + ".aff";        // "en_GB.aff";
            dicfile = this.instance.DictionaryFile = instance.Config.CurrentConfig.SpellLanguage + ".dic"; // "en_GB.dic";

            this.target  = target;
            this.session = session;
            //this.session = client.Self..AgentID ^ grp.ID;
            this.toName  = toName;
            this.imgroup = grp;
            tab          = instance.TabConsole;

            WaitForSessionStart.Reset();

            textManager    = new IMTextManager(this.instance, new RichTextBoxPrinter(instance, rtbIMText), this.session, toName, grp);
            this.Disposed += new EventHandler(IMTabWindow_Disposed);

            AddNetcomEvents();

            ApplyConfig(this.instance.Config.CurrentConfig);
            this.instance.Config.ConfigApplied += new EventHandler <ConfigAppliedEventArgs>(Config_ConfigApplied);

            //people = new SafeDictionary<UUID, string>();

            client.Self.GroupChatJoined        += new EventHandler <GroupChatJoinedEventArgs>(Self_OnGroupChatJoin);
            client.Self.ChatSessionMemberAdded += new EventHandler <ChatSessionMemberAddedEventArgs>(Self_OnChatSessionMemberAdded);
            client.Self.ChatSessionMemberLeft  += new EventHandler <ChatSessionMemberLeftEventArgs>(Self_OnChatSessionMemberLeft);
            client.Avatars.UUIDNameReply       += new EventHandler <UUIDNameReplyEventArgs>(Avatars_OnAvatarNames);

            client.Self.RequestJoinGroupChat(session);
            CreateSmileys();

            if (this.instance.IMHistyoryExists(this.toName, true))
            {
                toolStripButton2.Enabled = true;
            }
        }
Пример #9
0
        public void UpdateDisplay()
        {
            lock (DisplaySyncRoot)
            {

                Group none = new Group();
                none.Name = "(none)";
                none.ID = UUID.Zero;

                listBox1.Items.Clear();
                listBox1.Items.Add(none);

                foreach (Group g in instance.Groups.Values)
                {
                    listBox1.Items.Add(g);
                }

                foreach (Group g in listBox1.Items)
                {
                    if (g.ID == client.Self.ActiveGroup)
                    {
                        listBox1.SelectedItem = g;
                        break;
                    }
                }

                lblGroupNr.Text = string.Format("{0} groups", instance.Groups.Count);
                if (client.Network.MaxAgentGroups > 0)
                {
                    lblGrpMax.Text = string.Format("max {0} groups", client.Network.MaxAgentGroups);
                }
                else
                {
                    lblGrpMax.Text = string.Empty;
                }

                if (newGrpID != UUID.Zero)
                {
                    lblCreateStatus.Text = "Group created successfully";
                    btnCancel.PerformClick();
                    instance.MainForm.ShowGroupProfile(instance.Groups[newGrpID]);
                }
            }
            newGrpID = UUID.Zero;
        }
Пример #10
0
        public frmGroupInfo(RadegastInstance instance, Group group)
            : base(instance)
        {
            InitializeComponent();
            Disposed += new System.EventHandler(frmGroupInfo_Disposed);
            AutoSavePosition = true;

            this.instance = instance;
            this.Group = group;

            GroupDetails = new GroupDetails(instance, group);
            GroupDetails.Dock = DockStyle.Fill;
            ClientSize = new Size(GroupDetails.Width, GroupDetails.Height);
            MinimumSize = Size;
            Controls.Add(GroupDetails);
            Text = group.Name + " - Group information";
            instance.Netcom.ClientDisconnected += new System.EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected);
        }
Пример #11
0
        public BanGroupMember(RadegastInstance instance, Group group, GroupDetails parent)
            : base(instance)
        {
            InitializeComponent();
            Disposed += new EventHandler(GroupInvite_Disposed);
            AutoSavePosition = true;

            this.instance = instance;
            this.group = group;
            this.netcom = instance.Netcom;
            this.parent = parent;

            picker = new AvatarPicker(instance) { Dock = DockStyle.Fill };
            Controls.Add(picker);
            picker.SelectionChaged += new EventHandler(picker_SelectionChaged);
            picker.BringToFront();

            netcom.ClientDisconnected += new EventHandler<DisconnectedEventArgs>(Netcom_ClientDisconnected);
        }
Пример #12
0
        public override CmdResult ExecuteRequest(CmdRequest args)
        {
            if (args.Length < 1)
                return ShowUsage();

            GroupName = String.Empty;
            for (int i = 0; i < args.Length; i++)
                GroupName += args[i] + " ";
            GroupName = GroupName.Trim();

            GroupUUID = Client.GroupName2UUID(GroupName);
            if (UUID.Zero != GroupUUID)
            {
                TheBotClient.InvokeGUI(() =>
                {
                    Group group = new Group { ID = GroupUUID };
                    TheBotClient.TheRadegastInstance.MainForm.ShowGroupProfile(group);
                });

                return Failure("Shown group " + GroupName + " " + GroupUUID);
            }
            return Failure("Cannot find group " + GroupName);
        }
Пример #13
0
        /// <summary>Update a group's profile and other information</summary>
        /// <param name="id">Groups ID (UUID) to update.</param>
        /// <param name="group">Group struct to update.</param>
        public void UpdateGroup(UUID id, Group group)
        {
            OpenMetaverse.Packets.UpdateGroupInfoPacket cgrp = new UpdateGroupInfoPacket();
            cgrp.AgentData = new UpdateGroupInfoPacket.AgentDataBlock();
            cgrp.AgentData.AgentID = Client.Self.AgentID;
            cgrp.AgentData.SessionID = Client.Self.SessionID;

            cgrp.GroupData = new UpdateGroupInfoPacket.GroupDataBlock();
            cgrp.GroupData.GroupID = id;
            cgrp.GroupData.AllowPublish = group.AllowPublish;
            cgrp.GroupData.Charter = Utils.StringToBytes(group.Charter);
            cgrp.GroupData.InsigniaID = group.InsigniaID;
            cgrp.GroupData.MaturePublish = group.MaturePublish;
            cgrp.GroupData.MembershipFee = group.MembershipFee;
            cgrp.GroupData.OpenEnrollment = group.OpenEnrollment;
            cgrp.GroupData.ShowInList = group.ShowInList;

            Client.Network.SendPacket(cgrp);
        }
Пример #14
0
        /// <summary>
        /// Request to create a new group. If the group is successfully
        /// created, L$100 will automatically be deducted
        /// </summary>
        /// <remarks>Subscribe to <code>OnGroupCreated</code> event to receive confirmation.</remarks>
        /// <param name="group">Group struct containing the new group info</param>
        public void RequestCreateGroup(Group group)
        {
            OpenMetaverse.Packets.CreateGroupRequestPacket cgrp = new CreateGroupRequestPacket();
            cgrp.AgentData = new CreateGroupRequestPacket.AgentDataBlock();
            cgrp.AgentData.AgentID = Client.Self.AgentID;
            cgrp.AgentData.SessionID = Client.Self.SessionID;

            cgrp.GroupData = new CreateGroupRequestPacket.GroupDataBlock();
            cgrp.GroupData.AllowPublish = group.AllowPublish;
            cgrp.GroupData.Charter = Utils.StringToBytes(group.Charter);
            cgrp.GroupData.InsigniaID = group.InsigniaID;
            cgrp.GroupData.MaturePublish = group.MaturePublish;
            cgrp.GroupData.MembershipFee = group.MembershipFee;
            cgrp.GroupData.Name = Utils.StringToBytes(group.Name);
            cgrp.GroupData.OpenEnrollment = group.OpenEnrollment;
            cgrp.GroupData.ShowInList = group.ShowInList;

            Client.Network.SendPacket(cgrp);
        }
Пример #15
0
 private void groupList1_OnGroupDoubleClick(Group group)
 {
     MessageBox.Show(group.Name + " = " + group.ID);
 }
Пример #16
0
        private void GroupProfileHandler(Packet packet, Simulator simulator)
        {
            if (OnGroupProfile != null)
            {
                GroupProfileReplyPacket profile = (GroupProfileReplyPacket)packet;
                Group group = new Group();

                group.ID = profile.GroupData.GroupID;
                group.AllowPublish = profile.GroupData.AllowPublish;
                group.Charter = Utils.BytesToString(profile.GroupData.Charter);
                group.FounderID = profile.GroupData.FounderID;
                group.GroupMembershipCount = profile.GroupData.GroupMembershipCount;
                group.GroupRolesCount = profile.GroupData.GroupRolesCount;
                group.InsigniaID = profile.GroupData.InsigniaID;
                group.MaturePublish = profile.GroupData.MaturePublish;
                group.MembershipFee = profile.GroupData.MembershipFee;
                group.MemberTitle = Utils.BytesToString(profile.GroupData.MemberTitle);
                group.Money = profile.GroupData.Money;
                group.Name = Utils.BytesToString(profile.GroupData.Name);
                group.OpenEnrollment = profile.GroupData.OpenEnrollment;
                group.OwnerRole = profile.GroupData.OwnerRole;
                group.Powers = (GroupPowers)profile.GroupData.PowersMask;
                group.ShowInList = profile.GroupData.ShowInList;

                try { OnGroupProfile(group); }
                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
            }
        }
Пример #17
0
        private void AgentGroupDataUpdateHandler(string capsKey, IMessage message, Simulator simulator)
        {
            if (OnCurrentGroups != null)
            {
                AgentGroupDataUpdateMessage msg = (AgentGroupDataUpdateMessage)message;

                Dictionary<UUID, Group> currentGroups = new Dictionary<UUID, Group>();
                for (int i = 0; i < msg.GroupDataBlock.Length; i++)
                {
                    Group group = new Group();
                    group.ID = msg.GroupDataBlock[i].GroupID;
                    group.InsigniaID = msg.GroupDataBlock[i].GroupInsigniaID;
                    group.Name = msg.GroupDataBlock[i].GroupName;
                    group.Contribution = msg.GroupDataBlock[i].Contribution;
                    group.AcceptNotices = msg.GroupDataBlock[i].AcceptNotices;
                    group.Powers = msg.GroupDataBlock[i].GroupPowers;
                    group.ListInProfile = msg.NewGroupDataBlock[i].ListInProfile;

                    currentGroups.Add(group.ID, group);

                    lock (GroupName2KeyCache.Dictionary)
                    {
                        if (!GroupName2KeyCache.Dictionary.ContainsKey(group.ID))
                            GroupName2KeyCache.Dictionary.Add(group.ID, group.Name);
                    }
                }

                try { OnCurrentGroups(currentGroups); }
                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
            }
        }
Пример #18
0
        private void button2_Click(object sender, EventArgs e)
        {
            Group newgroup = new Group();
            newgroup.Name = textBox1.Text;
            newgroup.Charter = textBox2.Text;
            newgroup.FounderID = Client.Self.AgentID;
            Client.Groups.RequestCreateGroup(newgroup);

            EnableNew();
        }
 public Task<string> MapGroup(Group group)
 {
     lock (groupCacheLock)
     {
         string ircname;
         if (GroupIrcNameByUuid.TryGetValue(group.ID, out ircname))
         {
             return Task.FromResult(GroupIrcNameByUuid[group.ID]);
         }
         ircname = "#" + MakeIrcName(group.Name);
         this.GroupIrcNameByUuid[group.ID] = ircname;
         this.GroupIdByIrcName[ircname] = group.ID;
         return Task.FromResult(ircname);
     }
 }
Пример #20
0
        void Groups_GroupProfile(object sender, GroupProfileEventArgs e)
        {
            if (groupID != e.Group.ID) return;

            if (instance.MainForm.InvokeRequired)
            {
                instance.MainForm.BeginInvoke(new MethodInvoker(() => Groups_GroupProfile(sender, e)));
                return;
            }

            group = e.Group;
            ShowNotice();
        }
Пример #21
0
        public IMTabWindowGroup(METAboltInstance instance, UUID session, UUID target, string toName, OpenMetaverse.Group grp)
        {
            InitializeComponent();

            SetExceptionReporter();
            Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException;

            label1.Text = "Starting session with " + grp.Name + " please wait...";
            label1.Visible = true;

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;

            afffile = this.instance.AffFile = instance.Config.CurrentConfig.SpellLanguage + ".aff";   // "en_GB.aff";
            dicfile = this.instance.DictionaryFile = instance.Config.CurrentConfig.SpellLanguage + ".dic";   // "en_GB.dic";

            this.target = target;
            this.session = session;
            //this.session = client.Self..AgentID ^ grp.ID;
            this.toName = toName;
            this.imgroup = grp;
            tab = instance.TabConsole;

            WaitForSessionStart.Reset();

            textManager = new IMTextManager(this.instance, new RichTextBoxPrinter(instance, rtbIMText), this.session, toName, grp);
            this.Disposed += new EventHandler(IMTabWindow_Disposed);

            AddNetcomEvents();

            ApplyConfig(this.instance.Config.CurrentConfig);
            this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied);

            //people = new SafeDictionary<UUID, string>();

            client.Self.GroupChatJoined += new EventHandler<GroupChatJoinedEventArgs>(Self_OnGroupChatJoin);
            client.Self.ChatSessionMemberAdded += new EventHandler<ChatSessionMemberAddedEventArgs>(Self_OnChatSessionMemberAdded);
            client.Self.ChatSessionMemberLeft += new EventHandler<ChatSessionMemberLeftEventArgs>(Self_OnChatSessionMemberLeft);
            client.Avatars.UUIDNameReply += new EventHandler<UUIDNameReplyEventArgs>(Avatars_OnAvatarNames);

            client.Self.RequestJoinGroupChat(session);
            CreateSmileys();

            if (this.instance.IMHistyoryExists(this.toName, true))
            {
                toolStripButton2.Enabled = true;
            }
        }
Пример #22
0
        public ntfGroupNotice(RadegastInstance instance, InstantMessage msg)
            : base(NotificationType.GroupNotice)
        {
            InitializeComponent();
            Disposed += new System.EventHandler(ntfGroupNotice_Disposed);

            this.instance = instance;
            this.msg = msg;
            client.Groups.GroupProfile += new System.EventHandler<GroupProfileEventArgs>(Groups_GroupProfile);

            if (msg.BinaryBucket.Length > 18 && msg.BinaryBucket[0] != 0)
            {
                type = (AssetType)msg.BinaryBucket[1];
                destinationFolderID = client.Inventory.FindFolderForType(type);
                int icoIndx = InventoryConsole.GetItemImageIndex(type.ToString().ToLower());
                if (icoIndx >= 0)
                {
                    icnItem.Image = frmMain.ResourceImages.Images[icoIndx];
                    icnItem.Visible = true;
                }
                txtItemName.Text = Utils.BytesToString(msg.BinaryBucket, 18, msg.BinaryBucket.Length - 19);
                btnSave.Enabled = true;
                btnSave.Visible = icnItem.Visible = txtItemName.Visible = true;
            }

            if (msg.BinaryBucket.Length >= 18)
            {
                groupID = new UUID(msg.BinaryBucket, 2);
            }
            else
            {
                groupID = msg.FromAgentID;
            }

            int pos = msg.Message.IndexOf('|');
            string title = msg.Message.Substring(0, pos);
            lblTitle.Text = title;
            string text = msg.Message.Replace("\n", System.Environment.NewLine);
            text = text.Remove(0, pos + 1);

            lblSentBy.Text = string.Format("Sent by {0}", msg.FromAgentName);
            txtNotice.Text = text;

            if (instance.Groups.ContainsKey(groupID))
            {
                group = instance.Groups[groupID];
                ShowNotice();
            }
            else
            {
                client.Groups.RequestGroupProfile(groupID);
            }
        }
Пример #23
0
 /// <summary>Construct a new instance of the GroupProfileEventArgs class</summary>
 /// <param name="group">The group profile</param>
 public GroupProfileEventArgs(Group group)
 {
     this.m_Group = group;
 }
Пример #24
0
        protected void AgentGroupDataUpdateMessageHandler(string capsKey, IMessage message, Simulator simulator)
        {
            if (m_CurrentGroups != null)
            {
                AgentGroupDataUpdateMessage msg = (AgentGroupDataUpdateMessage)message;

                Dictionary<UUID, Group> currentGroups = new Dictionary<UUID, Group>();
                for (int i = 0; i < msg.GroupDataBlock.Length; i++)
                {
                    Group group = new Group();
                    group.ID = msg.GroupDataBlock[i].GroupID;
                    group.InsigniaID = msg.GroupDataBlock[i].GroupInsigniaID;
                    group.Name = msg.GroupDataBlock[i].GroupName;
                    group.Contribution = msg.GroupDataBlock[i].Contribution;
                    group.AcceptNotices = msg.GroupDataBlock[i].AcceptNotices;
                    group.Powers = msg.GroupDataBlock[i].GroupPowers;
                    group.ListInProfile = msg.NewGroupDataBlock[i].ListInProfile;

                    currentGroups.Add(group.ID, group);

                    lock (GroupName2KeyCache.Dictionary)
                    {
                        if (!GroupName2KeyCache.Dictionary.ContainsKey(group.ID))
                            GroupName2KeyCache.Dictionary.Add(group.ID, group.Name);
                    }
                }
                OnCurrentGroups(new CurrentGroupsEventArgs(currentGroups));
            }
        }
 public string MapGroup(Group group)
 {
     if(GroupToIrcCache.ContainsKey(group.ID))
     {
         return GroupToIrcCache[group.ID];
     }
     var ircname = "#" + MakeIrcName(group.Name);
     this.GroupToIrcCache[group.ID] = ircname;
     this.IrcToGroupCache[ircname] = group.ID;
     return ircname;
 }
Пример #26
0
        /// <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 GroupProfileReplyHandler(object sender, PacketReceivedEventArgs e)
        {
            if (m_GroupProfile != null)
            {
                Packet packet = e.Packet;
                GroupProfileReplyPacket profile = (GroupProfileReplyPacket)packet;
                Group group = new Group();

                group.ID = profile.GroupData.GroupID;
                group.AllowPublish = profile.GroupData.AllowPublish;
                group.Charter = Utils.BytesToString(profile.GroupData.Charter);
                group.FounderID = profile.GroupData.FounderID;
                group.GroupMembershipCount = profile.GroupData.GroupMembershipCount;
                group.GroupRolesCount = profile.GroupData.GroupRolesCount;
                group.InsigniaID = profile.GroupData.InsigniaID;
                group.MaturePublish = profile.GroupData.MaturePublish;
                group.MembershipFee = profile.GroupData.MembershipFee;
                group.MemberTitle = Utils.BytesToString(profile.GroupData.MemberTitle);
                group.Money = profile.GroupData.Money;
                group.Name = Utils.BytesToString(profile.GroupData.Name);
                group.OpenEnrollment = profile.GroupData.OpenEnrollment;
                group.OwnerRole = profile.GroupData.OwnerRole;
                group.Powers = (GroupPowers)profile.GroupData.PowersMask;
                group.ShowInList = profile.GroupData.ShowInList;

                OnGroupProfile(new GroupProfileEventArgs(group));
            }
        }
Пример #27
0
        private void GroupDataHandler(Packet packet, Simulator simulator)
        {
            if (OnCurrentGroups != null)
            {
                AgentGroupDataUpdatePacket update = (AgentGroupDataUpdatePacket)packet;

                Dictionary<UUID, Group> currentGroups = new Dictionary<UUID, Group>();

                foreach (AgentGroupDataUpdatePacket.GroupDataBlock block in update.GroupData)
                {
                    Group group = new Group();

                    group.ID = block.GroupID;
                    group.InsigniaID = block.GroupInsigniaID;
                    group.Name = Utils.BytesToString(block.GroupName);
                    group.Powers = (GroupPowers)block.GroupPowers;
                    group.Contribution = block.Contribution;
                    group.AcceptNotices = block.AcceptNotices;

                    currentGroups[block.GroupID] = group;

                    if (!GroupName2KeyCache.ContainsKey(block.GroupID))
                        GroupName2KeyCache.SafeAdd(block.GroupID, Utils.BytesToString(block.GroupName));
                }

                try { OnCurrentGroups(currentGroups); }
                catch (Exception e) { Logger.Log(e.Message, Helpers.LogLevel.Error, Client, e); }
            }
        }
Пример #28
0
 private void btnCreateGroup_Click(object sender, EventArgs e)
 {
     Group g = new Group();
     g.Name = txtNewGroupName.Text;
     g.Charter = txtNewGroupCharter.Text;
     g.FounderID = client.Self.AgentID;
     lblCreateStatus.Text = "Creating group...";
     client.Groups.RequestCreateGroup(g);
 }
Пример #29
0
        public GroupDetails(RadegastInstance instance, Group group)
        {
            InitializeComponent();
            Disposed += new EventHandler(GroupDetails_Disposed);

            this.instance = instance;
            this.group = group;

            if (group.InsigniaID != UUID.Zero)
            {
                SLImageHandler insignia = new SLImageHandler(instance, group.InsigniaID, string.Empty);
                insignia.Dock = DockStyle.Fill;
                pnlInsignia.Controls.Add(insignia);
            }

            lblGroupName.Text = group.Name;
            lvwGeneralMembers.ListViewItemSorter = new GroupMemberSorter();
            lvwMemberDetails.ListViewItemSorter = new GroupMemberSorter();

            isMember = instance.Groups.ContainsKey(group.ID);

            if (isMember)
            {
            }
            else
            {
                tcGroupDetails.TabPages.Remove(tpMembersRoles);
                tcGroupDetails.TabPages.Remove(tpNotices);
            }

            lvwNoticeArchive.SmallImageList = frmMain.ResourceImages;
            lvwNoticeArchive.ListViewItemSorter = new GroupNoticeSorter();

            // Callbacks
            client.Groups.GroupTitlesReply += new EventHandler<GroupTitlesReplyEventArgs>(Groups_GroupTitlesReply);
            client.Groups.GroupMembersReply += new EventHandler<GroupMembersReplyEventArgs>(Groups_GroupMembersReply);
            client.Groups.GroupProfile += new EventHandler<GroupProfileEventArgs>(Groups_GroupProfile);
            client.Groups.CurrentGroups += new EventHandler<CurrentGroupsEventArgs>(Groups_CurrentGroups);
            client.Groups.GroupNoticesListReply += new EventHandler<GroupNoticesListReplyEventArgs>(Groups_GroupNoticesListReply);
            client.Groups.GroupJoinedReply += new EventHandler<GroupOperationEventArgs>(Groups_GroupJoinedReply);
            client.Groups.GroupLeaveReply += new EventHandler<GroupOperationEventArgs>(Groups_GroupLeaveReply);
            client.Groups.GroupRoleDataReply += new EventHandler<GroupRolesDataReplyEventArgs>(Groups_GroupRoleDataReply);
            client.Groups.GroupMemberEjected += new EventHandler<GroupOperationEventArgs>(Groups_GroupMemberEjected);
            client.Groups.GroupRoleMembersReply += new EventHandler<GroupRolesMembersReplyEventArgs>(Groups_GroupRoleMembersReply);
            client.Self.IM += new EventHandler<InstantMessageEventArgs>(Self_IM);
            instance.Names.NameUpdated += new EventHandler<UUIDNameReplyEventArgs>(Names_NameUpdated);
            RefreshControlsAvailability();
            RefreshGroupInfo();
        }
Пример #30
0
        public IMTabWindowGroup AddIMTabGroup(UUID target, UUID session, string targetName, Group grp)
        {
            IMTabWindowGroup imTab = new IMTabWindowGroup(instance, session, target, targetName, grp);
            imTab.Dock = DockStyle.Fill;
            toolStripContainer1.ContentPanel.Controls.Add(imTab);

            string tname = targetName;

            if (tname.Length > 9)
            {
                tname = tname.Substring(0, 7) + "...";
            }

            //METAboltTab tab =
            AddTab(targetName, "GIM: " + targetName, imTab);
            imTab.SelectIMInput();

            return imTab;
        }
Пример #31
0
        void Groups_GroupProfile(object sender, GroupProfileEventArgs e)
        {
            if (group.ID != e.Group.ID) return;

            if (InvokeRequired)
            {
                BeginInvoke(new MethodInvoker(() => Groups_GroupProfile(sender, e)));
                return;
            }

            group = e.Group;
            if (group.InsigniaID != UUID.Zero && pnlInsignia.Controls.Count == 0)
            {
                SLImageHandler insignia = new SLImageHandler(instance, group.InsigniaID, string.Empty);
                insignia.Dock = DockStyle.Fill;
                pnlInsignia.Controls.Add(insignia);
            }

            tbxCharter.Text = group.Charter;
            lblFounded.Text = "Founded by: " + instance.Names.Get(group.FounderID);
            cbxShowInSearch.Checked = group.ShowInList;
            cbxOpenEnrollment.Checked = group.OpenEnrollment;

            if (group.MembershipFee > 0)
            {
                cbxEnrollmentFee.Checked = true;
                nudEnrollmentFee.Value = group.MembershipFee;
            }
            else
            {
                cbxEnrollmentFee.Checked = false;
                nudEnrollmentFee.Value = 0;
            }

            if (group.MaturePublish)
            {
                cbxMaturity.SelectedIndex = 1;
            }
            else
            {
                cbxMaturity.SelectedIndex = 0;
            }

            btnJoin.Enabled = btnJoin.Visible = false;

            if (myGroups.ContainsKey(group.ID)) // I am in this group
            {
                cbxReceiveNotices.Checked = myGroups[group.ID].AcceptNotices;
                cbxListInProfile.Checked = myGroups[group.ID].ListInProfile;
                cbxReceiveNotices.CheckedChanged += new EventHandler(cbxListInProfile_CheckedChanged);
                cbxListInProfile.CheckedChanged += new EventHandler(cbxListInProfile_CheckedChanged);
            }
            else if (group.OpenEnrollment) // I am not in this group, but I could join it
            {
                btnJoin.Text = "Join $L" + group.MembershipFee;
                btnJoin.Enabled = btnJoin.Visible = true;
            }

            RefreshControlsAvailability();
        }