diff options
author | John Hurliman | 2009-10-05 17:38:27 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-05 17:38:27 -0700 |
commit | 7ddb6fbced5f2a98aa0201e354987ebc32adf7d2 (patch) | |
tree | 903b87112e7f851218e7b3d41c681f1b8f512af2 /OpenSim/Server/Handlers/Grid | |
parent | Beginning work on the new LLUDP implementation (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.zip opensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.tar.gz opensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.tar.bz2 opensim-SC_OLD-7ddb6fbced5f2a98aa0201e354987ebc32adf7d2.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into htb-throttle
Diffstat (limited to 'OpenSim/Server/Handlers/Grid')
-rw-r--r-- | OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 75 |
1 files changed, 46 insertions, 29 deletions
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index e22328d..433ed0b 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | |||
@@ -67,43 +67,50 @@ namespace OpenSim.Server.Handlers.Grid | |||
67 | 67 | ||
68 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 68 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
69 | 69 | ||
70 | Dictionary<string, string> request = | 70 | try |
71 | ServerUtils.ParseQueryString(body); | 71 | { |
72 | Dictionary<string, string> request = | ||
73 | ServerUtils.ParseQueryString(body); | ||
72 | 74 | ||
73 | if (!request.ContainsKey("METHOD")) | 75 | if (!request.ContainsKey("METHOD")) |
74 | return FailureResult(); | 76 | return FailureResult(); |
75 | 77 | ||
76 | string method = request["METHOD"]; | 78 | string method = request["METHOD"]; |
77 | 79 | ||
78 | switch (method) | 80 | switch (method) |
79 | { | 81 | { |
80 | case "register": | 82 | case "register": |
81 | return Register(request); | 83 | return Register(request); |
82 | 84 | ||
83 | case "deregister": | 85 | case "deregister": |
84 | return Deregister(request); | 86 | return Deregister(request); |
85 | 87 | ||
86 | case "get_neighbours": | 88 | case "get_neighbours": |
87 | return GetNeighbours(request); | 89 | return GetNeighbours(request); |
88 | 90 | ||
89 | case "get_region_by_uuid": | 91 | case "get_region_by_uuid": |
90 | return GetRegionByUUID(request); | 92 | return GetRegionByUUID(request); |
91 | 93 | ||
92 | case "get_region_by_position": | 94 | case "get_region_by_position": |
93 | return GetRegionByPosition(request); | 95 | return GetRegionByPosition(request); |
94 | 96 | ||
95 | case "get_region_by_name": | 97 | case "get_region_by_name": |
96 | return GetRegionByName(request); | 98 | return GetRegionByName(request); |
97 | 99 | ||
98 | case "get_regions_by_name": | 100 | case "get_regions_by_name": |
99 | return GetRegionsByName(request); | 101 | return GetRegionsByName(request); |
100 | 102 | ||
101 | case "get_region_range": | 103 | case "get_region_range": |
102 | return GetRegionRange(request); | 104 | return GetRegionRange(request); |
103 | 105 | ||
106 | } | ||
107 | m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method); | ||
108 | } | ||
109 | catch (Exception e) | ||
110 | { | ||
111 | m_log.DebugFormat("[GRID HANDLER]: Exception {0}", e); | ||
104 | } | 112 | } |
105 | 113 | ||
106 | m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method); | ||
107 | return FailureResult(); | 114 | return FailureResult(); |
108 | 115 | ||
109 | } | 116 | } |
@@ -113,7 +120,7 @@ namespace OpenSim.Server.Handlers.Grid | |||
113 | byte[] Register(Dictionary<string, string> request) | 120 | byte[] Register(Dictionary<string, string> request) |
114 | { | 121 | { |
115 | UUID scopeID = UUID.Zero; | 122 | UUID scopeID = UUID.Zero; |
116 | if (request["SCOPEID"] != null) | 123 | if (request.ContainsKey("SCOPEID")) |
117 | UUID.TryParse(request["SCOPEID"], out scopeID); | 124 | UUID.TryParse(request["SCOPEID"], out scopeID); |
118 | else | 125 | else |
119 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); | 126 | m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); |
@@ -137,11 +144,21 @@ namespace OpenSim.Server.Handlers.Grid | |||
137 | } | 144 | } |
138 | 145 | ||
139 | Dictionary<string, object> rinfoData = new Dictionary<string, object>(); | 146 | Dictionary<string, object> rinfoData = new Dictionary<string, object>(); |
140 | foreach (KeyValuePair<string, string> kvp in request) | 147 | GridRegion rinfo = null; |
141 | rinfoData[kvp.Key] = kvp.Value; | 148 | try |
142 | GridRegion rinfo = new GridRegion(rinfoData); | 149 | { |
150 | foreach (KeyValuePair<string, string> kvp in request) | ||
151 | rinfoData[kvp.Key] = kvp.Value; | ||
152 | rinfo = new GridRegion(rinfoData); | ||
153 | } | ||
154 | catch (Exception e) | ||
155 | { | ||
156 | m_log.DebugFormat("[GRID HANDLER]: exception unpacking region data: {0}", e); | ||
157 | } | ||
143 | 158 | ||
144 | bool result = m_GridService.RegisterRegion(scopeID, rinfo); | 159 | bool result = false; |
160 | if (rinfo != null) | ||
161 | result = m_GridService.RegisterRegion(scopeID, rinfo); | ||
145 | 162 | ||
146 | if (result) | 163 | if (result) |
147 | return SuccessResult(); | 164 | return SuccessResult(); |