* Removed MainConsole.Instance.WriteLine completely

* Now exists MainConsole.Instance.Error/Warn/Notice/Verbose -- use those instead
* Removed some instances of System.Console use - aiming to depreciate this in favour of MainConsole completely.
zircon^2
Adam Frisby 2007-06-05 12:55:12 +00:00
parent 891b92a780
commit 1e716260c8
27 changed files with 221 additions and 194 deletions

View File

@ -41,29 +41,49 @@ namespace OpenSim.Framework.Console
public void Write(string format, params object[] args) public void Write(string format, params object[] args)
{ {
WriteLine(LogPriority.NORMAL,format,args); Notice(format,args);
return; return;
} }
[Obsolete("WriteLine(msg,args) has been depreciated, use WriteLine(priority,msg,args) instead.")] public void Warn(string format, params object[] args)
public void WriteLine(string format, params object[] args)
{ {
Log.WriteLine(format, args); WriteNewLine(ConsoleColor.Yellow, format, args);
Log.Flush();
if(!m_silent)
{
System.Console.WriteLine(format, args);
}
return; return;
} }
public void WriteLine(LogPriority importance, string format, params object[] args) public void Notice(string format, params object[] args)
{
WriteNewLine(ConsoleColor.White, format, args);
return;
}
public void Error(string format, params object[] args)
{
WriteNewLine(ConsoleColor.Red, format, args);
return;
}
public void Verbose(string format, params object[] args)
{
WriteNewLine(ConsoleColor.Gray, format, args);
return;
}
public void Status(string format, params object[] args)
{
WriteNewLine(ConsoleColor.Blue, format, args);
return;
}
private void WriteNewLine(System.ConsoleColor color, string format, params object[] args)
{ {
Log.WriteLine(format, args); Log.WriteLine(format, args);
Log.Flush(); Log.Flush();
if (!m_silent) if (!m_silent)
{ {
System.Console.ForegroundColor = color;
System.Console.WriteLine(format, args); System.Console.WriteLine(format, args);
System.Console.ResetColor();
} }
return; return;
} }
@ -130,7 +150,7 @@ namespace OpenSim.Framework.Console
} }
else else
{ {
this.WriteLine(LogPriority.MEDIUM,"Valid options are " + OptionA + " or " + OptionB); Notice("Valid options are " + OptionA + " or " + OptionB);
temp = CmdPrompt(prompt, defaultresponse); temp = CmdPrompt(prompt, defaultresponse);
} }
} }

View File

@ -223,7 +223,7 @@ namespace OpenSim.Servers
public void Start() public void Start()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: Starting up HTTP Server"); MainConsole.Instance.Verbose("BaseHttpServer.cs: Starting up HTTP Server");
m_workerThread = new Thread(new ThreadStart(StartHTTP)); m_workerThread = new Thread(new ThreadStart(StartHTTP));
m_workerThread.IsBackground = true; m_workerThread.IsBackground = true;
@ -234,7 +234,7 @@ namespace OpenSim.Servers
{ {
try try
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW, "BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); MainConsole.Instance.Verbose("BaseHttpServer.cs: StartHTTP() - Spawned main thread OK");
m_httpListener = new HttpListener(); m_httpListener = new HttpListener();
m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
@ -249,7 +249,7 @@ namespace OpenSim.Servers
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM, e.Message); MainConsole.Instance.Warn(e.Message);
} }
} }
} }

View File

@ -100,8 +100,7 @@ namespace OpenSim.Servers
} }
catch (Exception) catch (Exception)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection "); MainConsole.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection ");
} }
} }

View File

@ -210,8 +210,7 @@ namespace OpenSim.UserServer
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine( OpenSim.Framework.Console.MainConsole.Instance.Warn(
OpenSim.Framework.Console.LogPriority.LOW,
"LoginResponse: Unable to set default values: " + e.Message "LoginResponse: Unable to set default values: " + e.Message
); );
} }
@ -326,8 +325,7 @@ namespace OpenSim.UserServer
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine( OpenSim.Framework.Console.MainConsole.Instance.Error(
OpenSim.Framework.Console.LogPriority.LOW,
"LoginResponse: Error creating XML-RPC Response: " + e.Message "LoginResponse: Error creating XML-RPC Response: " + e.Message
); );
return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); return (this.GenerateFailureResponse("Internal Error", "Error generating Login Response", "false"));

View File

@ -39,17 +39,17 @@ namespace OpenSim.GridInterfaces.Local
this._assetRequests = new BlockingQueue<ARequest>(); this._assetRequests = new BlockingQueue<ARequest>();
yapfile = System.IO.File.Exists("assets.yap"); yapfile = System.IO.File.Exists("assets.yap");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Local Asset Server class created"); MainConsole.Instance.Verbose("Local Asset Server class created");
try try
{ {
db = Db4oFactory.OpenFile("assets.yap"); db = Db4oFactory.OpenFile("assets.yap");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Db4 Asset database creation"); MainConsole.Instance.Verbose("Db4 Asset database creation");
} }
catch (Exception e) catch (Exception e)
{ {
db.Close(); db.Close();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,"Db4 Asset server :Constructor - Exception occured"); MainConsole.Instance.Warn("Db4 Asset server :Constructor - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, e.ToString()); MainConsole.Instance.Warn(e.ToString());
} }
if (!yapfile) if (!yapfile)
{ {
@ -97,7 +97,7 @@ namespace OpenSim.GridInterfaces.Local
{ {
if (db != null) if (db != null)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "Closing local asset server database"); MainConsole.Instance.Verbose( "Closing local asset server database");
db.Close(); db.Close();
} }
} }
@ -141,7 +141,7 @@ namespace OpenSim.GridInterfaces.Local
try try
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "Setting up asset database"); MainConsole.Instance.Verbose( "Setting up asset database");
AssetBase Image = new AssetBase(); AssetBase Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001"); Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001");

View File

@ -62,7 +62,7 @@ namespace OpenSim.GridInterfaces.Local
public LocalGridServer() public LocalGridServer()
{ {
Sessions = new List<Login>(); Sessions = new List<Login>();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Local Grid Server class created"); MainConsole.Instance.Verbose("Local Grid Server class created");
} }
public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port) public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port)

View File

