add a /index.php fake handler, for map. only does ?method=.. but can be extended)

This commit is contained in:
UbitUmarov
2020-04-25 23:24:00 +01:00
parent 70d2878d0a
commit dcc2f764f2
4 changed files with 73 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ namespace OpenSim.Framework.Servers.HttpServer
protected ConcurrentDictionary<string, PollServiceEventArgs> m_pollHandlers =
new ConcurrentDictionary<string, PollServiceEventArgs>();
protected ConcurrentDictionary<string, SimpleStreamMethod> m_indexPHPmethods = new ConcurrentDictionary<string, SimpleStreamMethod>();
protected Dictionary<string, WebSocketRequestDelegate> m_WebSocketHandlers =
new Dictionary<string, WebSocketRequestDelegate>();
@@ -535,6 +536,24 @@ namespace OpenSim.Framework.Servers.HttpServer
return true;
}
public void AddIndexPHPMethodHandler(string key, SimpleStreamMethod sh)
{
m_indexPHPmethods.TryAdd(key, sh);
}
public void RemoveIndexPHPMethodHandler(string key)
{
m_indexPHPmethods.TryRemove(key, out SimpleStreamMethod sh);
}
public SimpleStreamMethod TryGetIndexPHPMethodHandler(string key)
{
if(m_indexPHPmethods.TryGetValue(key, out SimpleStreamMethod sh))
return sh;
return null;
}
public void OnRequest(object source, RequestEventArgs args)
{
RequestNumber++;