Exemplo n.º 1
0
        protected virtual void GroupInvite(InstantMessageEventArgs e)
        {
            string[] stage1          = myconfig.master.ToLowerInvariant().Split(' ');
            string   bad_master_name = String.Join('.', stage1);

            if (e.IM.FromAgentName == bad_master_name)
            {
                GroupInvitationEventArgs G = new GroupInvitationEventArgs(e.Simulator, e.IM.FromAgentID, e.IM.FromAgentName, e.IM.Message);
                Client.Self.GroupInviteRespond(G.AgentID, e.IM.IMSessionID, true);
                Client.Groups.RequestCurrentGroups(); // reload my groups to include the new group
            }
        }
Exemplo n.º 2
0
        protected override void GroupInvite(InstantMessageEventArgs e)
        {
            string[] stage1 = e.IM.FromAgentName.ToLowerInvariant().Split('.');
            if (stage1.Length == 1)
            {
                stage1 = e.IM.FromAgentName.ToLowerInvariant().Split(" ");
            }
            string name = "" + stage1[0].FirstCharToUpper() + "";

            if (stage1.Length == 1)
            {
                name = " Resident";
            }
            else
            {
                name = "" + name + " " + stage1[1].FirstCharToUpper() + "";
            }
            bool   accept_invite;
            string whyAccept = "";

            if (Is_avatar_master(name) == true)
            {
                accept_invite = true;
                whyAccept     = "Master";
            }
            else
            {
                name          = name.ToLowerInvariant();
                accept_invite = Accept_action_from_name("group", name);
                if (accept_invite == true)
                {
                    whyAccept = "Action auth";
                    Remove_action_from_name("group", name);
                }
            }
            if (accept_invite == true)
            {
                LogFormater.Info("Group invite event from: " + e.IM.FromAgentName + " Accepted - " + whyAccept);
                GroupInvitationEventArgs G = new GroupInvitationEventArgs(e.Simulator, e.IM.FromAgentID, e.IM.FromAgentName, e.IM.Message);
                Client.Self.GroupInviteRespond(G.AgentID, e.IM.IMSessionID, true);
                Client.Groups.RequestCurrentGroups();
            }
            else
            {
                LogFormater.Info("Group invite event from: " + e.IM.FromAgentName + " Rejected");
            }
        }