Added llTargetedEmail

Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
This commit is contained in:
StolenRuby
2020-08-08 14:54:26 +01:00
committed by UbitUmarov
parent 329b919361
commit d022891cc1
4 changed files with 48 additions and 0 deletions

View File

@@ -4046,6 +4046,45 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
public void llTargetedEmail(LSL_Integer target, string subject, string message)
{
m_host.AddScriptLPS(1);
IEmailModule emailModule = m_ScriptEngine.World.RequestModuleInterface<IEmailModule>();
if (emailModule == null)
{
Error("llTargetedEmail", "Email module not configured");
return;
}
string address;
if(target == ScriptBaseClass.TARGETED_EMAIL_OBJECT_OWNER)
{
UserAccount account =
World.UserAccountService.GetUserAccount(
World.RegionInfo.ScopeID,
m_host.OwnerID);
if (account == null)
{
Error("llEmail", "Can't find user account for '" + m_host.OwnerID.ToString() + "'");
return;
}
if (String.IsNullOrEmpty(account.Email))
{
Error("llEmail", "User account has not registered an email address.");
return;
}
address = account.Email;
}
else return;
emailModule.SendEmail(m_host.UUID, address, subject, message);
ScriptSleep(m_sleepMsOnEmail);
}
public LSL_Key llGetKey()
{
m_host.AddScriptLPS(1);

View File

@@ -426,6 +426,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer llTarget(LSL_Vector position, double range);
void llTargetOmega(LSL_Vector axis, double spinrate, double gain);
void llTargetRemove(int number);
void llTargetedEmail(LSL_Integer target, string subject, string message);
void llTeleportAgentHome(string agent);
void llTeleportAgent(string agent, string simname, LSL_Vector pos, LSL_Vector lookAt);
void llTeleportAgentGlobalCoords(string agent, LSL_Vector global, LSL_Vector pos, LSL_Vector lookAt);

View File

@@ -970,5 +970,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const string IMG_USE_BAKED_AUX1 = "9742065b-19b5-297c-858a-29711d539043";
public const string IMG_USE_BAKED_AUX2 = "03642e83-2bd1-4eb9-34b4-4c47ed586d2d";
public const string IMG_USE_BAKED_AUX3 = "edd51b77-fc10-ce7a-4b3d-011dfc349e4f";
// llTargetedEmail
public const int TARGETED_EMAIL_OBJECT_OWNER = 2;
}
}

View File

@@ -1921,6 +1921,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llTargetRemove(number);
}
public void llTargetedEmail(LSL_Integer target, string subject, string message)
{
m_LSL_Functions.llTargetedEmail(target, subject, message);
}
public void llTeleportAgent(string agent, string simname, LSL_Vector pos, LSL_Vector lookAt)
{
m_LSL_Functions.llTeleportAgent(agent, simname, pos, lookAt);