More formatting cleanup.

0.6.0-stable
Jeff Ames 2008-05-14 05:33:32 +00:00
parent c995d60d37
commit 6a1b787436
28 changed files with 173 additions and 162 deletions

View File

@ -41,7 +41,8 @@ namespace OpenSim.Data.MapperFactory
static public BaseDatabaseConnector GetDataBaseMapper(MAPPER_TYPE type, string connectionString)
{
switch (type) {
switch (type)
{
case MAPPER_TYPE.MySQL:
return new MySQLDatabaseMapper(connectionString);
case MAPPER_TYPE.MSSQL:

View File

@ -174,10 +174,13 @@ namespace OpenSim.Data.MySQL
{
// TODO: This will let you pass in the connect string in
// the config, though someone will need to write that.
if (connect == String.Empty) {
if (connect == String.Empty)
{
// This is old seperate config file
Initialise();
} else {
}
else
{
_dbConnection = new MySQLManager(connect);
TestTables();
}

View File

@ -58,7 +58,8 @@ namespace OpenSim.Data.SQLite
override public void Initialise(string dbconnect)
{
if (dbconnect == string.Empty) {
if (dbconnect == string.Empty)
{
dbconnect = "URI=file:AssetStorage.db,version=3";
}
m_conn = new SqliteConnection(dbconnect);

View File

@ -52,7 +52,8 @@ namespace OpenSim.Data.SQLite
/// </summary>
public void Initialise(string dbconnect)
{
if (dbconnect == string.Empty) {
if (dbconnect == string.Empty)
{
dbconnect = "URI=file:inventoryStore.db,version=3";
}
m_log.Info("[INVENTORY DB]: Sqlite - connecting: " + dbconnect);

View File

@ -372,8 +372,14 @@ namespace OpenSim.Framework.Servers
LLSD llsdRequest = null;
LLSD llsdResponse = null;
try { llsdRequest = LLSDParser.DeserializeXml(requestBody); }
catch (Exception ex) { m_log.Warn("[HTTPD]: Error - " + ex.Message); }
try
{
llsdRequest = LLSDParser.DeserializeXml(requestBody);
}
catch (Exception ex)
{
m_log.Warn("[HTTPD]: Error - " + ex.Message);
}
if (llsdRequest != null && m_llsdHandler != null)
{

View File

@ -39,7 +39,8 @@ namespace OpenGridServices.Manager
protected virtual void OnResponse(object o, Gtk.ResponseArgs args)
{
switch (args.ResponseId) {
switch (args.ResponseId)
{
case Gtk.ResponseType.Ok:
MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text);
break;

View File

@ -46,7 +46,8 @@ namespace OpenGridServices.Manager
public bool Connect(string GridServerURL, string username, string password)
{
try {
try
{
this.ServerURL=GridServerURL;
Hashtable LoginParamsHT = new Hashtable();
LoginParamsHT["username"]=username;
@ -55,16 +56,21 @@ namespace OpenGridServices.Manager
LoginParams.Add(LoginParamsHT);
XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams);
XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000);
if (GridResp.IsFault) {
if (GridResp.IsFault)
{
connected=false;
return false;
} else {
}
else
{
Hashtable gridrespData = (Hashtable)GridResp.Value;
this.SessionID = new LLUUID((string)gridrespData["session_id"]);
connected=true;
return true;
}
} catch(Exception e) {
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
connected=false;
return false;
@ -107,20 +113,26 @@ namespace OpenGridServices.Manager
public bool ShutdownServer()
{
try {
try
{
Hashtable ShutdownParamsHT = new Hashtable();
ArrayList ShutdownParams = new ArrayList();
ShutdownParamsHT["session_id"]=this.SessionID.ToString();
ShutdownParams.Add(ShutdownParamsHT);
XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams);
XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL, 3000);
if (GridResp.IsFault) {
if (GridResp.IsFault)
{
return false;
} else {
}
else
{
connected=false;
return true;
}
} catch(Exception e) {
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
return false;
}

View File

@ -62,39 +62,49 @@ namespace OpenGridServices.Manager
operation=PendingOperations.Dequeue();
Console.WriteLine(operation);
cmd = operation.Split(sep)[0];
switch (cmd) {
switch (cmd)
{
case "connect_to_gridserver":
win.SetStatus("Connecting to grid server...");
if (gridserverConn.Connect(operation.Split(sep)[1], operation.Split(sep)[2], operation.Split(sep)[3])) {
if (gridserverConn.Connect(operation.Split(sep)[1], operation.Split(sep)[2], operation.Split(sep)[3]))
{
win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID);
win.SetGridServerConnected(true);
Thread.Sleep(3000);
win.SetStatus("Downloading region maps...");
gridserverConn.DownloadMap();
} else {
}
else
{
win.SetStatus("Could not connect");
}
break;
case "restart_gridserver":
win.SetStatus("Restarting grid server...");
if (gridserverConn.RestartServer()) {
if (gridserverConn.RestartServer())
{
win.SetStatus("Restarted server OK");
Thread.Sleep(3000);
win.SetStatus("");
} else {
}
else
{
win.SetStatus("Error restarting grid server!!!");
}
break;
case "shutdown_gridserver":
win.SetStatus("Shutting down grid server...");
if (gridserverConn.ShutdownServer()) {
if (gridserverConn.ShutdownServer())
{
win.SetStatus("Grid server shutdown");
win.SetGridServerConnected(false);
Thread.Sleep(3000);
win.SetStatus("");
} else {
}
else
{
win.SetStatus("Could not shutdown grid server!!!");
}
break;

View File

@ -35,38 +35,26 @@
// </autogenerated>
// ------------------------------------------------------------------------------
namespace OpenGridServices.Manager {
public partial class ConnectToGridServerDialog {
namespace OpenGridServices.Manager
{
public partial class ConnectToGridServerDialog
{
private Gtk.VBox vbox2;
private Gtk.VBox vbox3;
private Gtk.HBox hbox1;
private Gtk.Label label1;
private Gtk.Entry entry1;
private Gtk.HBox hbox2;
private Gtk.Label label2;
private Gtk.Entry entry2;
private Gtk.HBox hbox3;
private Gtk.Label label3;
private Gtk.Entry entry3;
private Gtk.Button button2;
private Gtk.Button button8;
protected virtual void Build() {
protected virtual void Build()
{
Stetic.Gui.Initialize();
// Widget OpenGridServices.Manager.ConnectToGridServerDialog
this.Events = ((Gdk.EventMask)(256));
@ -241,7 +229,8 @@ namespace OpenGridServices.Manager {
w31.Position = 1;
w31.Expand = false;
w31.Fill = false;
if ((this.Child != null)) {
if (this.Child != null)
{
this.Child.ShowAll();
}
this.DefaultWidth = 476;

View File

@ -35,82 +35,48 @@
// </autogenerated>
// ------------------------------------------------------------------------------
namespace OpenGridServices.Manager {
public partial class MainWindow {
namespace OpenGridServices.Manager
{
public partial class MainWindow
{
private Gtk.Action Grid;
private Gtk.Action User;
private Gtk.Action Asset;
private Gtk.Action Region;
private Gtk.Action Services;
private Gtk.Action ConnectToGridserver;
private Gtk.Action RestartWholeGrid;
private Gtk.Action ShutdownWholeGrid;
private Gtk.Action ExitGridManager;
private Gtk.Action ConnectToUserserver;
private Gtk.Action AccountManagment;
private Gtk.Action GlobalNotice;
private Gtk.Action DisableAllLogins;
private Gtk.Action DisableNonGodUsersOnly;
private Gtk.Action ShutdownUserServer;
private Gtk.Action ShutdownGridserverOnly;
private Gtk.Action RestartGridserverOnly;
private Gtk.Action DefaultLocalGridUserserver;
private Gtk.Action CustomUserserver;
private Gtk.Action RemoteGridDefaultUserserver;
private Gtk.Action DisconnectFromGridServer;
private Gtk.Action UploadAsset;
private Gtk.Action AssetManagement;
private Gtk.Action ConnectToAssetServer;
private Gtk.Action ConnectToDefaultAssetServerForGrid;
private Gtk.Action DefaultForLocalGrid;
private Gtk.Action DefaultForRemoteGrid;
private Gtk.Action CustomAssetServer;
private Gtk.VBox vbox1;
private Gtk.MenuBar menubar2;
private Gtk.HBox hbox1;
private Gtk.ScrolledWindow scrolledwindow1;
private Gtk.DrawingArea drawingarea1;
private Gtk.TreeView treeview1;
private Gtk.Statusbar statusbar1;
protected virtual void Build() {
protected virtual void Build()
{
Stetic.Gui.Initialize();
// Widget OpenGridServices.Manager.MainWindow
Gtk.UIManager w1 = new Gtk.UIManager();
@ -266,7 +232,8 @@ namespace OpenGridServices.Manager {
w10.Expand = false;
w10.Fill = false;
this.Add(this.vbox1);
if ((this.Child != null)) {
if (this.Child != null)
{
this.Child.ShowAll();
}
this.DefaultWidth = 800;

View File

@ -35,27 +35,27 @@
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Stetic {
internal class Gui {
namespace Stetic
{
internal class Gui
{
private static bool initialized;
internal static void Initialize() {
if ((Stetic.Gui.initialized == false)) {
internal static void Initialize()
{
Stetic.Gui.initialized = true;
}
}
}
internal class ActionGroups {
public static Gtk.ActionGroup GetActionGroup(System.Type type) {
internal class ActionGroups
{
public static Gtk.ActionGroup GetActionGroup(System.Type type)
{
return Stetic.ActionGroups.GetActionGroup(type.FullName);
}
public static Gtk.ActionGroup GetActionGroup(string name) {
public static Gtk.ActionGroup GetActionGroup(string name)
{
return null;
}
}

View File

@ -39,7 +39,8 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSO
public Dictionary<uint, object> GlobalVariables = new Dictionary<uint, object>();
public Dictionary<uint, object> LocalVariables = new Dictionary<uint, object>();
//public System.Collections.Generic.List<string> FunctionList = new System.Collections.Generic.List<string>();
//public void AddFunction(String x) {
//public void AddFunction(String x)
//{
// FunctionList.Add(x);
//}
//public Stack<StackItemStruct> LSLStack = new Stack<StackItemStruct>;
@ -56,12 +57,10 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSO
return LSL_Builtins;
}
public LSL_BaseClass()
{
}
public virtual int OverrideMe()
{
return 0;
@ -72,8 +71,6 @@ namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSO
LSL_Builtins = LSLBuiltins;
Common.SendToLog("OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass.Start() called");
//LSL_Builtins.llSay(0, "Test");
return;
}
public void AddToStatic(UInt32 index, object obj)

View File

@ -4601,13 +4601,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack;
handlerObjectIncludeInSearch = null;
foreach (ObjectIncludeInSearchPacket.ObjectDataBlock objData in packInSearch.ObjectData) {
foreach (ObjectIncludeInSearchPacket.ObjectDataBlock objData in packInSearch.ObjectData)
{
bool inSearch = objData.IncludeInSearch;
uint localID = objData.ObjectLocalID;
handlerObjectIncludeInSearch = OnObjectIncludeInSearch;
if (handlerObjectIncludeInSearch != null) {
if (handlerObjectIncludeInSearch != null)
{
handlerObjectIncludeInSearch(this, inSearch, localID);
}
}

View File

@ -148,7 +148,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return;
}
lock (this) {
lock (this)
{
switch (item.throttleType)
{
case ThrottleOutPacketType.Resend:

View File

@ -78,12 +78,15 @@ namespace OpenSim.Region.DataSnapshot
if (!m_scenes.Contains(scene))
m_scenes.Add(scene);
if (!m_configLoaded) {
if (!m_configLoaded)
{
m_configLoaded = true;
m_log.Info("[DATASNAPSHOT]: Loading configuration");
//Read from the config for options
lock (m_syncInit) {
try {
lock (m_syncInit)
{
try
{
m_enabled = config.Configs["DataSnapshot"].GetBoolean("index_sims", m_enabled);
if (config.Configs["Startup"].GetBoolean("gridmode", true))
{
@ -105,16 +108,17 @@ namespace OpenSim.Region.DataSnapshot
//BUG: Naming a search data module "DESUDESUDESU" will cause it to not get loaded by default.
//RESOLUTION: Wontfix, there are no Suiseiseki-loving developers
String[] annoying_string_array = config.Configs["DataSnapshot"].GetString("disable_modules", "DESUDESUDESU").Split(".".ToCharArray());
foreach (String bloody_wanker in annoying_string_array) {
foreach (String bloody_wanker in annoying_string_array)
{
m_disabledModules.Add(bloody_wanker);
}
} catch (Exception) {
}
catch (Exception)
{
m_log.Info("[DATASNAPSHOT]: Could not load configuration. DataSnapshot will be disabled.");
m_enabled = false;
return;
}
}
}
if (Directory.Exists(m_snapsDir))
@ -135,7 +139,6 @@ namespace OpenSim.Region.DataSnapshot
}
}
if (m_enabled)
{
m_log.Info("[DATASNAPSHOT]: Scene added to module.");

View File

@ -815,7 +815,8 @@ namespace OpenSim.Region.Environment.Scenes
agentItem.Folder = folderId;
agentItem.EveryOnePermissions = taskItem.EveryoneMask;
if (remoteClient.AgentId != taskItem.OwnerID) {
if (remoteClient.AgentId != taskItem.OwnerID)
{
agentItem.BasePermissions = taskItem.NextOwnerMask;
agentItem.CurrentPermissions = taskItem.NextOwnerMask;
agentItem.NextPermissions = taskItem.NextOwnerMask;
@ -1038,7 +1039,8 @@ namespace OpenSim.Region.Environment.Scenes
item.InvType = asset.InvType;
item.Folder = DeRezPacket.AgentBlock.DestinationID;
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
if (remoteClient.AgentId != objectGroup.RootPart.OwnerID) {
if (remoteClient.AgentId != objectGroup.RootPart.OwnerID)
{
item.BasePermissions = objectGroup.RootPart.NextOwnerMask;
item.CurrentPermissions = objectGroup.RootPart.NextOwnerMask;
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;

View File

@ -195,7 +195,8 @@ namespace OpenSim.Region.Environment.Scenes
public int transactiontype;
public string description;
public MoneyTransferArgs(LLUUID asender, LLUUID areceiver, int aamount, int atransactiontype, string adescription) {
public MoneyTransferArgs(LLUUID asender, LLUUID areceiver, int aamount, int atransactiontype, string adescription)
{
sender = asender;
receiver = areceiver;
amount = aamount;

View File

@ -579,7 +579,8 @@ namespace OpenSim.Region.Physics.Meshing
if (pathShearX != 0)
{
if (pathShearX > 50) {
if (pathShearX > 50)
{
// Complimentary byte. Negative values wrap around the byte. Positive values go up to 50
extr.pushX = (((float)(256 - pathShearX) / 100) * -1f);
// m_log.Warn("pushX: " + extr.pushX);
@ -593,7 +594,8 @@ namespace OpenSim.Region.Physics.Meshing
if (pathShearY != 0)
{
if (pathShearY > 50) {
if (pathShearY > 50)
{
// Complimentary byte. Negative values wrap around the byte. Positive values go up to 50
extr.pushY = (((float)(256 - pathShearY) / 100) * -1f);
//m_log.Warn("pushY: " + extr.pushY);

View File

@ -207,7 +207,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void DoScriptLoadUnload()
{
lock (LUQueue) {
lock (LUQueue)
{
if (LUQueue.Count > 0)
{
LUStruct item = LUQueue.Dequeue();
@ -216,7 +217,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{
_StopScript(item.localID, item.itemID);
}
if (item.Action == LUType.Load)
else if (item.Action == LUType.Load)
{
_StartScript(item.localID, item.itemID, item.script);
}
@ -249,7 +250,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
/// <param name="localID"></param>
public void StartScript(uint localID, LLUUID itemID, string Script)
{
lock(LUQueue) {
lock (LUQueue)
{
if (LUQueue.Count >= LoadUnloadMaxQueueSize)
{
m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: ERROR: Load/unload queue item count is at " + LUQueue.Count + ". Config variable \"LoadUnloadMaxQueueSize\" is set to " + LoadUnloadMaxQueueSize + ", so ignoring new script.");
@ -276,7 +278,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
ls.localID = localID;
ls.itemID = itemID;
ls.Action = LUType.Unload;
lock (LUQueue) {
lock (LUQueue)
{
LUQueue.Enqueue(ls);
}
}

View File

@ -34,7 +34,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{
//public System.Collections.Generic.Dictionary<Byte, Type> OpCode_Add_Types;
//LSO_Enums() {
//LSO_Enums()
//{
// OpCode_Add_Types.Add(51, typeof(String));
// OpCode_Add_Types.Add(17, typeof(UInt32));
//}

View File

@ -44,7 +44,6 @@ namespace OpenSim.TestSuite
{
public static void Main(string[] args)
{
// TODO: config parser
// TODO: load tests from addings
@ -52,9 +51,12 @@ namespace OpenSim.TestSuite
// TODO: create base bot cloud for use in tests
IConfig config = ParseConfig(args);
if (config.Get("help") != null || config.Get("loginuri") == null) {
if (config.Get("help") != null || config.Get("loginuri") == null)
{
Help();
} else {
}
else
{
// TODO: unused: int botcount = config.GetInt("botcount", 1);
// BotManager bm = new BotManager();

View File

@ -47,9 +47,12 @@ namespace pCampBot
public static void Main(string[] args)
{
IConfig config = ParseConfig(args);
if (config.Get("help") != null || config.Get("loginuri") == null) {
if (config.Get("help") != null || config.Get("loginuri") == null)
{
Help();
} else {
}
else
{
int botcount = config.GetInt("botcount", 1);
BotManager bm = new BotManager();

View File

@ -181,8 +181,10 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
}
/*
public void recevie() {
if (mConnection == null) {
public void receive()
{
if (mConnection == null)
{
throw new Exception("client not initialized");
}
try

View File

@ -150,7 +150,8 @@ namespace OpenSim.ApplicationPlugins.LoadBalancer
state.ms_ptr.Read(packet, 0, state.header.numbytes);
/*
for (int i=0; i<state.header.numbytes; i++) {
for (int i=0; i<state.header.numbytes; i++)
{
System.Console.Write(packet[i] + " ");
}
System.Console.WriteLine();