Update EventsBot.cs
This commit is contained in:
parent
747191c457
commit
8724e9efd7
1 changed files with 15 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using BetterSecondBotShared.logs;
|
||||||
using BetterSecondBotShared.Static;
|
using BetterSecondBotShared.Static;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenMetaverse.Imaging;
|
using OpenMetaverse.Imaging;
|
||||||
|
|
@ -502,8 +503,13 @@ namespace BetterSecondBot.bottypes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void GroupInvite(InstantMessageEventArgs e)
|
protected override void GroupInvite(InstantMessageEventArgs e)
|
||||||
{
|
{
|
||||||
|
LogFormater.Info("Group invite event from: " + e.IM.FromAgentName);
|
||||||
string[] stage1 = e.IM.FromAgentName.ToLowerInvariant().Split('.');
|
string[] stage1 = e.IM.FromAgentName.ToLowerInvariant().Split('.');
|
||||||
|
if(stage1.Length == 1)
|
||||||
|
{
|
||||||
|
stage1 = e.IM.FromAgentName.ToLowerInvariant().Split(" ");
|
||||||
|
}
|
||||||
string name = "" + stage1[0].FirstCharToUpper() + "";
|
string name = "" + stage1[0].FirstCharToUpper() + "";
|
||||||
if (stage1.Length == 1)
|
if (stage1.Length == 1)
|
||||||
{
|
{
|
||||||
|
|
@ -514,24 +520,32 @@ namespace BetterSecondBot.bottypes
|
||||||
name = "" + name + " " + stage1[1].FirstCharToUpper() + "";
|
name = "" + name + " " + stage1[1].FirstCharToUpper() + "";
|
||||||
}
|
}
|
||||||
bool accept_invite;
|
bool accept_invite;
|
||||||
|
string whyAccept = "";
|
||||||
if (Is_avatar_master(name) == true)
|
if (Is_avatar_master(name) == true)
|
||||||
{
|
{
|
||||||
accept_invite = true;
|
accept_invite = true;
|
||||||
|
whyAccept = "Master";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
accept_invite = Accept_action_from("group", e.IM.FromAgentID);
|
accept_invite = Accept_action_from("group", e.IM.FromAgentID);
|
||||||
if(accept_invite == true)
|
if(accept_invite == true)
|
||||||
{
|
{
|
||||||
|
whyAccept = "Action auth";
|
||||||
Remove_action_from("group", e.IM.FromAgentID);
|
Remove_action_from("group", e.IM.FromAgentID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (accept_invite == true)
|
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);
|
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.Self.GroupInviteRespond(G.AgentID, e.IM.IMSessionID, true);
|
||||||
Client.Groups.RequestCurrentGroups();
|
Client.Groups.RequestCurrentGroups();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogFormater.Info("Group invite event from: " + e.IM.FromAgentName + " Rejected");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue