diff options
author | Jeff Ames | 2008-02-05 19:44:27 +0000 |
---|---|---|
committer | Jeff Ames | 2008-02-05 19:44:27 +0000 |
commit | 6ed5283bc06a62f38eb517e67b975832b603bf61 (patch) | |
tree | e5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Region/Environment/Modules | |
parent | Cut down on the number of packets sent during terraforming. Terraforming shou... (diff) | |
download | opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.zip opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2 opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz |
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O.
This is mostly an in-place conversion, so lots of refactoring can still be done.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
7 files changed, 77 insertions, 107 deletions
diff --git a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs index 81478a1..d51936b 100644 --- a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs +++ b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs | |||
@@ -41,8 +41,7 @@ namespace OpenSim.Region.Environment.Modules | |||
41 | { | 41 | { |
42 | public class BetaGridLikeMoneyModule: IRegionModule | 42 | public class BetaGridLikeMoneyModule: IRegionModule |
43 | { | 43 | { |
44 | 44 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
45 | private LogBase m_log; | ||
46 | 45 | ||
47 | private Dictionary<ulong,Scene> m_scenel = new Dictionary<ulong,Scene>(); | 46 | private Dictionary<ulong,Scene> m_scenel = new Dictionary<ulong,Scene>(); |
48 | 47 | ||
@@ -66,8 +65,6 @@ namespace OpenSim.Region.Environment.Modules | |||
66 | 65 | ||
67 | public void Initialise(Scene scene, IConfigSource config) | 66 | public void Initialise(Scene scene, IConfigSource config) |
68 | { | 67 | { |
69 | m_log = MainLog.Instance; | ||
70 | |||
71 | m_gConfig = config; | 68 | m_gConfig = config; |
72 | ReadConfigAndPopulate(); | 69 | ReadConfigAndPopulate(); |
73 | 70 | ||
@@ -160,11 +157,8 @@ namespace OpenSim.Region.Environment.Modules | |||
160 | } | 157 | } |
161 | else | 158 | else |
162 | { | 159 | { |
163 | MainLog.Instance.Warn("MONEY", "Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + e.sender.ToString() + " Reciver: " + e.reciever.ToString() + " Amount: " + e.amount.ToString()); | 160 | m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + e.sender.ToString() + " Reciver: " + e.reciever.ToString() + " Amount: " + e.amount.ToString()); |
164 | } | 161 | } |
165 | |||
166 | |||
167 | |||
168 | } | 162 | } |
169 | 163 | ||
170 | private bool doMoneyTranfer(LLUUID Sender, LLUUID Receiver, int amount) | 164 | private bool doMoneyTranfer(LLUUID Sender, LLUUID Receiver, int amount) |
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 749a923..82bd2ec 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs | |||
@@ -43,8 +43,9 @@ namespace OpenSim.Region.Environment.Modules | |||
43 | { | 43 | { |
44 | public class ChatModule : IRegionModule, ISimChat | 44 | public class ChatModule : IRegionModule, ISimChat |
45 | { | 45 | { |
46 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
46 | private List<Scene> m_scenes = new List<Scene>(); | 48 | private List<Scene> m_scenes = new List<Scene>(); |
47 | private LogBase m_log; | ||
48 | 49 | ||
49 | private int m_whisperdistance = 10; | 50 | private int m_whisperdistance = 10; |
50 | private int m_saydistance = 30; | 51 | private int m_saydistance = 30; |
@@ -59,11 +60,6 @@ namespace OpenSim.Region.Environment.Modules | |||
59 | internal object m_syncLogout = new object(); | 60 | internal object m_syncLogout = new object(); |
60 | private Thread m_irc_connector=null; | 61 | private Thread m_irc_connector=null; |
61 | 62 | ||
62 | public ChatModule() | ||
63 | { | ||
64 | m_log = MainLog.Instance; | ||
65 | } | ||
66 | |||
67 | public void Initialise(Scene scene, IConfigSource config) | 63 | public void Initialise(Scene scene, IConfigSource config) |
68 | { | 64 | { |
69 | lock (m_syncInit) | 65 | lock (m_syncInit) |
@@ -159,7 +155,7 @@ namespace OpenSim.Region.Environment.Modules | |||
159 | } | 155 | } |
160 | catch (Exception ex) | 156 | catch (Exception ex) |
161 | { | 157 | { |
162 | m_log.Error("IRC", "NewClient exception trap:" + ex.ToString()); | 158 | m_log.Error("[IRC]: NewClient exception trap:" + ex.ToString()); |
163 | } | 159 | } |
164 | } | 160 | } |
165 | 161 | ||
@@ -180,13 +176,13 @@ namespace OpenSim.Region.Environment.Modules | |||
180 | { | 176 | { |
181 | m_last_leaving_user = clientName; | 177 | m_last_leaving_user = clientName; |
182 | m_irc.PrivMsg(m_irc.Nick, "Sim", "notices " + clientName + " left " + clientRegion); | 178 | m_irc.PrivMsg(m_irc.Nick, "Sim", "notices " + clientName + " left " + clientRegion); |
183 | m_log.Verbose("IRC", "IRC watcher notices " + clientName + " left " + clientRegion); | 179 | m_log.Info("[IRC]: IRC watcher notices " + clientName + " left " + clientRegion); |
184 | } | 180 | } |
185 | } | 181 | } |
186 | } | 182 | } |
187 | catch (Exception ex) | 183 | catch (Exception ex) |
188 | { | 184 | { |
189 | m_log.Error("IRC", "ClientLoggedOut exception trap:" + ex.ToString()); | 185 | m_log.Error("[IRC]: ClientLoggedOut exception trap:" + ex.ToString()); |
190 | } | 186 | } |
191 | } | 187 | } |
192 | 188 | ||
@@ -319,6 +315,8 @@ namespace OpenSim.Region.Environment.Modules | |||
319 | 315 | ||
320 | internal class IRCChatModule | 316 | internal class IRCChatModule |
321 | { | 317 | { |
318 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
319 | |||
322 | private string m_server = null; | 320 | private string m_server = null; |
323 | private uint m_port = 6668; | 321 | private uint m_port = 6668; |
324 | private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; | 322 | private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot"; |
@@ -341,7 +339,6 @@ namespace OpenSim.Region.Environment.Modules | |||
341 | 339 | ||
342 | private List<Scene> m_scenes = null; | 340 | private List<Scene> m_scenes = null; |
343 | private List<Scene> m_last_scenes = null; | 341 | private List<Scene> m_last_scenes = null; |
344 | private LogBase m_log; | ||
345 | 342 | ||
346 | public IRCChatModule(IConfigSource config) | 343 | public IRCChatModule(IConfigSource config) |
347 | { | 344 | { |
@@ -388,9 +385,8 @@ namespace OpenSim.Region.Environment.Modules | |||
388 | } | 385 | } |
389 | catch (Exception) | 386 | catch (Exception) |
390 | { | 387 | { |
391 | MainLog.Instance.Verbose("CHAT", "No IRC config information, skipping IRC bridge configuration"); | 388 | m_log.Info("[CHAT]: No IRC config information, skipping IRC bridge configuration"); |
392 | } | 389 | } |
393 | m_log = MainLog.Instance; | ||
394 | } | 390 | } |
395 | 391 | ||
396 | public bool Connect(List<Scene> scenes) | 392 | public bool Connect(List<Scene> scenes) |
@@ -404,9 +400,9 @@ namespace OpenSim.Region.Environment.Modules | |||
404 | if (m_last_scenes == null) { m_last_scenes = scenes; } | 400 | if (m_last_scenes == null) { m_last_scenes = scenes; } |
405 | 401 | ||
406 | m_tcp = new TcpClient(m_server, (int)m_port); | 402 | m_tcp = new TcpClient(m_server, (int)m_port); |
407 | m_log.Verbose("IRC", "Connecting..."); | 403 | m_log.Info("[IRC]: Connecting..."); |
408 | m_stream = m_tcp.GetStream(); | 404 | m_stream = m_tcp.GetStream(); |
409 | m_log.Verbose("IRC", "Connected to " + m_server); | 405 | m_log.Info("[IRC]: Connected to " + m_server); |
410 | m_reader = new StreamReader(m_stream); | 406 | m_reader = new StreamReader(m_stream); |
411 | m_writer = new StreamWriter(m_stream); | 407 | m_writer = new StreamWriter(m_stream); |
412 | 408 | ||
@@ -422,7 +418,7 @@ namespace OpenSim.Region.Environment.Modules | |||
422 | m_writer.Flush(); | 418 | m_writer.Flush(); |
423 | m_writer.WriteLine("JOIN " + m_channel); | 419 | m_writer.WriteLine("JOIN " + m_channel); |
424 | m_writer.Flush(); | 420 | m_writer.Flush(); |
425 | m_log.Verbose("IRC", "Connection fully established"); | 421 | m_log.Info("[IRC]: Connection fully established"); |
426 | m_connected = true; | 422 | m_connected = true; |
427 | } | 423 | } |
428 | catch (Exception e) | 424 | catch (Exception e) |
@@ -475,16 +471,16 @@ namespace OpenSim.Region.Environment.Modules | |||
475 | m_writer.WriteLine(m_privmsgformat, m_channel, from, region, msg); | 471 | m_writer.WriteLine(m_privmsgformat, m_channel, from, region, msg); |
476 | } | 472 | } |
477 | m_writer.Flush(); | 473 | m_writer.Flush(); |
478 | m_log.Verbose("IRC", "PrivMsg " + from + " in " + region + " :" + msg); | 474 | m_log.Info("[IRC]: PrivMsg " + from + " in " + region + " :" + msg); |
479 | } | 475 | } |
480 | catch (IOException) | 476 | catch (IOException) |
481 | { | 477 | { |
482 | m_log.Error("IRC", "Disconnected from IRC server.(PrivMsg)"); | 478 | m_log.Error("[IRC]: Disconnected from IRC server.(PrivMsg)"); |
483 | Reconnect(); | 479 | Reconnect(); |
484 | } | 480 | } |
485 | catch (Exception ex) | 481 | catch (Exception ex) |
486 | { | 482 | { |
487 | m_log.Error("IRC", "PrivMsg exception trap:" + ex.ToString()); | 483 | m_log.Error("[IRC]: PrivMsg exception trap:" + ex.ToString()); |
488 | } | 484 | } |
489 | } | 485 | } |
490 | 486 | ||
@@ -493,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules | |||
493 | //examines IRC commands and extracts any private messages | 489 | //examines IRC commands and extracts any private messages |
494 | // which will then be reboadcast in the Sim | 490 | // which will then be reboadcast in the Sim |
495 | 491 | ||
496 | m_log.Verbose("IRC", "ExtractMsg: " + input); | 492 | m_log.Info("[IRC]: ExtractMsg: " + input); |
497 | Dictionary<string, string> result = null; | 493 | Dictionary<string, string> result = null; |
498 | //string regex = @":(?<nick>\w*)!~(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; | 494 | //string regex = @":(?<nick>\w*)!~(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; |
499 | string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; | 495 | string regex = @":(?<nick>\w*)!(?<user>\S*) PRIVMSG (?<channel>\S+) :(?<msg>.*)"; |
@@ -510,10 +506,10 @@ namespace OpenSim.Region.Environment.Modules | |||
510 | } | 506 | } |
511 | else | 507 | else |
512 | { | 508 | { |
513 | m_log.Verbose("IRC", "Number of matches: " + matches.Count); | 509 | m_log.Info("[IRC]: Number of matches: " + matches.Count); |
514 | if (matches.Count > 0) | 510 | if (matches.Count > 0) |
515 | { | 511 | { |
516 | m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count); | 512 | m_log.Info("[IRC]: Number of groups: " + matches[0].Groups.Count); |
517 | } | 513 | } |
518 | } | 514 | } |
519 | return result; | 515 | return result; |
@@ -536,12 +532,12 @@ namespace OpenSim.Region.Environment.Modules | |||
536 | } | 532 | } |
537 | catch (IOException) | 533 | catch (IOException) |
538 | { | 534 | { |
539 | m_log.Error("IRC", "Disconnected from IRC server.(PingRun)"); | 535 | m_log.Error("[IRC]: Disconnected from IRC server.(PingRun)"); |
540 | Reconnect(); | 536 | Reconnect(); |
541 | } | 537 | } |
542 | catch (Exception ex) | 538 | catch (Exception ex) |
543 | { | 539 | { |
544 | m_log.Error("IRC", "PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace); | 540 | m_log.Error("[IRC]: PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace); |
545 | } | 541 | } |
546 | } | 542 | } |
547 | } | 543 | } |
@@ -552,29 +548,29 @@ namespace OpenSim.Region.Environment.Modules | |||
552 | LLVector3 pos = new LLVector3(128, 128, 20); | 548 | LLVector3 pos = new LLVector3(128, 128, 20); |
553 | while (true) | 549 | while (true) |
554 | { | 550 | { |
555 | try | 551 | try |
556 | { | ||
557 | while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null)) | ||
558 | { | 552 | { |
553 | while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null)) | ||
554 | { | ||
559 | // Console.WriteLine(inputLine); | 555 | // Console.WriteLine(inputLine); |
560 | if (inputLine.Contains(m_channel)) | 556 | if (inputLine.Contains(m_channel)) |
561 | { | 557 | { |
562 | Dictionary<string, string> data = ExtractMsg(inputLine); | 558 | Dictionary<string, string> data = ExtractMsg(inputLine); |
563 | // Any chat ??? | 559 | // Any chat ??? |
564 | if (data != null) | 560 | if (data != null) |
565 | { | 561 | { |
566 | foreach (Scene m_scene in m_scenes) | 562 | foreach (Scene m_scene in m_scenes) |
567 | { | 563 | { |
568 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) | 564 | m_scene.ForEachScenePresence(delegate(ScenePresence avatar) |
565 | { | ||
566 | if (!avatar.IsChildAgent) | ||
569 | { | 567 | { |
570 | if (!avatar.IsChildAgent) | 568 | avatar.ControllingClient.SendChatMessage( |
571 | { | 569 | Helpers.StringToField(data["msg"]), 255, |
572 | avatar.ControllingClient.SendChatMessage( | 570 | pos, data["nick"], |
573 | Helpers.StringToField(data["msg"]), 255, | 571 | LLUUID.Zero); |
574 | pos, data["nick"], | 572 | } |
575 | LLUUID.Zero); | 573 | }); |
576 | } | ||
577 | }); | ||
578 | } | 574 | } |
579 | 575 | ||
580 | 576 | ||
@@ -584,24 +580,24 @@ namespace OpenSim.Region.Environment.Modules | |||
584 | // Was an command from the IRC server | 580 | // Was an command from the IRC server |
585 | ProcessIRCCommand(inputLine); | 581 | ProcessIRCCommand(inputLine); |
586 | } | 582 | } |
587 | } | 583 | } |
588 | else | 584 | else |
589 | { | 585 | { |
590 | // Was an command from the IRC server | 586 | // Was an command from the IRC server |
591 | ProcessIRCCommand(inputLine); | 587 | ProcessIRCCommand(inputLine); |
592 | } | 588 | } |
593 | Thread.Sleep(150); | 589 | Thread.Sleep(150); |
594 | } | ||
595 | } | ||
596 | catch (IOException) | ||
597 | { | ||
598 | m_log.Error("IRC", "ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)"); | ||
599 | Reconnect(); | ||
600 | } | ||
601 | catch (Exception ex) | ||
602 | { | ||
603 | m_log.Error("IRC", "ListenerRun exception trap:" + ex.ToString()+"\n"+ex.StackTrace); | ||
604 | } | 590 | } |
591 | } | ||
592 | catch (IOException) | ||
593 | { | ||
594 | m_log.Error("[IRC]: ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)"); | ||
595 | Reconnect(); | ||
596 | } | ||
597 | catch (Exception ex) | ||
598 | { | ||
599 | m_log.Error("[IRC]: ListenerRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace); | ||
600 | } | ||
605 | } | 601 | } |
606 | } | 602 | } |
607 | 603 | ||
@@ -626,27 +622,27 @@ namespace OpenSim.Region.Environment.Modules | |||
626 | } | 622 | } |
627 | catch (Exception ex) // IRC gate should not crash Sim | 623 | catch (Exception ex) // IRC gate should not crash Sim |
628 | { | 624 | { |
629 | m_log.Error("IRC", "BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace); | 625 | m_log.Error("[IRC]: BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace); |
630 | 626 | ||
631 | } | 627 | } |
632 | |||
633 | |||
634 | } | 628 | } |
629 | |||
635 | public enum ErrorReplies | 630 | public enum ErrorReplies |
636 | { | 631 | { |
637 | NotRegistered = 451, // ":You have not registered" | 632 | NotRegistered = 451, // ":You have not registered" |
638 | NicknameInUse = 433 // "<nick> :Nickname is already in use" | 633 | NicknameInUse = 433 // "<nick> :Nickname is already in use" |
639 | } | 634 | } |
635 | |||
640 | public enum Replies | 636 | public enum Replies |
641 | { | 637 | { |
642 | MotdStart = 375, // ":- <server> Message of the day - " | 638 | MotdStart = 375, // ":- <server> Message of the day - " |
643 | Motd = 372, // ":- <text>" | 639 | Motd = 372, // ":- <text>" |
644 | EndOfMotd = 376 // ":End of /MOTD command" | 640 | EndOfMotd = 376 // ":End of /MOTD command" |
645 | |||
646 | } | 641 | } |
642 | |||
647 | public void ProcessIRCCommand(string command) | 643 | public void ProcessIRCCommand(string command) |
648 | { | 644 | { |
649 | //m_log.Verbose("IRC", "ProcessIRCCommand:"+command); | 645 | //m_log.Info("[IRC]: ProcessIRCCommand:" + command); |
650 | 646 | ||
651 | string[] commArgs = new string[command.Split(' ').Length]; | 647 | string[] commArgs = new string[command.Split(' ').Length]; |
652 | string c_server = m_server; | 648 | string c_server = m_server; |
@@ -656,6 +652,7 @@ namespace OpenSim.Region.Environment.Modules | |||
656 | { | 652 | { |
657 | commArgs[0] = commArgs[0].Remove(0, 1); | 653 | commArgs[0] = commArgs[0].Remove(0, 1); |
658 | } | 654 | } |
655 | |||
659 | if (commArgs[1] == "002") | 656 | if (commArgs[1] == "002") |
660 | { | 657 | { |
661 | // fetch the correct servername | 658 | // fetch the correct servername |
@@ -668,7 +665,7 @@ namespace OpenSim.Region.Environment.Modules | |||
668 | 665 | ||
669 | if (commArgs[0] == "ERROR") | 666 | if (commArgs[0] == "ERROR") |
670 | { | 667 | { |
671 | m_log.Error("IRC", "IRC SERVER ERROR:" + command); | 668 | m_log.Error("[IRC]: IRC SERVER ERROR:" + command); |
672 | } | 669 | } |
673 | 670 | ||
674 | if (commArgs[0] == "PING") | 671 | if (commArgs[0] == "PING") |
@@ -695,7 +692,7 @@ namespace OpenSim.Region.Environment.Modules | |||
695 | case (int)ErrorReplies.NicknameInUse: | 692 | case (int)ErrorReplies.NicknameInUse: |
696 | // Gen a new name | 693 | // Gen a new name |
697 | m_nick = m_basenick + Util.RandomClass.Next(1, 99); | 694 | m_nick = m_basenick + Util.RandomClass.Next(1, 99); |
698 | m_log.Error("IRC", "IRC SERVER reports NicknameInUse, trying " + m_nick); | 695 | m_log.Error("[IRC]: IRC SERVER reports NicknameInUse, trying " + m_nick); |
699 | // Retry | 696 | // Retry |
700 | m_writer.WriteLine("NICK " + m_nick); | 697 | m_writer.WriteLine("NICK " + m_nick); |
701 | m_writer.Flush(); | 698 | m_writer.Flush(); |
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs index fec28a8..3c324a4 100644 --- a/OpenSim/Region/Environment/Modules/FriendsModule.cs +++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs | |||
@@ -40,8 +40,7 @@ namespace OpenSim.Region.Environment.Modules | |||
40 | { | 40 | { |
41 | public class FriendsModule : IRegionModule | 41 | public class FriendsModule : IRegionModule |
42 | { | 42 | { |
43 | 43 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
44 | private LogBase m_log; | ||
45 | 44 | ||
46 | private Scene m_scene; | 45 | private Scene m_scene; |
47 | 46 | ||
@@ -49,7 +48,6 @@ namespace OpenSim.Region.Environment.Modules | |||
49 | 48 | ||
50 | public void Initialise(Scene scene, IConfigSource config) | 49 | public void Initialise(Scene scene, IConfigSource config) |
51 | { | 50 | { |
52 | m_log = MainLog.Instance; | ||
53 | m_scene = scene; | 51 | m_scene = scene; |
54 | scene.EventManager.OnNewClient += OnNewClient; | 52 | scene.EventManager.OnNewClient += OnNewClient; |
55 | scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage; | 53 | scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage; |
@@ -72,6 +70,7 @@ namespace OpenSim.Region.Environment.Modules | |||
72 | 70 | ||
73 | 71 | ||
74 | } | 72 | } |
73 | |||
75 | private void OnInstantMessage(IClientAPI client,LLUUID fromAgentID, | 74 | private void OnInstantMessage(IClientAPI client,LLUUID fromAgentID, |
76 | LLUUID fromAgentSession, LLUUID toAgentID, | 75 | LLUUID fromAgentSession, LLUUID toAgentID, |
77 | LLUUID imSessionID, uint timestamp, string fromAgentName, | 76 | LLUUID imSessionID, uint timestamp, string fromAgentName, |
@@ -89,13 +88,13 @@ namespace OpenSim.Region.Environment.Modules | |||
89 | 88 | ||
90 | m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); | 89 | m_pendingFriendRequests.Add(friendTransactionID, fromAgentID); |
91 | 90 | ||
92 | m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); | 91 | m_log.Info("[FRIEND]: 38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); |
93 | GridInstantMessage msg = new GridInstantMessage(); | 92 | GridInstantMessage msg = new GridInstantMessage(); |
94 | msg.fromAgentID = fromAgentID.UUID; | 93 | msg.fromAgentID = fromAgentID.UUID; |
95 | msg.fromAgentSession = fromAgentSession.UUID; | 94 | msg.fromAgentSession = fromAgentSession.UUID; |
96 | msg.toAgentID = toAgentID.UUID; | 95 | msg.toAgentID = toAgentID.UUID; |
97 | msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here | 96 | msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here |
98 | m_log.Verbose("FRIEND","Filling Session: " + msg.imSessionID.ToString()); | 97 | m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID.ToString()); |
99 | msg.timestamp = timestamp; | 98 | msg.timestamp = timestamp; |
100 | if (client != null) | 99 | if (client != null) |
101 | { | 100 | { |
@@ -115,20 +114,18 @@ namespace OpenSim.Region.Environment.Modules | |||
115 | msg.binaryBucket = binaryBucket; | 114 | msg.binaryBucket = binaryBucket; |
116 | m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); | 115 | m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); |
117 | } | 116 | } |
117 | |||
118 | // 39 == Accept Friendship | ||
118 | if (dialog == (byte)39) | 119 | if (dialog == (byte)39) |
119 | { | 120 | { |
120 | m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); | 121 | m_log.Info("[FRIEND]: 39 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); |
121 | |||
122 | } | 122 | } |
123 | |||
124 | // 40 == Decline Friendship | ||
123 | if (dialog == (byte)40) | 125 | if (dialog == (byte)40) |
124 | { | 126 | { |
125 | m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); | 127 | m_log.Info("[FRIEND]: 40 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message); |
126 | } | 128 | } |
127 | |||
128 | // 39 == Accept Friendship | ||
129 | |||
130 | // 40 == Decline Friendship | ||
131 | |||
132 | } | 129 | } |
133 | 130 | ||
134 | private void OnApprovedFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders) | 131 | private void OnApprovedFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders) |
@@ -160,6 +157,7 @@ namespace OpenSim.Region.Environment.Modules | |||
160 | // TODO: Inform agent that the friend is online | 157 | // TODO: Inform agent that the friend is online |
161 | } | 158 | } |
162 | } | 159 | } |
160 | |||
163 | private void OnDenyFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders) | 161 | private void OnDenyFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List<LLUUID> callingCardFolders) |
164 | { | 162 | { |
165 | if (m_pendingFriendRequests.ContainsKey(transactionID)) | 163 | if (m_pendingFriendRequests.ContainsKey(transactionID)) |
@@ -184,20 +182,15 @@ namespace OpenSim.Region.Environment.Modules | |||
184 | msg.binaryBucket = new byte[0]; | 182 | msg.binaryBucket = new byte[0]; |
185 | m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); | 183 | m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); |
186 | m_pendingFriendRequests.Remove(transactionID); | 184 | m_pendingFriendRequests.Remove(transactionID); |
187 | |||
188 | } | 185 | } |
189 | |||
190 | |||
191 | } | 186 | } |
192 | 187 | ||
193 | private void OnTerminateFriendship(IClientAPI client, LLUUID agent, LLUUID exfriendID) | 188 | private void OnTerminateFriendship(IClientAPI client, LLUUID agent, LLUUID exfriendID) |
194 | { | 189 | { |
195 | m_scene.StoreRemoveFriendship(agent, exfriendID); | 190 | m_scene.StoreRemoveFriendship(agent, exfriendID); |
196 | // TODO: Inform the client that the ExFriend is offline | 191 | // TODO: Inform the client that the ExFriend is offline |
197 | |||
198 | } | 192 | } |
199 | 193 | ||
200 | |||
201 | private void OnGridInstantMessage(GridInstantMessage msg) | 194 | private void OnGridInstantMessage(GridInstantMessage msg) |
202 | { | 195 | { |
203 | // Trigger the above event handler | 196 | // Trigger the above event handler |
@@ -206,16 +199,12 @@ namespace OpenSim.Region.Environment.Modules | |||
206 | msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, | 199 | msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID, |
207 | new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), | 200 | new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), |
208 | msg.binaryBucket); | 201 | msg.binaryBucket); |
209 | |||
210 | } | 202 | } |
211 | 203 | ||
212 | |||
213 | public void PostInitialise() | 204 | public void PostInitialise() |
214 | { | 205 | { |
215 | } | 206 | } |
216 | 207 | ||
217 | |||
218 | |||
219 | public void Close() | 208 | public void Close() |
220 | { | 209 | { |
221 | } | 210 | } |
@@ -230,4 +219,4 @@ namespace OpenSim.Region.Environment.Modules | |||
230 | get { return false; } | 219 | get { return false; } |
231 | } | 220 | } |
232 | } | 221 | } |
233 | } \ No newline at end of file | 222 | } |
diff --git a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs index f5eb052..e0b3138 100644 --- a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs +++ b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs | |||
@@ -39,12 +39,6 @@ namespace OpenSim.Region.Environment.Modules | |||
39 | public class InstantMessageModule : IRegionModule | 39 | public class InstantMessageModule : IRegionModule |
40 | { | 40 | { |
41 | private List<Scene> m_scenes = new List<Scene>(); | 41 | private List<Scene> m_scenes = new List<Scene>(); |
42 | private LogBase m_log; | ||
43 | |||
44 | public InstantMessageModule() | ||
45 | { | ||
46 | m_log = MainLog.Instance; | ||
47 | } | ||
48 | 42 | ||
49 | public void Initialise(Scene scene, IConfigSource config) | 43 | public void Initialise(Scene scene, IConfigSource config) |
50 | { | 44 | { |
@@ -68,7 +62,6 @@ namespace OpenSim.Region.Environment.Modules | |||
68 | uint ParentEstateID, LLVector3 Position, LLUUID RegionID, | 62 | uint ParentEstateID, LLVector3 Position, LLUUID RegionID, |
69 | byte[] binaryBucket) | 63 | byte[] binaryBucket) |
70 | { | 64 | { |
71 | |||
72 | bool FriendDialog = ((dialog == (byte)38) || (dialog == (byte)39) || (dialog == (byte)40)); | 65 | bool FriendDialog = ((dialog == (byte)38) || (dialog == (byte)39) || (dialog == (byte)40)); |
73 | 66 | ||
74 | // IM dialogs need to be pre-processed and have their sessionID filled by the server | 67 | // IM dialogs need to be pre-processed and have their sessionID filled by the server |
diff --git a/OpenSim/Region/Environment/Modules/SunModule.cs b/OpenSim/Region/Environment/Modules/SunModule.cs index bd6cd63..d2572c0 100644 --- a/OpenSim/Region/Environment/Modules/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/SunModule.cs | |||
@@ -39,6 +39,8 @@ namespace OpenSim.Region.Environment.Modules | |||
39 | { | 39 | { |
40 | public class SunModule : IRegionModule | 40 | public class SunModule : IRegionModule |
41 | { | 41 | { |
42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
42 | private const double m_real_day = 24.0; | 44 | private const double m_real_day = 24.0; |
43 | private const int m_default_frame = 100; | 45 | private const int m_default_frame = 100; |
44 | private int m_frame_mod; | 46 | private int m_frame_mod; |
@@ -48,7 +50,6 @@ namespace OpenSim.Region.Environment.Modules | |||
48 | private long m_start; | 50 | private long m_start; |
49 | 51 | ||
50 | private Scene m_scene; | 52 | private Scene m_scene; |
51 | private LogBase m_log; | ||
52 | 53 | ||
53 | public void Initialise(Scene scene, IConfigSource config) | 54 | public void Initialise(Scene scene, IConfigSource config) |
54 | { | 55 | { |
@@ -69,7 +70,6 @@ namespace OpenSim.Region.Environment.Modules | |||
69 | 70 | ||
70 | m_dilation = (int) (m_real_day/m_day_length); | 71 | m_dilation = (int) (m_real_day/m_day_length); |
71 | m_scene = scene; | 72 | m_scene = scene; |
72 | m_log = MainLog.Instance; | ||
73 | scene.EventManager.OnFrame += SunUpdate; | 73 | scene.EventManager.OnFrame += SunUpdate; |
74 | scene.EventManager.OnNewClient += SunToClient; | 74 | scene.EventManager.OnNewClient += SunToClient; |
75 | } | 75 | } |
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Modules | |||
104 | m_frame++; | 104 | m_frame++; |
105 | return; | 105 | return; |
106 | } | 106 | } |
107 | // m_log.Verbose("SUN","I've got an update {0} => {1}", m_scene.RegionsInfo.RegionName, HourOfTheDay()); | 107 | // m_log.Info("[SUN]: I've got an update {0} => {1}", m_scene.RegionsInfo.RegionName, HourOfTheDay()); |
108 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 108 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
109 | foreach (ScenePresence avatar in avatars) | 109 | foreach (ScenePresence avatar in avatars) |
110 | { | 110 | { |
@@ -191,4 +191,4 @@ namespace OpenSim.Region.Environment.Modules | |||
191 | // // OutPacket(viewertime); | 191 | // // OutPacket(viewertime); |
192 | // } | 192 | // } |
193 | } | 193 | } |
194 | } \ No newline at end of file | 194 | } |
diff --git a/OpenSim/Region/Environment/Modules/TextureSender.cs b/OpenSim/Region/Environment/Modules/TextureSender.cs index a533078..053a558 100644 --- a/OpenSim/Region/Environment/Modules/TextureSender.cs +++ b/OpenSim/Region/Environment/Modules/TextureSender.cs | |||
@@ -36,6 +36,8 @@ namespace OpenSim.Region.Environment.Modules | |||
36 | { | 36 | { |
37 | public class TextureSender | 37 | public class TextureSender |
38 | { | 38 | { |
39 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
40 | |||
39 | public int counter = 0; | 41 | public int counter = 0; |
40 | private AssetBase m_asset; | 42 | private AssetBase m_asset; |
41 | public long DataPointer = 0; | 43 | public long DataPointer = 0; |
@@ -135,9 +137,8 @@ namespace OpenSim.Region.Environment.Modules | |||
135 | } | 137 | } |
136 | catch (ArgumentOutOfRangeException) | 138 | catch (ArgumentOutOfRangeException) |
137 | { | 139 | { |
138 | MainLog.Instance.Error("TEXTURE", | 140 | m_log.Error("[TEXTURE]: Unable to separate texture into multiple packets: Array bounds failure on asset:" + |
139 | "Unable to separate texture into multiple packets: Array bounds failure on asset:" + | 141 | m_asset.FullID.ToString() ); |
140 | m_asset.FullID.ToString() ); | ||
141 | return; | 142 | return; |
142 | } | 143 | } |
143 | RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); | 144 | RequestUser.OutPacket(im, ThrottleOutPacketType.Texture); |
diff --git a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs index 76c6a53..762e76d 100644 --- a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs | |||
@@ -75,6 +75,8 @@ namespace OpenSim.Region.Environment.Modules | |||
75 | { | 75 | { |
76 | public class XMLRPCModule : IRegionModule, IXMLRPC | 76 | public class XMLRPCModule : IRegionModule, IXMLRPC |
77 | { | 77 | { |
78 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
79 | |||
78 | private Scene m_scene; | 80 | private Scene m_scene; |
79 | private Queue<RPCRequestInfo> rpcQueue = new Queue<RPCRequestInfo>(); | 81 | private Queue<RPCRequestInfo> rpcQueue = new Queue<RPCRequestInfo>(); |
80 | private object XMLRPCListLock = new object(); | 82 | private object XMLRPCListLock = new object(); |
@@ -83,7 +85,6 @@ namespace OpenSim.Region.Environment.Modules | |||
83 | private int RemoteReplyScriptTimeout = 900; | 85 | private int RemoteReplyScriptTimeout = 900; |
84 | private int m_remoteDataPort = 0; | 86 | private int m_remoteDataPort = 0; |
85 | private List<Scene> m_scenes = new List<Scene>(); | 87 | private List<Scene> m_scenes = new List<Scene>(); |
86 | private LogBase m_log; | ||
87 | 88 | ||
88 | // <channel id, RPCChannelInfo> | 89 | // <channel id, RPCChannelInfo> |
89 | private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; | 90 | private Dictionary<LLUUID, RPCChannelInfo> m_openChannels; |
@@ -91,11 +92,6 @@ namespace OpenSim.Region.Environment.Modules | |||
91 | // <channel id, RPCRequestInfo> | 92 | // <channel id, RPCRequestInfo> |
92 | private Dictionary<LLUUID, RPCRequestInfo> m_pendingResponse; | 93 | private Dictionary<LLUUID, RPCRequestInfo> m_pendingResponse; |
93 | 94 | ||
94 | public XMLRPCModule() | ||
95 | { | ||
96 | m_log = MainLog.Instance; | ||
97 | } | ||
98 | |||
99 | public void Initialise(Scene scene, IConfigSource config) | 95 | public void Initialise(Scene scene, IConfigSource config) |
100 | { | 96 | { |
101 | try | 97 | try |
@@ -123,8 +119,8 @@ namespace OpenSim.Region.Environment.Modules | |||
123 | 119 | ||
124 | // Start http server | 120 | // Start http server |
125 | // Attach xmlrpc handlers | 121 | // Attach xmlrpc handlers |
126 | m_log.Verbose("REMOTE_DATA", | 122 | m_log.Info("[REMOTE_DATA]: " + |
127 | "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); | 123 | "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); |
128 | BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); | 124 | BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); |
129 | httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); | 125 | httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); |
130 | httpServer.Start(); | 126 | httpServer.Start(); |
@@ -413,4 +409,4 @@ namespace OpenSim.Region.Environment.Modules | |||
413 | return m_localID; | 409 | return m_localID; |
414 | } | 410 | } |
415 | } | 411 | } |
416 | } \ No newline at end of file | 412 | } |