29 using System.Collections;
30 using System.Collections.Generic;
32 using OpenSim.Region.ScriptEngine.Shared;
33 using OpenSim.Region.ScriptEngine.Shared.Api;
35 namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
41 public int DataserverRequestsCount
45 lock (DataserverRequests)
46 return DataserverRequests.Count;
50 private Dictionary<string, DataserverRequest> DataserverRequests =
51 new Dictionary<string, DataserverRequest>();
55 m_CmdManager = CmdManager;
58 private class DataserverRequest
66 public DateTime startTime;
72 lock (DataserverRequests)
74 if (DataserverRequests.ContainsKey(identifier))
77 DataserverRequest ds =
new DataserverRequest();
82 ds.ID = UUID.Random();
83 ds.handle = identifier;
85 ds.startTime = DateTime.Now;
87 DataserverRequests[identifier] = ds;
97 lock (DataserverRequests)
99 if (!DataserverRequests.ContainsKey(identifier))
102 ds = DataserverRequests[identifier];
103 DataserverRequests.Remove(identifier);
106 m_CmdManager.m_ScriptEngine.PostObjectEvent(ds.localID,
115 lock (DataserverRequests)
117 foreach (DataserverRequest ds
in new List<DataserverRequest>(DataserverRequests.Values))
119 if (ds.itemID == itemID)
120 DataserverRequests.Remove(ds.handle);
127 lock (DataserverRequests)
129 foreach (DataserverRequest ds
in new List<DataserverRequest>(DataserverRequests.Values))
131 if (ds.startTime > DateTime.Now.AddSeconds(30))
132 DataserverRequests.Remove(ds.handle);
UUID RegisterRequest(uint localID, UUID itemID, string identifier)
Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc.
Dataserver(AsyncCommandManager CmdManager)
void DataserverReply(string identifier, string reply)
AsyncCommandManager m_CmdManager
Interactive OpenSim region server
Holds all the data required to execute a scripting event.
void RemoveEvents(uint localID, UUID itemID)