@ -26,7 +26,7 @@ namespace OpenSim.GridInterfaces.Remote
this._remoteAssetServerThread = new Thread(new ThreadStart(RunRequests)); this._remoteAssetServerThread = new Thread(new ThreadStart(RunRequests));
this._remoteAssetServerThread.IsBackground = true; this._remoteAssetServerThread.IsBackground = true;
this._remoteAssetServerThread.Start(); this._remoteAssetServerThread.Start();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Remote Asset Server class created"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Remote Asset Server class created");
} }
public void SetReceiver(IAssetReceiver receiver) public void SetReceiver(IAssetReceiver receiver)
@ -71,7 +71,7 @@ namespace OpenSim.GridInterfaces.Remote
// 404... THE MAGIC FILE NOT FOUND ERROR, very useful for telling you things such as a file (or asset ;) ) not being found!!!!!!!!!!! it's 2:22AM // 404... THE MAGIC FILE NOT FOUND ERROR, very useful for telling you things such as a file (or asset ;) ) not being found!!!!!!!!!!! it's 2:22AM
ARequest req = this._assetRequests.Dequeue(); ARequest req = this._assetRequests.Dequeue();
LLUUID assetID = req.AssetID; LLUUID assetID = req.AssetID;
// OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW," RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID); // OpenSim.Framework.Console.MainConsole.Instance.Verbose(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "assets/" + assetID);
WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID); WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "assets/" + assetID);
WebResponse AssetResponse = AssetLoad.GetResponse(); WebResponse AssetResponse = AssetLoad.GetResponse();
byte[] idata = new byte[(int)AssetResponse.ContentLength]; byte[] idata = new byte[(int)AssetResponse.ContentLength];

View File

@ -35,6 +35,7 @@ using libsecondlife;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework.Console;
namespace OpenSim.GridInterfaces.Remote namespace OpenSim.GridInterfaces.Remote
{ {
@ -68,7 +69,7 @@ namespace OpenSim.GridInterfaces.Remote
public RemoteGridServer() public RemoteGridServer()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Remote Grid Server class created"); MainConsole.Instance.Notice("Remote Grid Server class created");
} }
public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port) public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port)
@ -89,8 +90,8 @@ namespace OpenSim.GridInterfaces.Remote
if (GridRespData.ContainsKey("error")) if (GridRespData.ContainsKey("error"))
{ {
string errorstring = (string)GridRespData["error"]; string errorstring = (string)GridRespData["error"];
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Error connecting to grid:"); MainConsole.Instance.Warn("Error connecting to grid:");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, errorstring); MainConsole.Instance.Warn(errorstring);
return false; return false;
} }
this.neighbours = (ArrayList)GridRespData["neighbours"]; this.neighbours = (ArrayList)GridRespData["neighbours"];

View File

@ -55,12 +55,12 @@ namespace OpenSim.Physics.Manager
if(_plugins.ContainsKey(engineName)) if(_plugins.ContainsKey(engineName))
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"creating "+engineName); MainConsole.Instance.Notice("creating "+engineName);
return _plugins[engineName].GetScene(); return _plugins[engineName].GetScene();
} }
else else
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,"couldn't find physicsEngine: {0}",engineName); MainConsole.Instance.Warn("couldn't find physicsEngine: {0}",engineName);
throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}",engineName)); throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}",engineName));
} }
} }

View File

@ -68,7 +68,7 @@ namespace OpenSim.Physics.Manager
public override PhysicsActor AddAvatar(PhysicsVector position) public override PhysicsActor AddAvatar(PhysicsVector position)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"NullPhysicsScene : AddAvatar({0})", position); MainConsole.Instance.Verbose("NullPhysicsScene : AddAvatar({0})", position);
return PhysicsActor.Null; return PhysicsActor.Null;
} }
@ -79,7 +79,7 @@ namespace OpenSim.Physics.Manager
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : AddPrim({0},{1})", position, size); MainConsole.Instance.Verbose( "NullPhysicsScene : AddPrim({0},{1})", position, size);
return PhysicsActor.Null; return PhysicsActor.Null;
} }
@ -92,12 +92,12 @@ namespace OpenSim.Physics.Manager
public override void GetResults() public override void GetResults()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : GetResults()"); MainConsole.Instance.Verbose( "NullPhysicsScene : GetResults()");
} }
public override void SetTerrain(float[] heightMap) public override void SetTerrain(float[] heightMap)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : SetTerrain({0} items)", heightMap.Length); MainConsole.Instance.Verbose( "NullPhysicsScene : SetTerrain({0} items)", heightMap.Length);
} }
public override void DeleteTerrain() public override void DeleteTerrain()

View File

@ -34,6 +34,7 @@ using OpenSim;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework.Utilities; using OpenSim.Framework.Utilities;
using OpenSim.Framework.Console;
namespace OpenSim.Assets namespace OpenSim.Assets
{ {
@ -60,7 +61,7 @@ namespace OpenSim.Assets
/// </summary> /// </summary>
public AssetCache(IAssetServer assetServer) public AssetCache(IAssetServer assetServer)
{ {
Console.WriteLine("Creating Asset cache"); MainConsole.Instance.Verbose("Creating Asset cache");
_assetServer = assetServer; _assetServer = assetServer;
_assetServer.SetReceiver(this); _assetServer.SetReceiver(this);
Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo>(); Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo>();
@ -86,7 +87,7 @@ namespace OpenSim.Assets
} }
catch (Exception e) catch (Exception e)
{ {
Console.WriteLine(e.Message); MainConsole.Instance.Error(e.Message);
} }
} }
} }

View File

@ -15,6 +15,7 @@ using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities; using OpenSim.Framework.Utilities;
using OpenSim.world; using OpenSim.world;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.Framework.Console;
namespace OpenSim namespace OpenSim
{ {
@ -42,7 +43,7 @@ namespace OpenSim
ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]); ushort neighbourPort = (ushort)Convert.ToInt32(neighbour["sim_port"]);
string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString(); string reqUrl = "http://" + neighbourIPStr + ":" + neighbourPort.ToString();
Console.WriteLine(reqUrl); MainConsole.Instance.Verbose("Requesting " + reqUrl);
SimParams = new Hashtable(); SimParams = new Hashtable();
SimParams["session_id"] = this.SessionID.ToString(); SimParams["session_id"] = this.SessionID.ToString();
@ -72,7 +73,7 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing."); MainConsole.Instance.Notice("Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing.");
} }
} }
Thread.Sleep(3000); Thread.Sleep(3000);
@ -112,7 +113,7 @@ namespace OpenSim
neighboury += 1; neighboury += 1;
newpos.Y = 1; newpos.Y = 1;
} }
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:CrossSimBorder() - Crossing border to neighbouring sim at [" + neighbourx.ToString() + "," + neighboury.ToString() + "]"); MainConsole.Instance.Notice("SimClient.cs:CrossSimBorder() - Crossing border to neighbouring sim at [" + neighbourx.ToString() + "," + neighboury.ToString() + "]");
Hashtable SimParams; Hashtable SimParams;
ArrayList SendParams; ArrayList SendParams;

View File

