aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/PhysicsBot.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tools/pCampBot/PhysicsBot.cs')
-rw-r--r--OpenSim/Tools/pCampBot/PhysicsBot.cs37
1 files changed, 20 insertions, 17 deletions
diff --git a/OpenSim/Tools/pCampBot/PhysicsBot.cs b/OpenSim/Tools/pCampBot/PhysicsBot.cs
index 5bcd35d..14e9cca 100644
--- a/OpenSim/Tools/pCampBot/PhysicsBot.cs
+++ b/OpenSim/Tools/pCampBot/PhysicsBot.cs
@@ -51,6 +51,11 @@ namespace pCampBot
51 public BotManager BotManager { get; private set; } 51 public BotManager BotManager { get; private set; }
52 private IConfig startupConfig; // bot config, passed from BotManager 52 private IConfig startupConfig; // bot config, passed from BotManager
53 53
54 /// <summary>
55 /// Is this bot connected to the grid?
56 /// </summary>
57 public bool IsConnected { get; private set; }
58
54 public string FirstName { get; private set; } 59 public string FirstName { get; private set; }
55 public string LastName { get; private set; } 60 public string LastName { get; private set; }
56 public string Name { get; private set; } 61 public string Name { get; private set; }
@@ -181,24 +186,23 @@ namespace pCampBot
181 186
182 if (client.Network.Login(FirstName, LastName, Password, "pCampBot", "Your name")) 187 if (client.Network.Login(FirstName, LastName, Password, "pCampBot", "Your name"))
183 { 188 {
184 if (OnConnected != null) 189 IsConnected = true;
185 { 190
186 Thread.Sleep(somthing.Next(1000, 10000)); 191 Thread.Sleep(somthing.Next(1000, 10000));
187 m_actionThread = new Thread(Action); 192 m_actionThread = new Thread(Action);
188 m_actionThread.Start(); 193 m_actionThread.Start();
189 194
190// OnConnected(this, EventType.CONNECTED); 195// OnConnected(this, EventType.CONNECTED);
191 if (wear == "save") 196 if (wear == "save")
192 { 197 {
193 client.Appearance.SetPreviousAppearance(); 198 client.Appearance.SetPreviousAppearance();
194 SaveDefaultAppearance(); 199 SaveDefaultAppearance();
195 }
196 else if (wear != "no")
197 {
198 MakeDefaultAppearance(wear);
199 }
200 client.Self.Jump(true);
201 } 200 }
201 else if (wear != "no")
202 {
203 MakeDefaultAppearance(wear);
204 }
205 client.Self.Jump(true);
202 } 206 }
203 else 207 else
204 { 208 {
@@ -392,8 +396,6 @@ namespace pCampBot
392 { 396 {
393// m_log.ErrorFormat("Fired Network_OnDisconnected"); 397// m_log.ErrorFormat("Fired Network_OnDisconnected");
394 398
395 // Only pass on the disconnect message when we receive a SimShutdown type shutdown. We have to ignore
396 // the earlier ClientInitiated shutdown callback.
397// if ( 399// if (
398// (args.Reason == NetworkManager.DisconnectType.SimShutdown 400// (args.Reason == NetworkManager.DisconnectType.SimShutdown
399// || args.Reason == NetworkManager.DisconnectType.NetworkTimeout) 401// || args.Reason == NetworkManager.DisconnectType.NetworkTimeout)
@@ -406,6 +408,7 @@ namespace pCampBot
406 && OnDisconnected != null) 408 && OnDisconnected != null)
407// if (OnDisconnected != null) 409// if (OnDisconnected != null)
408 { 410 {
411 IsConnected = false;
409 OnDisconnected(this, EventType.DISCONNECTED); 412 OnDisconnected(this, EventType.DISCONNECTED);
410 } 413 }
411 } 414 }