diff options
author | Teravus Ovares | 2008-03-18 05:44:25 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-03-18 05:44:25 +0000 |
commit | 42857fe4e9e898c8e350da2f9acb3b252b31694a (patch) | |
tree | de55ab7f5d6d6e1bb127a39f6e97f67e4e442cf4 /OpenSim/Grid | |
parent | Formatting cleanup. (diff) | |
download | opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.zip opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.gz opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.bz2 opensim-SC-42857fe4e9e898c8e350da2f9acb3b252b31694a.tar.xz |
* Added the ability to type the partial name of a region in the start location box and go to that region if it's there. If no close match was found, it sends you home. This is tested on mySQL. There's untested code on grids that are based on sqlite and MSSQL. The SQL statements *should* be right, but your results may very.
* Ex, if you want to go to Wright Plaza, you simply need to type Wright Plaza in the start location in the client when you log-in.
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r-- | OpenSim/Grid/GridServer/GridManager.cs | 25 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 38 |
2 files changed, 58 insertions, 5 deletions
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index e9ff91a..86fc445 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -164,6 +164,27 @@ namespace OpenSim.Grid.GridServer | |||
164 | return null; | 164 | return null; |
165 | } | 165 | } |
166 | 166 | ||
167 | /// <summary> | ||
168 | /// Returns a region by argument | ||
169 | /// </summary> | ||
170 | /// <param name="regionName">A partial regionName of the region to return</param> | ||
171 | /// <returns>A SimProfileData for the region</returns> | ||
172 | public RegionProfileData getRegion(string regionName) | ||
173 | { | ||
174 | foreach (KeyValuePair<string, IGridData> kvp in _plugins) | ||
175 | { | ||
176 | try | ||
177 | { | ||
178 | return kvp.Value.GetProfileByString(regionName); | ||
179 | } | ||
180 | catch | ||
181 | { | ||
182 | m_log.Warn("[storage]: Unable to find region " + regionName + " via " + kvp.Key); | ||
183 | } | ||
184 | } | ||
185 | return null; | ||
186 | } | ||
187 | |||
167 | public Dictionary<ulong, RegionProfileData> getRegions(uint xmin, uint ymin, uint xmax, uint ymax) | 188 | public Dictionary<ulong, RegionProfileData> getRegions(uint xmin, uint ymin, uint xmax, uint ymax) |
168 | { | 189 | { |
169 | Dictionary<ulong, RegionProfileData> regions = new Dictionary<ulong, RegionProfileData>(); | 190 | Dictionary<ulong, RegionProfileData> regions = new Dictionary<ulong, RegionProfileData>(); |
@@ -615,6 +636,10 @@ namespace OpenSim.Grid.GridServer | |||
615 | //CFK: Console.WriteLine("requesting data for region " + (string) requestData["region_handle"]); | 636 | //CFK: Console.WriteLine("requesting data for region " + (string) requestData["region_handle"]); |
616 | simData = getRegion(Convert.ToUInt64((string)requestData["region_handle"])); | 637 | simData = getRegion(Convert.ToUInt64((string)requestData["region_handle"])); |
617 | } | 638 | } |
639 | else if (requestData.ContainsKey("region_name_search")) | ||
640 | { | ||
641 | simData = getRegion((string)requestData["region_name_search"]); | ||
642 | } | ||
618 | 643 | ||
619 | if (simData == null) | 644 | if (simData == null) |
620 | { | 645 | { |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index b85ece9..6cc34d5 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -64,6 +64,8 @@ namespace OpenSim.Grid.UserServer | |||
64 | m_config = config; | 64 | m_config = config; |
65 | } | 65 | } |
66 | 66 | ||
67 | |||
68 | |||
67 | /// <summary> | 69 | /// <summary> |
68 | /// Customises the login response and fills in missing values. | 70 | /// Customises the login response and fills in missing values. |
69 | /// </summary> | 71 | /// </summary> |
@@ -95,11 +97,34 @@ namespace OpenSim.Grid.UserServer | |||
95 | } | 97 | } |
96 | else | 98 | else |
97 | { | 99 | { |
98 | // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z' | 100 | string[] startLocationRequestParsed = Util.ParseStartLocationRequest(startLocationRequest); |
99 | SimInfo = | 101 | m_log.Info("[DEBUGLOGINPARSE]: 1:" + startLocationRequestParsed[0] + ", 2:" + startLocationRequestParsed[1] + ", 3:" + startLocationRequestParsed[2] + ", 4:" + startLocationRequestParsed[3]); |
102 | if (startLocationRequestParsed[0] == "last") | ||
103 | { | ||
104 | // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z' | ||
105 | SimInfo = | ||
106 | RegionProfileData.RequestSimProfileData( | ||
107 | theUser.currentAgent.currentHandle, m_config.GridServerURL, | ||
108 | m_config.GridSendKey, m_config.GridRecvKey); | ||
109 | } | ||
110 | else | ||
111 | { | ||
112 | m_log.Info("[LOGIN]: Looking up Sim: " + startLocationRequestParsed[0]); | ||
113 | SimInfo = | ||
100 | RegionProfileData.RequestSimProfileData( | 114 | RegionProfileData.RequestSimProfileData( |
101 | theUser.currentAgent.currentHandle, m_config.GridServerURL, | 115 | startLocationRequestParsed[0], m_config.GridServerURL, |
102 | m_config.GridSendKey, m_config.GridRecvKey); | 116 | m_config.GridSendKey, m_config.GridRecvKey); |
117 | |||
118 | if (SimInfo == null) | ||
119 | { | ||
120 | m_log.Info("[LOGIN]: Didn't find region with a close name match sending to home location"); | ||
121 | SimInfo = | ||
122 | RegionProfileData.RequestSimProfileData( | ||
123 | theUser.homeRegion, m_config.GridServerURL, | ||
124 | m_config.GridSendKey, m_config.GridRecvKey); | ||
125 | } | ||
126 | |||
127 | } | ||
103 | } | 128 | } |
104 | 129 | ||
105 | // Customise the response | 130 | // Customise the response |
@@ -132,6 +157,9 @@ namespace OpenSim.Grid.UserServer | |||
132 | //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " + | 157 | //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " + |
133 | //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); | 158 | //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); |
134 | 159 | ||
160 | theUser.currentAgent.currentRegion = SimInfo.UUID; | ||
161 | theUser.currentAgent.currentHandle = SimInfo.regionHandle; | ||
162 | |||
135 | // Prepare notification | 163 | // Prepare notification |
136 | Hashtable SimParams = new Hashtable(); | 164 | Hashtable SimParams = new Hashtable(); |
137 | SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); | 165 | SimParams["session_id"] = theUser.currentAgent.sessionID.ToString(); |
@@ -149,8 +177,7 @@ namespace OpenSim.Grid.UserServer | |||
149 | SendParams.Add(SimParams); | 177 | SendParams.Add(SimParams); |
150 | 178 | ||
151 | // Update agent with target sim | 179 | // Update agent with target sim |
152 | theUser.currentAgent.currentRegion = SimInfo.UUID; | 180 | |
153 | theUser.currentAgent.currentHandle = SimInfo.regionHandle; | ||
154 | 181 | ||
155 | m_log.Info("[LOGIN]: Telling " | 182 | m_log.Info("[LOGIN]: Telling " |
156 | + SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + | 183 | + SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + |
@@ -175,6 +202,7 @@ namespace OpenSim.Grid.UserServer | |||
175 | } | 202 | } |
176 | } | 203 | } |
177 | catch (Exception) | 204 | catch (Exception) |
205 | //catch (System.AccessViolationException) | ||
178 | { | 206 | { |
179 | tryDefault = true; | 207 | tryDefault = true; |
180 | } | 208 | } |