@ -15,6 +15,7 @@ using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities; using OpenSim.Framework.Utilities;
using OpenSim.world; using OpenSim.world;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.Framework.Console;
namespace OpenSim namespace OpenSim
{ {
@ -29,7 +30,7 @@ namespace OpenSim
protected virtual bool Logout(ClientView simClient, Packet packet) protected virtual bool Logout(ClientView simClient, Packet packet)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ProcessInPacket() - Got a logout request"); MainConsole.Instance.Notice("OpenSimClient.cs:ProcessInPacket() - Got a logout request");
//send reply to let the client logout //send reply to let the client logout
LogoutReplyPacket logReply = new LogoutReplyPacket(); LogoutReplyPacket logReply = new LogoutReplyPacket();
logReply.AgentData.AgentID = this.AgentID; logReply.AgentData.AgentID = this.AgentID;

View File

@ -16,6 +16,7 @@ using OpenSim.Framework.Utilities;
using OpenSim.world; using OpenSim.world;
using OpenSim.RegionServer.world; using OpenSim.RegionServer.world;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.Framework.Console;
namespace OpenSim namespace OpenSim
{ {
@ -464,7 +465,7 @@ namespace OpenSim
outgoing.MoneyData.TransactionSuccess = true; outgoing.MoneyData.TransactionSuccess = true;
outgoing.MoneyData.Description = libsecondlife.Helpers.StringToField(""); outgoing.MoneyData.Description = libsecondlife.Helpers.StringToField("");
this.OutPacket((Packet)outgoing); this.OutPacket((Packet)outgoing);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Sent Temporary Money packet (they have leet monies)"); MainConsole.Instance.Notice("Sent Temporary Money packet (they have leet monies)");
break; break;
@ -477,7 +478,7 @@ namespace OpenSim
estateCovenantReply.Data.CovenantID = LLUUID.Zero; estateCovenantReply.Data.CovenantID = LLUUID.Zero;
estateCovenantReply.Data.CovenantTimestamp = (uint)0; estateCovenantReply.Data.CovenantTimestamp = (uint)0;
this.OutPacket((Packet)estateCovenantReply); this.OutPacket((Packet)estateCovenantReply);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Sent Temporary Estate packet (they are in leet estate)"); MainConsole.Instance.Notice("Sent Temporary Estate packet (they are in leet estate)");
break; break;
#endregion #endregion
} }

View File

@ -41,6 +41,7 @@ using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities; using OpenSim.Framework.Utilities;
using OpenSim.world; using OpenSim.world;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.Framework.Console;
namespace OpenSim namespace OpenSim
{ {
@ -110,7 +111,7 @@ namespace OpenSim
m_child = child; m_child = child;
m_regionData = regionDat; m_regionData = regionDat;
m_authenticateSessionsHandler = authenSessions; m_authenticateSessionsHandler = authenSessions;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request"); MainConsole.Instance.Notice("OpenSimClient.cs - Started up new client thread to handle incoming request");
cirpack = initialcirpack; cirpack = initialcirpack;
userEP = remoteEP; userEP = remoteEP;
@ -150,7 +151,7 @@ namespace OpenSim
# region Client Methods # region Client Methods
public void UpgradeClient() public void UpgradeClient()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent"); MainConsole.Instance.Notice("SimClient.cs:UpgradeClient() - upgrading child to full agent");
this.m_child = false; this.m_child = false;
//this.m_world.RemoveViewerAgent(this); //this.m_world.RemoveViewerAgent(this);
if (!this.m_sandboxMode) if (!this.m_sandboxMode)
@ -164,7 +165,7 @@ namespace OpenSim
public void DowngradeClient() public void DowngradeClient()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - changing full agent to child"); MainConsole.Instance.Notice("SimClient.cs:UpgradeClient() - changing full agent to child");
this.m_child = true; this.m_child = true;
OnChildAgentStatus(this.m_child); OnChildAgentStatus(this.m_child);
//this.m_world.RemoveViewerAgent(this); //this.m_world.RemoveViewerAgent(this);
@ -254,7 +255,7 @@ namespace OpenSim
protected virtual void ClientLoop() protected virtual void ClientLoop()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:ClientLoop() - Entered loop"); MainConsole.Instance.Notice("OpenSimClient.cs:ClientLoop() - Entered loop");
while (true) while (true)
{ {
QueItem nextPacket = PacketQueue.Dequeue(); QueItem nextPacket = PacketQueue.Dequeue();
@ -276,7 +277,7 @@ namespace OpenSim
protected virtual void InitNewClient() protected virtual void InitNewClient()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); MainConsole.Instance.Notice("OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
this.ClientAvatar = m_world.AddViewerAgent(this); this.ClientAvatar = m_world.AddViewerAgent(this);
} }
@ -287,12 +288,12 @@ namespace OpenSim
if (!sessionInfo.Authorised) if (!sessionInfo.Authorised)
{ {
//session/circuit not authorised //session/circuit not authorised
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Notice("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
ClientThread.Abort(); ClientThread.Abort();
} }
else else
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Notice("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
//session is authorised //session is authorised
this.AgentID = cirpack.CircuitCode.ID; this.AgentID = cirpack.CircuitCode.ID;
this.SessionID = cirpack.CircuitCode.SessionID; this.SessionID = cirpack.CircuitCode.SessionID;
@ -396,7 +397,7 @@ namespace OpenSim
if (this.m_userServer != null) if (this.m_userServer != null)
{ {
// a user server is set so request the inventory from it // a user server is set so request the inventory from it
Console.WriteLine("getting inventory from user server"); MainConsole.Instance.Verbose("getting inventory from user server");
inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer); inventory = m_inventoryCache.FetchAgentsInventory(this.AgentID, m_userServer);
} }
else else
@ -414,7 +415,7 @@ namespace OpenSim
{ {
if (!(packet.InventoryBlock.Type == 3 || packet.InventoryBlock.Type == 7)) if (!(packet.InventoryBlock.Type == 3 || packet.InventoryBlock.Type == 7))
{ {
System.Console.WriteLine("Attempted to create " + Util.FieldToString(packet.InventoryBlock.Name) + " in inventory. Unsupported type"); MainConsole.Instance.Warn("Attempted to create " + Util.FieldToString(packet.InventoryBlock.Name) + " in inventory. Unsupported type");
return; return;
} }

View File

@ -10,6 +10,7 @@ using System.Threading;
using System.Timers; using System.Timers;
using OpenSim.Framework.Utilities; using OpenSim.Framework.Utilities;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Console;
namespace OpenSim namespace OpenSim
{ {
@ -132,7 +133,7 @@ namespace OpenSim
} }
catch (Exception) catch (Exception)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread"); MainConsole.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
this.KillThread(); this.KillThread();
} }
@ -227,7 +228,7 @@ namespace OpenSim
{ {
if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent)) if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Resending " + packet.Type.ToString() + " packet, " + OpenSim.Framework.Console.MainConsole.Instance.Verbose("Resending " + packet.Type.ToString() + " packet, " +
(now - packet.TickCount) + "ms have passed"); (now - packet.TickCount) + "ms have passed");
packet.Header.Resent = true; packet.Header.Resent = true;
@ -246,7 +247,7 @@ namespace OpenSim
if (PendingAcks.Count > 250) if (PendingAcks.Count > 250)
{ {
// FIXME: Handle the odd case where we have too many pending ACKs queued up // FIXME: Handle the odd case where we have too many pending ACKs queued up
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Too many ACKs queued up!"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Too many ACKs queued up!");
return; return;
} }

View File

@ -89,7 +89,7 @@ namespace OpenSim
{ {
this.SetupFromConfigFile(this.localConfig); this.SetupFromConfigFile(this.localConfig);
} }
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration"); m_console.Notice("Main.cs:Startup() - Loading configuration");
this.regionData.InitConfig(this.m_sandbox, this.localConfig); this.regionData.InitConfig(this.m_sandbox, this.localConfig);
this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
@ -118,7 +118,7 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup local cache"); m_console.Error(e.Message + "\nSorry, could not setup local cache");
Environment.Exit(1); Environment.Exit(1);
} }
@ -141,7 +141,7 @@ namespace OpenSim
AssetCache.LoadDefaultTextureSet(); AssetCache.LoadDefaultTextureSet();
} }
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Initialising HTTP server"); m_console.Notice("Main.cs:Startup() - Initialising HTTP server");
this.SetupHttpListener(); this.SetupHttpListener();
@ -173,7 +173,7 @@ namespace OpenSim
AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer); AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer);
adminWebFront.LoadMethods(httpServer); adminWebFront.LoadMethods(httpServer);
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP server"); m_console.Notice("Main.cs:Startup() - Starting HTTP server");
httpServer.Start(); httpServer.Start();
//MainServerListener(); //MainServerListener();
@ -190,7 +190,7 @@ namespace OpenSim
GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll"; GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll";
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Sandbox mode"); m_console.Notice("Starting in Sandbox mode");
try try
{ {
@ -198,7 +198,7 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface"); m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
Environment.Exit(1); Environment.Exit(1);
} }
} }
@ -215,7 +215,7 @@ namespace OpenSim
} }
GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll"; GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll";
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Grid mode"); m_console.Notice("Starting in Grid mode");
try try
{ {
@ -223,15 +223,15 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface"); m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
Environment.Exit(1); Environment.Exit(1);
} }
} }
protected virtual void SetupLocalWorld() protected virtual void SetupLocalWorld()
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); m_console.Notice("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world"); m_console.Notice("Initialising world");
m_console.componentname = "Region " + regionData.RegionName; m_console.componentname = "Region " + regionData.RegionName;
m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName); m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
@ -249,7 +249,7 @@ namespace OpenSim
LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded. LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
LocalWorld.LoadWorldMap(); LocalWorld.LoadWorldMap();
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting up messaging system"); m_console.Notice("Main.cs:Startup() - Starting up messaging system");
LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
LocalWorld.LoadPrimsFromStorage(); LocalWorld.LoadPrimsFromStorage();
@ -297,7 +297,7 @@ namespace OpenSim
{ {
if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort))
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Success: Got a grid connection OK!"); m_console.Notice("Main.cs:Startup() - Success: Got a grid connection OK!");
} }
else else
{ {
@ -397,7 +397,7 @@ namespace OpenSim
switch (attri) switch (attri)
{ {
default: default:
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating"); m_console.Warn("Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating");
Environment.Exit(1); Environment.Exit(1);
break; break;
@ -440,11 +440,11 @@ namespace OpenSim
/// </summary> /// </summary>
public virtual void Shutdown() public virtual void Shutdown()
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing all threads"); m_console.Notice("Main.cs:Shutdown() - Closing all threads");
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing listener thread"); m_console.Notice("Main.cs:Shutdown() - Killing listener thread");
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing clients"); m_console.Notice("Main.cs:Shutdown() - Killing clients");
// IMPLEMENT THIS // IMPLEMENT THIS
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing console and terminating"); m_console.Notice("Main.cs:Shutdown() - Closing console and terminating");
LocalWorld.Close(); LocalWorld.Close();
GridServers.Close(); GridServers.Close();
m_console.Close(); m_console.Close();
@ -472,8 +472,8 @@ namespace OpenSim
switch (command) switch (command)
{ {
case "help": case "help":
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "show users - show info about connected users"); m_console.Error("show users - show info about connected users");
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - disconnect all clients and shutdown"); m_console.Error("shutdown - disconnect all clients and shutdown");
break; break;
case "show": case "show":
@ -484,7 +484,7 @@ namespace OpenSim
string result = ""; string result = "";
if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result)) if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result))
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result); m_console.Error(result);
} }
break; break;
@ -493,7 +493,7 @@ namespace OpenSim
break; break;
default: default:
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "Unknown command"); m_console.Error("Unknown command");
break; break;
} }
} }
@ -507,18 +507,18 @@ namespace OpenSim
switch (ShowWhat) switch (ShowWhat)
{ {
case "uptime": case "uptime":
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "OpenSim has been running since " + startuptime.ToString()); m_console.Error("OpenSim has been running since " + startuptime.ToString());
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "That is " + (DateTime.Now - startuptime).ToString()); m_console.Error("That is " + (DateTime.Now - startuptime).ToString());
break; break;
case "users": case "users":
OpenSim.world.Avatar TempAv; OpenSim.world.Avatar TempAv;
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP")); m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys) foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
{ {
if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar") if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
{ {
TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID]; TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
} }
} }
break; break;

