diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 | ||||
-rw-r--r-- | OpenSim/Tools/pCampBot/Bot.cs | 37 | ||||
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 32 |
5 files changed, 52 insertions, 33 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 60c130f..9fe284f 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -56,6 +56,7 @@ namespace OpenSim | |||
56 | protected bool m_gui = false; | 56 | protected bool m_gui = false; |
57 | protected string m_consoleType = "local"; | 57 | protected string m_consoleType = "local"; |
58 | protected uint m_consolePort = 0; | 58 | protected uint m_consolePort = 0; |
59 | protected string m_custom_prompt; | ||
59 | 60 | ||
60 | private string m_timedScript = "disabled"; | 61 | private string m_timedScript = "disabled"; |
61 | private Timer m_scriptTimer; | 62 | private Timer m_scriptTimer; |
@@ -85,7 +86,9 @@ namespace OpenSim | |||
85 | 86 | ||
86 | if (networkConfig != null) | 87 | if (networkConfig != null) |
87 | m_consolePort = (uint)networkConfig.GetInt("console_port", 0); | 88 | m_consolePort = (uint)networkConfig.GetInt("console_port", 0); |
89 | |||
88 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); | 90 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); |
91 | |||
89 | if (m_logFileAppender != null) | 92 | if (m_logFileAppender != null) |
90 | { | 93 | { |
91 | if (m_logFileAppender is log4net.Appender.FileAppender) | 94 | if (m_logFileAppender is log4net.Appender.FileAppender) |
@@ -108,6 +111,7 @@ namespace OpenSim | |||
108 | Util.FireAndForgetMethod = asyncCallMethod; | 111 | Util.FireAndForgetMethod = asyncCallMethod; |
109 | 112 | ||
110 | stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15); | 113 | stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15); |
114 | m_custom_prompt = startupConfig.GetString("custom_prompt", "Region"); | ||
111 | } | 115 | } |
112 | 116 | ||
113 | if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) | 117 | if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) |
@@ -831,7 +835,7 @@ namespace OpenSim | |||
831 | 835 | ||
832 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); | 836 | string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); |
833 | MainConsole.Instance.Output(String.Format("Currently selected region is {0}", regionName)); | 837 | MainConsole.Instance.Output(String.Format("Currently selected region is {0}", regionName)); |
834 | m_console.DefaultPrompt = String.Format("Region ({0}) ", regionName); | 838 | m_console.DefaultPrompt = String.Format("{0} ({1}) ", m_custom_prompt, regionName); |
835 | m_console.ConsoleScene = m_sceneManager.CurrentScene; | 839 | m_console.ConsoleScene = m_sceneManager.CurrentScene; |
836 | } | 840 | } |
837 | 841 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f6bfc9b..3fa6bb0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -2899,7 +2899,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2899 | } | 2899 | } |
2900 | 2900 | ||
2901 | /// <summary> | 2901 | /// <summary> |
2902 | /// Update the entire rotation of the group. | 2902 | /// Update the rotation of just the root prim of a linkset. |
2903 | /// </summary> | 2903 | /// </summary> |
2904 | /// <param name="rot"></param> | 2904 | /// <param name="rot"></param> |
2905 | public void UpdateRootRotation(Quaternion rot) | 2905 | public void UpdateRootRotation(Quaternion rot) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 99be46d..fc5141f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2013,8 +2013,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2013 | sitOrientation = avSitOrientation; | 2013 | sitOrientation = avSitOrientation; |
2014 | autopilot = false; | 2014 | autopilot = false; |
2015 | } | 2015 | } |
2016 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | ||
2017 | |||
2018 | pos = part.AbsolutePosition + offset; | 2016 | pos = part.AbsolutePosition + offset; |
2019 | //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) | 2017 | //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) |
2020 | //{ | 2018 | //{ |
@@ -2060,6 +2058,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2060 | m_sitAtAutoTarget = autopilot; | 2058 | m_sitAtAutoTarget = autopilot; |
2061 | if (!autopilot) | 2059 | if (!autopilot) |
2062 | HandleAgentSit(remoteClient, UUID); | 2060 | HandleAgentSit(remoteClient, UUID); |
2061 | |||
2062 | // Moved here to avoid a race with default sit anim | ||
2063 | // The script event needs to be raised after the default sit anim is set. | ||
2064 | if (part != null) | ||
2065 | part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); | ||
2066 | |||
2063 | } | 2067 | } |
2064 | 2068 | ||
2065 | // public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset, string sitAnimation) | 2069 | // public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset, string sitAnimation) |
diff --git a/OpenSim/Tools/pCampBot/Bot.cs b/OpenSim/Tools/pCampBot/Bot.cs index 1b30766..7f941a4 100644 --- a/OpenSim/Tools/pCampBot/Bot.cs +++ b/OpenSim/Tools/pCampBot/Bot.cs | |||
@@ -222,7 +222,7 @@ namespace pCampBot | |||
222 | } | 222 | } |
223 | else | 223 | else |
224 | { | 224 | { |
225 | MainConsole.Instance.OutputFormat( | 225 | m_log.ErrorFormat( |
226 | "{0} {1} cannot login: {2}", FirstName, LastName, Client.Network.LoginMessage); | 226 | "{0} {1} cannot login: {2}", FirstName, LastName, Client.Network.LoginMessage); |
227 | 227 | ||
228 | if (OnDisconnected != null) | 228 | if (OnDisconnected != null) |
@@ -266,12 +266,12 @@ namespace pCampBot | |||
266 | } | 266 | } |
267 | else | 267 | else |
268 | { | 268 | { |
269 | MainConsole.Instance.Output(String.Format("Failed to decode {0} asset {1}", asset.AssetType, asset.AssetID)); | 269 | m_log.WarnFormat("Failed to decode {0} asset {1}", asset.AssetType, asset.AssetID); |
270 | } | 270 | } |
271 | } | 271 | } |
272 | catch (Exception e) | 272 | catch (Exception e) |
273 | { | 273 | { |
274 | MainConsole.Instance.Output(String.Format("Exception: {0}",e.ToString())); | 274 | m_log.ErrorFormat("Exception: {0}{1}", e.Message, e.StackTrace); |
275 | } | 275 | } |
276 | } | 276 | } |
277 | } | 277 | } |
@@ -305,7 +305,7 @@ namespace pCampBot | |||
305 | if (wear == "yes") | 305 | if (wear == "yes") |
306 | { | 306 | { |
307 | //TODO: Implement random outfit picking | 307 | //TODO: Implement random outfit picking |
308 | MainConsole.Instance.Output("Picks a random outfit. Not yet implemented."); | 308 | m_log.DebugFormat("Picks a random outfit. Not yet implemented."); |
309 | } | 309 | } |
310 | else if (wear != "save") | 310 | else if (wear != "save") |
311 | saveDir = "MyAppearance/" + wear; | 311 | saveDir = "MyAppearance/" + wear; |
@@ -334,7 +334,9 @@ namespace pCampBot | |||
334 | listwearables.Add(item); | 334 | listwearables.Add(item); |
335 | } | 335 | } |
336 | else | 336 | else |
337 | MainConsole.Instance.Output(String.Format("Failed to create item {0}",item.Name)); | 337 | { |
338 | m_log.WarnFormat("Failed to create item {0}", item.Name); | ||
339 | } | ||
338 | } | 340 | } |
339 | ); | 341 | ); |
340 | } | 342 | } |
@@ -356,7 +358,9 @@ namespace pCampBot | |||
356 | listwearables.Add(item); | 358 | listwearables.Add(item); |
357 | } | 359 | } |
358 | else | 360 | else |
359 | MainConsole.Instance.Output(String.Format("Failed to create item {0}",item.Name)); | 361 | { |
362 | m_log.WarnFormat("Failed to create item {0}", item.Name); | ||
363 | } | ||
360 | } | 364 | } |
361 | ); | 365 | ); |
362 | } | 366 | } |
@@ -364,10 +368,12 @@ namespace pCampBot | |||
364 | Thread.Sleep(1000); | 368 | Thread.Sleep(1000); |
365 | 369 | ||
366 | if (listwearables == null || listwearables.Count == 0) | 370 | if (listwearables == null || listwearables.Count == 0) |
367 | MainConsole.Instance.Output("Nothing to send on this folder!"); | 371 | { |
372 | m_log.DebugFormat("Nothing to send on this folder!"); | ||
373 | } | ||
368 | else | 374 | else |
369 | { | 375 | { |
370 | MainConsole.Instance.Output(String.Format("Sending {0} wearables...",listwearables.Count)); | 376 | m_log.DebugFormat("Sending {0} wearables...", listwearables.Count); |
371 | Client.Appearance.WearOutfit(listwearables, false); | 377 | Client.Appearance.WearOutfit(listwearables, false); |
372 | } | 378 | } |
373 | } | 379 | } |
@@ -447,17 +453,20 @@ namespace pCampBot | |||
447 | 453 | ||
448 | for (int i = 0; i < prim.Textures.FaceTextures.Length; i++) | 454 | for (int i = 0; i < prim.Textures.FaceTextures.Length; i++) |
449 | { | 455 | { |
450 | UUID textureID = prim.Textures.FaceTextures[i].TextureID; | 456 | Primitive.TextureEntryFace face = prim.Textures.FaceTextures[i]; |
451 | 457 | ||
452 | if (textureID != UUID.Zero) | 458 | if (face != null) |
453 | GetTexture(textureID); | 459 | { |
460 | UUID textureID = prim.Textures.FaceTextures[i].TextureID; | ||
461 | |||
462 | if (textureID != UUID.Zero) | ||
463 | GetTexture(textureID); | ||
464 | } | ||
454 | } | 465 | } |
455 | } | 466 | } |
456 | 467 | ||
457 | if (prim.Sculpt.SculptTexture != UUID.Zero) | 468 | if (prim.Sculpt != null && prim.Sculpt.SculptTexture != UUID.Zero) |
458 | { | ||
459 | GetTexture(prim.Sculpt.SculptTexture); | 469 | GetTexture(prim.Sculpt.SculptTexture); |
460 | } | ||
461 | } | 470 | } |
462 | } | 471 | } |
463 | 472 | ||
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 704770a..f5dd5e0 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -51,7 +51,6 @@ namespace pCampBot | |||
51 | protected CommandConsole m_console; | 51 | protected CommandConsole m_console; |
52 | protected List<Bot> m_lBot; | 52 | protected List<Bot> m_lBot; |
53 | protected Random somthing = new Random(Environment.TickCount); | 53 | protected Random somthing = new Random(Environment.TickCount); |
54 | protected int numbots = 0; | ||
55 | public IConfig Config { get; private set; } | 54 | public IConfig Config { get; private set; } |
56 | 55 | ||
57 | /// <summary> | 56 | /// <summary> |
@@ -137,7 +136,7 @@ namespace pCampBot | |||
137 | if (behaviourSwitches.Contains("g")) | 136 | if (behaviourSwitches.Contains("g")) |
138 | behaviours.Add(new GrabbingBehaviour()); | 137 | behaviours.Add(new GrabbingBehaviour()); |
139 | 138 | ||
140 | startupBot(i, this, behaviours, firstName, lastName, password, loginUri); | 139 | StartBot(this, behaviours, firstName, lastName, password, loginUri); |
141 | } | 140 | } |
142 | } | 141 | } |
143 | 142 | ||
@@ -157,22 +156,21 @@ namespace pCampBot | |||
157 | // int newlen = len + botcount; | 156 | // int newlen = len + botcount; |
158 | // for (int i = len; i < newlen; i++) | 157 | // for (int i = len; i < newlen; i++) |
159 | // { | 158 | // { |
160 | // startupBot(i, Config); | 159 | // startupBot(Config); |
161 | // } | 160 | // } |
162 | // } | 161 | // } |
163 | 162 | ||
164 | /// <summary> | 163 | /// <summary> |
165 | /// This starts up the bot and stores the thread for the bot in the thread array | 164 | /// This starts up the bot and stores the thread for the bot in the thread array |
166 | /// </summary> | 165 | /// </summary> |
167 | /// <param name="pos">The position in the thread array to stick the bot's thread</param> | ||
168 | /// <param name="bm"></param> | 166 | /// <param name="bm"></param> |
169 | /// <param name="behaviours">Behaviours for this bot to perform.</param> | 167 | /// <param name="behaviours">Behaviours for this bot to perform.</param> |
170 | /// <param name="firstName">First name</param> | 168 | /// <param name="firstName">First name</param> |
171 | /// <param name="lastName">Last name</param> | 169 | /// <param name="lastName">Last name</param> |
172 | /// <param name="password">Password</param> | 170 | /// <param name="password">Password</param> |
173 | /// <param name="loginUri">Login URI</param> | 171 | /// <param name="loginUri">Login URI</param> |
174 | public void startupBot( | 172 | public void StartBot( |
175 | int pos, BotManager bm, List<IBehaviour> behaviours, | 173 | BotManager bm, List<IBehaviour> behaviours, |
176 | string firstName, string lastName, string password, string loginUri) | 174 | string firstName, string lastName, string password, string loginUri) |
177 | { | 175 | { |
178 | Bot pb = new Bot(bm, behaviours, firstName, lastName, password, loginUri); | 176 | Bot pb = new Bot(bm, behaviours, firstName, lastName, password, loginUri); |
@@ -200,16 +198,17 @@ namespace pCampBot | |||
200 | { | 198 | { |
201 | case EventType.CONNECTED: | 199 | case EventType.CONNECTED: |
202 | m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Connected"); | 200 | m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Connected"); |
203 | numbots++; | ||
204 | // m_log.InfoFormat("NUMBOTS {0}", numbots); | ||
205 | break; | 201 | break; |
206 | case EventType.DISCONNECTED: | 202 | case EventType.DISCONNECTED: |
207 | m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Disconnected"); | 203 | m_log.Info("[" + callbot.FirstName + " " + callbot.LastName + "]: Disconnected"); |
208 | numbots--; | 204 | |
209 | // m_log.InfoFormat("NUMBOTS {0}", numbots); | 205 | lock (m_lBot) |
210 | if (numbots <= 0) | 206 | { |
211 | Environment.Exit(0); | 207 | if (m_lBot.TrueForAll(b => !b.IsConnected)) |
212 | break; | 208 | Environment.Exit(0); |
209 | |||
210 | break; | ||
211 | } | ||
213 | } | 212 | } |
214 | } | 213 | } |
215 | 214 | ||
@@ -234,8 +233,11 @@ namespace pCampBot | |||
234 | 233 | ||
235 | private void HandleShutdown(string module, string[] cmd) | 234 | private void HandleShutdown(string module, string[] cmd) |
236 | { | 235 | { |
237 | m_log.Warn("[BOTMANAGER]: Shutting down bots"); | 236 | Util.FireAndForget(o => |
238 | doBotShutdown(); | 237 | { |
238 | m_log.Warn("[BOTMANAGER]: Shutting down bots"); | ||
239 | doBotShutdown(); | ||
240 | }); | ||
239 | } | 241 | } |
240 | 242 | ||
241 | private void HandleShowStatus(string module, string[] cmd) | 243 | private void HandleShowStatus(string module, string[] cmd) |