mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 05:45:37 +08:00
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user