View File

@ -82,7 +82,7 @@ namespace OpenSim
stIn.Close(); stIn.Close();
gridresp.Close(); gridresp.Close();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse); OpenSim.Framework.Console.MainConsole.Instance.Verbose("RegionInfo.CS:SaveToGrid() - Grid said: " + GridResponse);
} }
public void InitConfig(bool sandboxMode, IGenericConfig configData) public void InitConfig(bool sandboxMode, IGenericConfig configData)
@ -333,21 +333,21 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured"); OpenSim.Framework.Console.MainConsole.Instance.Warn("Config.cs:InitConfig() - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString());
} }
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Simulator Settings Loaded"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Simulator Settings Loaded");
/* OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "UUID: " + this.SimUUID.ToStringHyphenated()); /* MainConsole.Instance.Notice("UUID: " + this.SimUUID.ToStringHyphenated());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Name: " + this.RegionName); MainConsole.Instance.Notice("Name: " + this.RegionName);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); MainConsole.Instance.Notice("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Handle: " + this.RegionHandle.ToString()); MainConsole.Instance.Notice("Region Handle: " + this.RegionHandle.ToString());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort); MainConsole.Instance.Notice("Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Sandbox Mode? " + isSandbox.ToString()); MainConsole.Instance.Notice("Sandbox Mode? " + isSandbox.ToString());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Asset URL: " + this.AssetURL); MainConsole.Instance.Notice("Asset URL: " + this.AssetURL);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Asset key: " + this.AssetSendKey); MainConsole.Instance.Notice("Asset key: " + this.AssetSendKey);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Grid URL: " + this.GridURL); MainConsole.Instance.Notice("Grid URL: " + this.GridURL);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Grid key: " + this.GridSendKey); */ MainConsole.Instance.Notice("Grid key: " + this.GridSendKey); */
} }
} }
} }

