aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/pCampBot/PhysicsBot.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-07 04:53:42 +0000
committerJeff Ames2008-02-07 04:53:42 +0000
commit87e2dd7c809de5f1e9a8be1113ab39d3f647b1ca (patch)
tree33938eeb60f1e2f0f67d1f9d4f07b825313e36e8 /pCampBot/PhysicsBot.cs
parentUpdate version numbers to 0.5 (diff)
downloadopensim-SC-87e2dd7c809de5f1e9a8be1113ab39d3f647b1ca.zip
opensim-SC-87e2dd7c809de5f1e9a8be1113ab39d3f647b1ca.tar.gz
opensim-SC-87e2dd7c809de5f1e9a8be1113ab39d3f647b1ca.tar.bz2
opensim-SC-87e2dd7c809de5f1e9a8be1113ab39d3f647b1ca.tar.xz
Convert pCampBot to use log4net
Diffstat (limited to '')
-rw-r--r--pCampBot/PhysicsBot.cs25
1 files changed, 4 insertions, 21 deletions
diff --git a/pCampBot/PhysicsBot.cs b/pCampBot/PhysicsBot.cs
index 53a774a..500683a 100644
--- a/pCampBot/PhysicsBot.cs
+++ b/pCampBot/PhysicsBot.cs
@@ -38,8 +38,6 @@ using OpenSim.Framework;
38using OpenSim.Framework.Console; 38using OpenSim.Framework.Console;
39using Timer=System.Timers.Timer; 39using Timer=System.Timers.Timer;
40 40
41
42
43namespace pCampBot 41namespace pCampBot
44{ 42{
45 public class PhysicsBot 43 public class PhysicsBot
@@ -122,12 +120,12 @@ namespace pCampBot
122 { 120 {
123 client.Network.Logout(); 121 client.Network.Logout();
124 } 122 }
123
125 /// <summary> 124 /// <summary>
126 /// This is the bot startup loop. 125 /// This is the bot startup loop.
127 /// </summary> 126 /// </summary>
128 public void startup() 127 public void startup()
129 { 128 {
130
131 client.Settings.LOGIN_SERVER = loginURI; 129 client.Settings.LOGIN_SERVER = loginURI;
132 client.Network.OnConnected += new NetworkManager.ConnectedCallback(this.Network_OnConnected); 130 client.Network.OnConnected += new NetworkManager.ConnectedCallback(this.Network_OnConnected);
133 client.Network.OnSimConnected += new NetworkManager.SimConnectedCallback(this.Network_OnConnected); 131 client.Network.OnSimConnected += new NetworkManager.SimConnectedCallback(this.Network_OnConnected);
@@ -147,14 +145,12 @@ namespace pCampBot
147 } 145 }
148 else 146 else
149 { 147 {
150 148 MainConsole.Instance.Error(firstname + " " + lastname, "Can't login: " + client.Network.LoginMessage);
151 MainLog.Instance.Error(firstname + " " + lastname,"Can't Log in: " + client.Network.LoginMessage);
152 if (OnDisconnected != null) 149 if (OnDisconnected != null)
153 { 150 {
154 OnDisconnected(this, EventType.DISCONNECTED); 151 OnDisconnected(this, EventType.DISCONNECTED);
155 } 152 }
156 } 153 }
157
158 } 154 }
159 155
160 public void Network_OnConnected(object sender) 156 public void Network_OnConnected(object sender)
@@ -163,12 +159,10 @@ namespace pCampBot
163 { 159 {
164 OnConnected(this, EventType.CONNECTED); 160 OnConnected(this, EventType.CONNECTED);
165 } 161 }
166
167 } 162 }
163
168 public void Simulator_Connected(object sender) 164 public void Simulator_Connected(object sender)
169 { 165 {
170
171
172 } 166 }
173 167
174 public void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message) 168 public void Network_OnDisconnected(NetworkManager.DisconnectType reason, string message)
@@ -177,16 +171,11 @@ namespace pCampBot
177 { 171 {
178 OnDisconnected(this,EventType.DISCONNECTED); 172 OnDisconnected(this,EventType.DISCONNECTED);
179 } 173 }
180
181
182 } 174 }
175
183 public string[] readexcuses() 176 public string[] readexcuses()
184 { 177 {
185
186
187
188 string allexcuses = ""; 178 string allexcuses = "";
189
190 179
191 string file = Path.Combine(Util.configDir(), "excuses"); 180 string file = Path.Combine(Util.configDir(), "excuses");
192 if (File.Exists(file)) 181 if (File.Exists(file))
@@ -195,14 +184,8 @@ namespace pCampBot
195 allexcuses = csr.ReadToEnd(); 184 allexcuses = csr.ReadToEnd();
196 csr.Close(); 185 csr.Close();
197 } 186 }
198
199 187
200 return allexcuses.Split(Environment.NewLine.ToCharArray()); 188 return allexcuses.Split(Environment.NewLine.ToCharArray());
201
202 } 189 }
203
204
205 } 190 }
206
207
208} 191}