diff options
author | Justin Clark-Casey (justincc) | 2011-10-31 21:33:25 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-31 21:33:25 +0000 |
commit | e3f51df3c27c5bc74bc69789d18015c538220935 (patch) | |
tree | f9965d81a3ccf0410229c636c03311c7d763ded6 | |
parent | Plug a security hole in the inventory service (diff) | |
download | opensim-SC-e3f51df3c27c5bc74bc69789d18015c538220935.zip opensim-SC-e3f51df3c27c5bc74bc69789d18015c538220935.tar.gz opensim-SC-e3f51df3c27c5bc74bc69789d18015c538220935.tar.bz2 opensim-SC-e3f51df3c27c5bc74bc69789d18015c538220935.tar.xz |
Stop pCampbot from firing connected event twice, which results in double counting.
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 16 | ||||
-rw-r--r-- | OpenSim/Tools/pCampBot/PhysicsBot.cs | 5 |
2 files changed, 11 insertions, 10 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 614b350..c9d1446 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -81,16 +81,16 @@ namespace pCampBot | |||
81 | 81 | ||
82 | m_console.Commands.AddCommand("bot", false, "shutdown", | 82 | m_console.Commands.AddCommand("bot", false, "shutdown", |
83 | "shutdown", | 83 | "shutdown", |
84 | "Gracefully shut down bots", HandleShutdown); | 84 | "Shutdown bots and exit", HandleShutdown); |
85 | 85 | ||
86 | m_console.Commands.AddCommand("bot", false, "quit", | 86 | m_console.Commands.AddCommand("bot", false, "quit", |
87 | "quit", | 87 | "quit", |
88 | "Force quit (DANGEROUS, try shutdown first)", | 88 | "Shutdown bots and exit", |
89 | HandleShutdown); | 89 | HandleShutdown); |
90 | 90 | ||
91 | m_console.Commands.AddCommand("bot", false, "add bots", | 91 | // m_console.Commands.AddCommand("bot", false, "add bots", |
92 | "add bots <number>", | 92 | // "add bots <number>", |
93 | "Add more bots", HandleAddBots); | 93 | // "Add more bots", HandleAddBots); |
94 | 94 | ||
95 | m_lBot = new List<PhysicsBot>(); | 95 | m_lBot = new List<PhysicsBot>(); |
96 | } | 96 | } |
@@ -177,14 +177,14 @@ namespace pCampBot | |||
177 | switch (eventt) | 177 | switch (eventt) |
178 | { | 178 | { |
179 | case EventType.CONNECTED: | 179 | case EventType.CONNECTED: |
180 | m_log.Info("[ " + callbot.firstname + " " + callbot.lastname + "]: Connected"); | 180 | m_log.Info("[" + callbot.firstname + " " + callbot.lastname + "]: Connected"); |
181 | numbots++; | 181 | numbots++; |
182 | break; | 182 | break; |
183 | case EventType.DISCONNECTED: | 183 | case EventType.DISCONNECTED: |
184 | m_log.Info("[ " + callbot.firstname + " " + callbot.lastname + "]: Disconnected"); | 184 | m_log.Info("[" + callbot.firstname + " " + callbot.lastname + "]: Disconnected"); |
185 | m_td[m_lBot.IndexOf(callbot)].Abort(); | 185 | m_td[m_lBot.IndexOf(callbot)].Abort(); |
186 | numbots--; | 186 | numbots--; |
187 | if (numbots >1) | 187 | if (numbots <= 0) |
188 | Environment.Exit(0); | 188 | Environment.Exit(0); |
189 | break; | 189 | break; |
190 | } | 190 | } |
diff --git a/OpenSim/Tools/pCampBot/PhysicsBot.cs b/OpenSim/Tools/pCampBot/PhysicsBot.cs index 5d4af31..de54836 100644 --- a/OpenSim/Tools/pCampBot/PhysicsBot.cs +++ b/OpenSim/Tools/pCampBot/PhysicsBot.cs | |||
@@ -165,7 +165,7 @@ namespace pCampBot | |||
165 | m_action.AutoReset = false; | 165 | m_action.AutoReset = false; |
166 | m_action.Elapsed += new ElapsedEventHandler(m_action_Elapsed); | 166 | m_action.Elapsed += new ElapsedEventHandler(m_action_Elapsed); |
167 | m_action.Start(); | 167 | m_action.Start(); |
168 | OnConnected(this, EventType.CONNECTED); | 168 | // OnConnected(this, EventType.CONNECTED); |
169 | if (wear == "save") | 169 | if (wear == "save") |
170 | { | 170 | { |
171 | client.Appearance.SetPreviousAppearance(); | 171 | client.Appearance.SetPreviousAppearance(); |
@@ -384,6 +384,7 @@ namespace pCampBot | |||
384 | { | 384 | { |
385 | client.Assets.RequestImage(prim.Textures.DefaultTexture.TextureID, ImageType.Normal, Asset_TextureCallback_Texture); | 385 | client.Assets.RequestImage(prim.Textures.DefaultTexture.TextureID, ImageType.Normal, Asset_TextureCallback_Texture); |
386 | } | 386 | } |
387 | |||
387 | for (int i = 0; i < prim.Textures.FaceTextures.Length; i++) | 388 | for (int i = 0; i < prim.Textures.FaceTextures.Length; i++) |
388 | { | 389 | { |
389 | if (prim.Textures.FaceTextures[i] != null) | 390 | if (prim.Textures.FaceTextures[i] != null) |
@@ -392,10 +393,10 @@ namespace pCampBot | |||
392 | { | 393 | { |
393 | client.Assets.RequestImage(prim.Textures.FaceTextures[i].TextureID, ImageType.Normal, Asset_TextureCallback_Texture); | 394 | client.Assets.RequestImage(prim.Textures.FaceTextures[i].TextureID, ImageType.Normal, Asset_TextureCallback_Texture); |
394 | } | 395 | } |
395 | |||
396 | } | 396 | } |
397 | } | 397 | } |
398 | } | 398 | } |
399 | |||
399 | if (prim.Sculpt.SculptTexture != UUID.Zero) | 400 | if (prim.Sculpt.SculptTexture != UUID.Zero) |
400 | { | 401 | { |
401 | client.Assets.RequestImage(prim.Sculpt.SculptTexture, ImageType.Normal, Asset_TextureCallback_Texture); | 402 | client.Assets.RequestImage(prim.Sculpt.SculptTexture, ImageType.Normal, Asset_TextureCallback_Texture); |