View File

@ -144,20 +144,20 @@ namespace OpenSim
public void ServerListener() public void ServerListener()
{ {
m_console.WriteLine("UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort); m_console.Notice("UDPServer.cs:ServerListener() - Opening UDP socket on " + listenPort);
ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort); ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
Server.Bind(ServerIncoming); Server.Bind(ServerIncoming);
m_console.WriteLine("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen"); m_console.Notice("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen");
ipeSender = new IPEndPoint(IPAddress.Any, 0); ipeSender = new IPEndPoint(IPAddress.Any, 0);
epSender = (EndPoint)ipeSender; epSender = (EndPoint)ipeSender;
ReceivedData = new AsyncCallback(this.OnReceivedData); ReceivedData = new AsyncCallback(this.OnReceivedData);
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
m_console.WriteLine("UDPServer.cs:ServerListener() - Listening..."); m_console.Notice("UDPServer.cs:ServerListener() - Listening...");
} }

View File

@ -46,7 +46,7 @@ namespace OpenSim.world
m_regionTerraform = regionTerraform; m_regionTerraform = regionTerraform;
m_regionWaterHeight = regionWater; m_regionWaterHeight = regionWater;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs - Loading details from grid (DUMMY)"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs - Loading details from grid (DUMMY)");
ControllingClient = TheClient; ControllingClient = TheClient;
localid = 8880000 + (this.m_world._localNumber++); localid = 8880000 + (this.m_world._localNumber++);
Pos = ControllingClient.startpos; Pos = ControllingClient.startpos;
@ -211,7 +211,7 @@ namespace OpenSim.world
public void CompleteMovement() public void CompleteMovement()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:CompleteMovement() - Constructing AgentMovementComplete packet");
AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
mov.AgentData.SessionID = this.ControllingClient.SessionID; mov.AgentData.SessionID = this.ControllingClient.SessionID;
mov.AgentData.AgentID = this.ControllingClient.AgentID; mov.AgentData.AgentID = this.ControllingClient.AgentID;
@ -382,11 +382,11 @@ namespace OpenSim.world
//really really should be moved somewhere else (RegionInfo.cs ?) //really really should be moved somewhere else (RegionInfo.cs ?)
public void SendRegionHandshake(World regionInfo) public void SendRegionHandshake(World regionInfo)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet");
System.Text.Encoding _enc = System.Text.Encoding.ASCII; System.Text.Encoding _enc = System.Text.Encoding.ASCII;
RegionHandshakePacket handshake = new RegionHandshakePacket(); RegionHandshakePacket handshake = new RegionHandshakePacket();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details");
handshake.RegionInfo.BillableFactor = 0; handshake.RegionInfo.BillableFactor = 0;
handshake.RegionInfo.IsEstateManager = false; handshake.RegionInfo.IsEstateManager = false;
handshake.RegionInfo.TerrainHeightRange00 = regionInfo.m_regInfo.TerrainHeightRange00; handshake.RegionInfo.TerrainHeightRange00 = regionInfo.m_regInfo.TerrainHeightRange00;
@ -417,7 +417,7 @@ namespace OpenSim.world
handshake.RegionInfo.TerrainDetail3 = regionInfo.m_regInfo.TerrainDetail3; handshake.RegionInfo.TerrainDetail3 = regionInfo.m_regInfo.TerrainDetail3;
handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37"); handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE,"Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet");
this.ControllingClient.OutPacket(handshake); this.ControllingClient.OutPacket(handshake);
} }

View File

@ -18,7 +18,7 @@ namespace OpenSim.world
public void LoadAnims() public void LoadAnims()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs:LoadAnims() - Loading avatar animations"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:LoadAnims() - Loading avatar animations");
XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"); XmlTextReader reader = new XmlTextReader("data/avataranimations.xml");
XmlDocument doc = new XmlDocument(); XmlDocument doc = new XmlDocument();
@ -35,7 +35,7 @@ namespace OpenSim.world
reader.Close(); reader.Close();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");
foreach (KeyValuePair<string, LLUUID> kp in OpenSim.world.Avatar.Animations.AnimsLLUUID) foreach (KeyValuePair<string, LLUUID> kp in OpenSim.world.Avatar.Animations.AnimsLLUUID)
{ {

View File

@ -113,7 +113,7 @@ namespace OpenSim.world
//Uncomment when prim/object UUIDs are random or such //Uncomment when prim/object UUIDs are random or such
//2007-03-22 - Randomskk //2007-03-22 - Randomskk
//this._primCount--; //this._primCount--;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.VERBOSE, "Deleted UUID " + ent.uuid); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Deleted UUID " + ent.uuid);
} }
} }
} }

View File

