aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-09-17 13:18:48 +0000
committerJustin Clarke Casey2008-09-17 13:18:48 +0000
commitc9c59c68f16f82df6e7a8f95a2f7b3d9400b8689 (patch)
treebd6e8a8a35cf25ca5d0dea6060a516faef4daa5d /OpenSim
parent* Apply http://opensimulator.org/mantis/view.php?id=2206 (diff)
downloadopensim-SC_OLD-c9c59c68f16f82df6e7a8f95a2f7b3d9400b8689.zip
opensim-SC_OLD-c9c59c68f16f82df6e7a8f95a2f7b3d9400b8689.tar.gz
opensim-SC_OLD-c9c59c68f16f82df6e7a8f95a2f7b3d9400b8689.tar.bz2
opensim-SC_OLD-c9c59c68f16f82df6e7a8f95a2f7b3d9400b8689.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2207
* Attached patch implements llRequestAgentData for DotNetEngine. (It already is implemented in XEngine.) * Thanks Y. Nitta
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs49
2 files changed, 48 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
index cfc8e94..08693b3 100644
--- a/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/BuiltIn_Commands_BaseClass.cs
@@ -2257,6 +2257,7 @@ namespace OpenSim.Region.ScriptEngine.Common
2257 public const int DATA_SIM_POS = 5; 2257 public const int DATA_SIM_POS = 5;
2258 public const int DATA_SIM_STATUS = 6; 2258 public const int DATA_SIM_STATUS = 6;
2259 public const int DATA_SIM_RATING = 7; 2259 public const int DATA_SIM_RATING = 7;
2260 public const int DATA_PAYINFO = 8;
2260 public const int DATA_SIM_RELEASE = 128; 2261 public const int DATA_SIM_RELEASE = 128;
2261 2262
2262 public const int ANIM_ON = 1; 2263 public const int ANIM_ON = 1;
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 3615e94..a9ecd70 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -3250,9 +3250,54 @@ namespace OpenSim.Region.ScriptEngine.Common
3250 public string llRequestAgentData(string id, int data) 3250 public string llRequestAgentData(string id, int data)
3251 { 3251 {
3252 m_host.AddScriptLPS(1); 3252 m_host.AddScriptLPS(1);
3253 NotImplemented("llRequestAgentData"); 3253
3254 UserProfileData userProfile =
3255 World.CommsManager.UserService.GetUserProfile(id);
3256
3257 UserAgentData userAgent =
3258 World.CommsManager.UserService.GetAgentByUUID(id);
3259
3260 if (userProfile == null || userAgent == null)
3261 return UUID.Zero.ToString();
3262
3263 string reply = String.Empty;
3264
3265 switch (data)
3266 {
3267 case BuiltIn_Commands_BaseClass.DATA_ONLINE: // DATA_ONLINE (0|1)
3268 if (userProfile.CurrentAgent.AgentOnline)
3269 reply = "1";
3270 else
3271 reply = "0";
3272 break;
3273 case BuiltIn_Commands_BaseClass.DATA_NAME: // DATA_NAME (First Last)
3274 reply = userProfile.FirstName + " " + userProfile.SurName;
3275 break;
3276 case BuiltIn_Commands_BaseClass.DATA_BORN: // DATA_BORN (YYYY-MM-DD)
3277 DateTime born = new DateTime(1970, 1, 1, 0, 0, 0, 0);
3278 born = born.AddSeconds(userProfile.Created);
3279 reply = born.ToString("yyyy-MM-dd");
3280 break;
3281 case BuiltIn_Commands_BaseClass.DATA_RATING: // DATA_RATING (0,0,0,0,0,0)
3282 reply = "0,0,0,0,0,0";
3283 break;
3284 case BuiltIn_Commands_BaseClass.DATA_PAYINFO: // DATA_PAYINFO (0|1|2|3)
3285 reply = "0";
3286 break;
3287 default:
3288 return UUID.Zero.ToString(); // Raise no event
3289 }
3290
3291 UUID rq = UUID.Random();
3292
3293 UUID tid = m_ScriptEngine.m_ASYNCLSLCommandManager.m_Dataserver.RegisterRequest(
3294 m_localID, m_itemID, rq.ToString());
3295
3296 m_ScriptEngine.m_ASYNCLSLCommandManager.
3297 m_Dataserver.DataserverReply(rq.ToString(), reply);
3298
3254 // ScriptSleep(100); 3299 // ScriptSleep(100);
3255 return String.Empty; 3300 return tid.ToString();
3256 } 3301 }
3257 3302
3258 public string llRequestInventoryData(string name) 3303 public string llRequestInventoryData(string name)