diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index e5be641..c16a985 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -10268,6 +10268,55 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10268 | m_log.Info("LSL print():" + str); | 10268 | m_log.Info("LSL print():" + str); |
10269 | } | 10269 | } |
10270 | } | 10270 | } |
10271 | |||
10272 | private string Name2Username(string name) | ||
10273 | { | ||
10274 | string[] parts = name.Split(new char[] {' '}); | ||
10275 | if (parts.Length < 2) | ||
10276 | return name.ToLower(); | ||
10277 | if (parts[1] == "Resident") | ||
10278 | return parts[0].ToLower(); | ||
10279 | |||
10280 | return name.Replace(" ", ".").ToLower(); | ||
10281 | } | ||
10282 | |||
10283 | public LSL_String llGetUsername(string id) | ||
10284 | { | ||
10285 | return Name2Username(llKey2Name(id)); | ||
10286 | } | ||
10287 | |||
10288 | public LSL_String llRequestUsername(string id) | ||
10289 | { | ||
10290 | UUID rq = UUID.Random(); | ||
10291 | |||
10292 | UUID tid = AsyncCommands. | ||
10293 | DataserverPlugin.RegisterRequest(m_localID, | ||
10294 | m_itemID, rq.ToString()); | ||
10295 | |||
10296 | AsyncCommands. | ||
10297 | DataserverPlugin.DataserverReply(rq.ToString(), Name2Username(llKey2Name(id))); | ||
10298 | |||
10299 | return rq.ToString(); | ||
10300 | } | ||
10301 | |||
10302 | public LSL_String llGetDisplayName(string id) | ||
10303 | { | ||
10304 | return llKey2Name(id); | ||
10305 | } | ||
10306 | |||
10307 | public LSL_String llRequestDisplayName(string id) | ||
10308 | { | ||
10309 | UUID rq = UUID.Random(); | ||
10310 | |||
10311 | UUID tid = AsyncCommands. | ||
10312 | DataserverPlugin.RegisterRequest(m_localID, | ||
10313 | m_itemID, rq.ToString()); | ||
10314 | |||
10315 | AsyncCommands. | ||
10316 | DataserverPlugin.DataserverReply(rq.ToString(), llKey2Name(id)); | ||
10317 | |||
10318 | return rq.ToString(); | ||
10319 | } | ||
10271 | } | 10320 | } |
10272 | 10321 | ||
10273 | public class NotecardCache | 10322 | public class NotecardCache |