@ -15,6 +15,7 @@ using OpenSim.Assets;
//using OpenSim.world.scripting; //using OpenSim.world.scripting;
using OpenSim.RegionServer.world.scripting; using OpenSim.RegionServer.world.scripting;
using OpenSim.Terrain; using OpenSim.Terrain;
using OpenSim.Framework.Console;
namespace OpenSim.world namespace OpenSim.world
{ {
@ -71,12 +72,12 @@ namespace OpenSim.world
m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>(); m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>();
m_scripts = new Dictionary<string, ScriptFactory>(); m_scripts = new Dictionary<string, ScriptFactory>();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs - creating new entitities instance"); MainConsole.Instance.Notice("World.cs - creating new entitities instance");
Entities = new Dictionary<libsecondlife.LLUUID, Entity>(); Entities = new Dictionary<libsecondlife.LLUUID, Entity>();
Avatars = new Dictionary<LLUUID, Avatar>(); Avatars = new Dictionary<LLUUID, Avatar>();
Prims = new Dictionary<LLUUID, Primitive>(); Prims = new Dictionary<LLUUID, Primitive>();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs - creating LandMap"); MainConsole.Instance.Notice("World.cs - creating LandMap");
TerrainManager = new TerrainManager(new SecondLife()); TerrainManager = new TerrainManager(new SecondLife());
Terrain = new TerrainEngine(); Terrain = new TerrainEngine();
Avatar.SetupTemplate("avatar-texture.dat"); Avatar.SetupTemplate("avatar-texture.dat");
@ -90,7 +91,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "World.cs: Constructor failed with exception " + e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Error("World.cs: Constructor failed with exception " + e.ToString());
} }
} }
#endregion #endregion
@ -110,7 +111,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddScript() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: AddScript() - Failed with exception " + e.ToString());
} }
} }
@ -162,7 +163,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddScript() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: AddScript() - Failed with exception " + e.ToString());
} }
} }
@ -216,7 +217,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: Update() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: Update() - Failed with exception " + e.ToString());
} }
updateLock.ReleaseMutex(); updateLock.ReleaseMutex();
} }
@ -229,15 +230,15 @@ namespace OpenSim.world
if (Terrain.tainted > 0) if (Terrain.tainted > 0)
{ {
Terrain.tainted = 0; Terrain.tainted = 0;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain tainted, saving."); MainConsole.Instance.Notice("World.cs: Backup() - Terrain tainted, saving.");
localStorage.SaveMap(Terrain.getHeights1D()); localStorage.SaveMap(Terrain.getHeights1D());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Rebuilding world map image."); MainConsole.Instance.Notice("World.cs: Backup() - Rebuilding world map image.");
Terrain.exportImage("map_" + m_regInfo.RegionName.ToLower() + ".png", "defaultstripe.png"); Terrain.exportImage("map_" + m_regInfo.RegionName.ToLower() + ".png", "defaultstripe.png");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain saved, informing Physics."); MainConsole.Instance.Notice("World.cs: Backup() - Terrain saved, informing Physics.");
phyScene.SetTerrain(Terrain.getHeights1D()); phyScene.SetTerrain(Terrain.getHeights1D());
// Needs optimising to just send patches which have changed. // Needs optimising to just send patches which have changed.
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain changed, informing Clients."); MainConsole.Instance.Notice("World.cs: Backup() - Terrain changed, informing Clients.");
foreach (ClientView client in m_clientThreads.Values) foreach (ClientView client in m_clientThreads.Values)
{ {
this.SendLayerData(client); this.SendLayerData(client);
@ -245,7 +246,7 @@ namespace OpenSim.world
} }
// Primitive backup routines -- should only do if there's been a change. // Primitive backup routines -- should only do if there's been a change.
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Backing up Primitives"); MainConsole.Instance.Notice("World.cs: Backup() - Backing up Primitives");
foreach (libsecondlife.LLUUID UUID in Entities.Keys) foreach (libsecondlife.LLUUID UUID in Entities.Keys)
{ {
Entities[UUID].BackUp(); Entities[UUID].BackUp();
@ -268,7 +269,7 @@ namespace OpenSim.world
catch (Exception e) catch (Exception e)
{ {
// Backup failed // Backup failed
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "World.cs: Backup() - Backup Failed with exception " + e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Error("World.cs: Backup() - Backup Failed with exception " + e.ToString());
return false; return false;
} }
} }
@ -314,7 +315,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: LoadStorageDLL() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: LoadStorageDLL() - Failed with exception " + e.ToString());
return false; return false;
} }
} }
@ -358,7 +359,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString());
} }
} }
@ -389,7 +390,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString());
} }
} }
@ -415,7 +416,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString());
} }
} }
@ -461,7 +462,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: LoadWorldMap() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: LoadWorldMap() - Failed with exception " + e.ToString());
} }
} }
#endregion #endregion
@ -487,7 +488,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: GetInitialPrims() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: GetInitialPrims() - Failed with exception " + e.ToString());
} }
} }
@ -498,12 +499,12 @@ namespace OpenSim.world
{ {
try try
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: LoadPrimsFromStorage() - Loading primitives"); MainConsole.Instance.Notice("World.cs: LoadPrimsFromStorage() - Loading primitives");
this.localStorage.LoadPrimitives(this); this.localStorage.LoadPrimitives(this);
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: LoadPrimsFromStorage() - Failed with exception " + e.ToString());
} }
} }
@ -519,14 +520,14 @@ namespace OpenSim.world
{ {
_primCount = prim.LocalID + 1; _primCount = prim.LocalID + 1;
} }
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage"); MainConsole.Instance.Notice("World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage");
Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this); Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
nPrim.CreateFromStorage(prim); nPrim.CreateFromStorage(prim);
this.Entities.Add(nPrim.uuid, nPrim); this.Entities.Add(nPrim.uuid, nPrim);
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: PrimFromStorage() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: PrimFromStorage() - Failed with exception " + e.ToString());
} }
} }
@ -539,7 +540,7 @@ namespace OpenSim.world
{ {
try try
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: AddNewPrim() - Creating new prim"); MainConsole.Instance.Notice("World.cs: AddNewPrim() - Creating new prim");
Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this); Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this);
prim.CreateFromPacket(addPacket, ownerID, this._primCount); prim.CreateFromPacket(addPacket, ownerID, this._primCount);
PhysicsVector pVec = new PhysicsVector(prim.Pos.X, prim.Pos.Y, prim.Pos.Z); PhysicsVector pVec = new PhysicsVector(prim.Pos.X, prim.Pos.Y, prim.Pos.Z);
@ -557,7 +558,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddNewPrim() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: AddNewPrim() - Failed with exception " + e.ToString());
} }
} }
@ -590,10 +591,10 @@ namespace OpenSim.world
Avatar newAvatar = null; Avatar newAvatar = null;
try try
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent");
newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20); newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Adding new avatar to world"); MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Adding new avatar to world");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs:AddViewerAgent() - Starting RegionHandshake "); MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Starting RegionHandshake ");
newAvatar.SendRegionHandshake(this); newAvatar.SendRegionHandshake(this);
//if (!agentClient.m_child) //if (!agentClient.m_child)
//{ //{
@ -629,7 +630,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddViewerAgent() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: AddViewerAgent() - Failed with exception " + e.ToString());
} }
return newAvatar; return newAvatar;
} }
@ -655,7 +656,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: RemoveViewerAgent() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: RemoveViewerAgent() - Failed with exception " + e.ToString());
} }
} }
#endregion #endregion
@ -689,7 +690,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "World.cs: Close() - Failed with exception " + e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Error("World.cs: Close() - Failed with exception " + e.ToString());
} }
} }
#endregion #endregion

View File

@ -14,6 +14,7 @@ using OpenSim.Framework.Inventory;
using OpenSim.Assets; using OpenSim.Assets;
using OpenSim.RegionServer.world.scripting; using OpenSim.RegionServer.world.scripting;
using OpenSim.Terrain; using OpenSim.Terrain;
using OpenSim.Framework.Console;
namespace OpenSim.world namespace OpenSim.world
{ {
@ -112,7 +113,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: SendLayerData() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: SendLayerData() - Failed with exception " + e.ToString());
} }
} }
@ -138,7 +139,7 @@ namespace OpenSim.world
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: SendLayerData() - Failed with exception " + e.ToString()); MainConsole.Instance.Warn("World.cs: SendLayerData() - Failed with exception " + e.ToString());
} }
} }
#endregion #endregion

View File

@ -33,6 +33,7 @@ using libsecondlife;
using OpenSim.Framework.Interfaces; using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types; using OpenSim.Framework.Types;
using OpenSim.Framework.Terrain; using OpenSim.Framework.Terrain;
using OpenSim.Framework.Console;
namespace OpenSim.Storage.LocalStorageDb4o namespace OpenSim.Storage.LocalStorageDb4o
@ -52,18 +53,18 @@ namespace OpenSim.Storage.LocalStorageDb4o
public void Initialise(string dfile) public void Initialise(string dfile)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Db4LocalStorage Opening " + dfile); OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage Opening " + dfile);
datastore = dfile; datastore = dfile;
try try
{ {
db = Db4oFactory.OpenFile(datastore); db = Db4oFactory.OpenFile(datastore);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Db4LocalStorage creation"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage creation");
} }
catch (Exception e) catch (Exception e)
{ {
db.Close(); db.Close();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Db4LocalStorage :Constructor - Exception occured"); OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage :Constructor - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString());
} }
} }
@ -122,7 +123,7 @@ namespace OpenSim.Storage.LocalStorageDb4o
public void LoadPrimitives(ILocalStorageReceiver receiver) public void LoadPrimitives(ILocalStorageReceiver receiver)
{ {
IObjectSet result = db.Get(typeof(PrimData)); IObjectSet result = db.Get(typeof(PrimData));
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count); OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count);
foreach (PrimData prim in result) { foreach (PrimData prim in result) {
receiver.PrimFromStorage(prim); receiver.PrimFromStorage(prim);
} }
@ -130,14 +131,14 @@ namespace OpenSim.Storage.LocalStorageDb4o
public float[] LoadWorld() public float[] LoadWorld()
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Loading world...."); OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Loading world....");
//World blank = new World(); //World blank = new World();
float[] heightmap = null; float[] heightmap = null;
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Looking for a heightmap in local DB"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Looking for a heightmap in local DB");
IObjectSet world_result = db.Get(typeof(MapStorage)); IObjectSet world_result = db.Get(typeof(MapStorage));
if (world_result.Count > 0) if (world_result.Count > 0)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"LoadWorld() - Found a heightmap in local database, loading"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Found a heightmap in local database, loading");
MapStorage map = (MapStorage)world_result.Next(); MapStorage map = (MapStorage)world_result.Next();
//blank.LandMap = map.Map; //blank.LandMap = map.Map;
heightmap = map.Map; heightmap = map.Map;
@ -165,7 +166,7 @@ namespace OpenSim.Storage.LocalStorageDb4o
IObjectSet world_result = db.Get(typeof(MapStorage)); IObjectSet world_result = db.Get(typeof(MapStorage));
if (world_result.Count > 0) if (world_result.Count > 0)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"SaveWorld() - updating saved copy of heightmap in local database"); OpenSim.Framework.Console.MainConsole.Instance.Verbose("SaveWorld() - updating saved copy of heightmap in local database");
MapStorage map = (MapStorage)world_result.Next(); MapStorage map = (MapStorage)world_result.Next();
db.Delete(map); db.Delete(map);
} }
@ -177,31 +178,31 @@ namespace OpenSim.Storage.LocalStorageDb4o
public void SaveParcels(ParcelData[] parcel_data) public void SaveParcels(ParcelData[] parcel_data)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Saving Parcels..."); MainConsole.Instance.Notice("Parcel Backup: Saving Parcels...");
IObjectSet result = db.Get(typeof(ParcelData)); IObjectSet result = db.Get(typeof(ParcelData));
foreach (ParcelData parcel in result) foreach (ParcelData parcel in result)
{ {
db.Delete(parcel); db.Delete(parcel);
} }
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Removing old entries complete. Adding new entries."); MainConsole.Instance.Notice("Parcel Backup: Removing old entries complete. Adding new entries.");
int i; int i;
for (i = 0; i < parcel_data.GetLength(0); i++) for (i = 0; i < parcel_data.GetLength(0); i++)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Adding : " + i); MainConsole.Instance.Notice("Adding : " + i);
db.Set(parcel_data[i]); db.Set(parcel_data[i]);
} }
db.Commit(); db.Commit();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcel Save Complete"); MainConsole.Instance.Notice("Parcel Backup: Parcel Save Complete");
} }
public void LoadParcels(ILocalStorageParcelReceiver recv) public void LoadParcels(ILocalStorageParcelReceiver recv)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Loading Parcels..."); MainConsole.Instance.Notice("Parcel Backup: Loading Parcels...");
IObjectSet result = db.Get(typeof(ParcelData)); IObjectSet result = db.Get(typeof(ParcelData));
if (result.Count > 0) if (result.Count > 0)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcels exist in database."); MainConsole.Instance.Notice("Parcel Backup: Parcels exist in database.");
foreach (ParcelData parcelData in result) foreach (ParcelData parcelData in result)
{ {
recv.ParcelFromStorage(parcelData); recv.ParcelFromStorage(parcelData);
@ -209,10 +210,10 @@ namespace OpenSim.Storage.LocalStorageDb4o
} }
else else
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: No parcels exist. Creating basic parcel."); MainConsole.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel.");
recv.NoParcelDataFromStorage(); recv.NoParcelDataFromStorage();
} }
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Parcel Backup: Parcels Restored"); MainConsole.Instance.Notice("Parcel Backup: Parcels Restored");
} }
public void ShutDown() public void ShutDown()
{ {

View File

@ -54,8 +54,8 @@ namespace OpenSim.Storage.LocalStorageSQLite
catch (Exception e) catch (Exception e)
{ {
db.Close(); db.Close();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :Constructor - Exception occured"); OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :Constructor - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString());
} }
} }
@ -117,8 +117,8 @@ namespace OpenSim.Storage.LocalStorageSQLite
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :StorePrim - Exception occured"); OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :StorePrim - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString());
} }
cmd.Dispose(); cmd.Dispose();
@ -144,8 +144,8 @@ namespace OpenSim.Storage.LocalStorageSQLite
} }
catch (Exception e) catch (Exception e)
{ {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"SQLiteLocalStorage :RemovePrim - Exception occured"); OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :RemovePrim - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString()); OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString());
} }
cmd.Dispose(); cmd.Dispose();

View File

@ -89,7 +89,7 @@ namespace OpenSim
{ {
this.SetupFromConfigFile(this.localConfig); this.SetupFromConfigFile(this.localConfig);
} }
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration"); m_console.Notice("Main.cs:Startup() - Loading configuration");
this.regionData.InitConfig(this.m_sandbox, this.localConfig); this.regionData.InitConfig(this.m_sandbox, this.localConfig);
this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
@ -120,7 +120,7 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup local cache"); m_console.Error(e.Message + "\nSorry, could not setup local cache");
Environment.Exit(1); Environment.Exit(1);
} }
@ -143,7 +143,7 @@ namespace OpenSim
AssetCache.LoadDefaultTextureSet(); AssetCache.LoadDefaultTextureSet();
} }
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Initialising HTTP server"); m_console.Notice("Main.cs:Startup() - Initialising HTTP server");
this.SetupHttpListener(); this.SetupHttpListener();
@ -178,20 +178,20 @@ namespace OpenSim
adminWebFront.LoadMethods(httpServer); adminWebFront.LoadMethods(httpServer);
//Start http server //Start http server
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP server"); m_console.Notice("Main.cs:Startup() - Starting HTTP server");
httpServer.Start(); httpServer.Start();
// Start UDP server // Start UDP server
this.m_udpServer.ServerListener(); this.m_udpServer.ServerListener();
//Setup Master Avatar //Setup Master Avatar
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Setting up Master Avatar"); m_console.Notice("Main.cs:Startup() - Setting up Master Avatar");
if (this.m_sandbox) if (this.m_sandbox)
{ {
OpenSim.Framework.User.UserProfile masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName); OpenSim.Framework.User.UserProfile masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName);
if(masterUser == null) if(masterUser == null)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Sandbox Mode; Master Avatar is a new user; creating account."); m_console.Notice("Main.cs:Startup() - Sandbox Mode; Master Avatar is a new user; creating account.");
adminLoginServer.CreateUserAccount(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName, this.regionData.MasterAvatarSandboxPassword); adminLoginServer.CreateUserAccount(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName, this.regionData.MasterAvatarSandboxPassword);
masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName); masterUser = adminLoginServer.LocalUserManager.GetProfileByName(this.regionData.MasterAvatarFirstName, this.regionData.MasterAvatarLastName);
if(masterUser == null) //Still NULL?!!?! OMG FAIL! if(masterUser == null) //Still NULL?!!?! OMG FAIL!
@ -199,13 +199,13 @@ namespace OpenSim
throw new Exception("Failure to create master user account"); throw new Exception("Failure to create master user account");
} }
} }
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Master User UUID: " + masterUser.UUID.ToStringHyphenated()); m_console.Notice("Main.cs:Startup() - Master User UUID: " + masterUser.UUID.ToStringHyphenated());
regionData.MasterAvatarAssignedUUID = masterUser.UUID; regionData.MasterAvatarAssignedUUID = masterUser.UUID;
} }
else else
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Grid Mode; Do not know how to get the user's master key yet!"); m_console.Notice("Main.cs:Startup() - Grid Mode; Do not know how to get the user's master key yet!");
} }
Console.WriteLine("Creating ParcelManager"); Console.WriteLine("Creating ParcelManager");
@ -225,7 +225,7 @@ namespace OpenSim
GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll"; GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll";
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Sandbox mode"); m_console.Notice("Starting in Sandbox mode");
try try
{ {
@ -233,7 +233,7 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface"); m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
Environment.Exit(1); Environment.Exit(1);
} }
} }
@ -250,7 +250,7 @@ namespace OpenSim
} }
GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll"; GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll";
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Grid mode"); m_console.Notice("Starting in Grid mode");
try try
{ {
@ -258,15 +258,15 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface"); m_console.Error(e.Message + "\nSorry, could not setup the grid interface");
Environment.Exit(1); Environment.Exit(1);
} }
} }
protected override void SetupLocalWorld() protected override void SetupLocalWorld()
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString()); m_console.Notice("Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world"); m_console.Notice("Initialising world");
m_console.componentname = "Region " + regionData.RegionName; m_console.componentname = "Region " + regionData.RegionName;
m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName); m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
@ -284,7 +284,7 @@ namespace OpenSim
LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded. LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
LocalWorld.LoadWorldMap(); LocalWorld.LoadWorldMap();
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting up messaging system"); m_console.Notice("Main.cs:Startup() - Starting up messaging system");
LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D()); LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
LocalWorld.LoadPrimsFromStorage(); LocalWorld.LoadPrimsFromStorage();
@ -329,11 +329,11 @@ namespace OpenSim
{ {
if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort)) if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort))
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Success: Got a grid connection OK!"); m_console.Notice("Main.cs:Startup() - Success: Got a grid connection OK!");
} }
else else
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down."); m_console.Error("Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down.");
Shutdown(); Shutdown();
} }
@ -359,7 +359,7 @@ namespace OpenSim
} }
catch (Exception e) catch (Exception e)
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!"); m_console.Error(e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!");
Environment.Exit(1); Environment.Exit(1);
} }
} }
@ -429,7 +429,7 @@ namespace OpenSim
switch (attri) switch (attri)
{ {
default: default:
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating"); m_console.Warn("Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating");
Environment.Exit(1); Environment.Exit(1);
break; break;
@ -472,11 +472,11 @@ namespace OpenSim
/// </summary> /// </summary>
public virtual void Shutdown() public virtual void Shutdown()
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing all threads"); m_console.Notice("Main.cs:Shutdown() - Closing all threads");
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing listener thread"); m_console.Notice("Main.cs:Shutdown() - Killing listener thread");
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing clients"); m_console.Notice("Main.cs:Shutdown() - Killing clients");
// IMPLEMENT THIS // IMPLEMENT THIS
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing console and terminating"); m_console.Notice("Main.cs:Shutdown() - Closing console and terminating");
LocalWorld.Close(); LocalWorld.Close();
GridServers.Close(); GridServers.Close();
m_console.Close(); m_console.Close();
@ -504,8 +504,8 @@ namespace OpenSim
switch (command) switch (command)
{ {
case "help": case "help":
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "show users - show info about connected users"); m_console.Error("show users - show info about connected users");
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - disconnect all clients and shutdown"); m_console.Error("shutdown - disconnect all clients and shutdown");
break; break;
case "show": case "show":
@ -516,7 +516,7 @@ namespace OpenSim
string result = ""; string result = "";
if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result)) if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result))
{ {
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result); m_console.Error(result);
} }
break; break;
@ -525,7 +525,7 @@ namespace OpenSim
break; break;
default: default:
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "Unknown command"); m_console.Error("Unknown command");
break; break;
} }
} }
@ -539,18 +539,18 @@ namespace OpenSim
switch (ShowWhat) switch (ShowWhat)
{ {
case "uptime": case "uptime":
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "OpenSim has been running since " + startuptime.ToString()); m_console.Error("OpenSim has been running since " + startuptime.ToString());
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "That is " + (DateTime.Now - startuptime).ToString()); m_console.Error("That is " + (DateTime.Now - startuptime).ToString());
break; break;
case "users": case "users":
OpenSim.world.Avatar TempAv; OpenSim.world.Avatar TempAv;
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP")); m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys) foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
{ {
if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar") if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
{ {
TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID]; TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); m_console.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
} }
} }
break; break;