diff options
author | Jeff Ames | 2008-01-10 06:49:29 +0000 |
---|---|---|
committer | Jeff Ames | 2008-01-10 06:49:29 +0000 |
commit | 5a6fd21a2c31a41c617f1d2a7e390956b5aafb0a (patch) | |
tree | 8828dc80f2b50aca4b6726cfe20be5fe5431b12c /OpenSim/Grid | |
parent | * After fighting with it a bit more, Opensim is now compatible with the most ... (diff) | |
download | opensim-SC-5a6fd21a2c31a41c617f1d2a7e390956b5aafb0a.zip opensim-SC-5a6fd21a2c31a41c617f1d2a7e390956b5aafb0a.tar.gz opensim-SC-5a6fd21a2c31a41c617f1d2a7e390956b5aafb0a.tar.bz2 opensim-SC-5a6fd21a2c31a41c617f1d2a7e390956b5aafb0a.tar.xz |
Whitespace cleanup.
Diffstat (limited to '')
8 files changed, 296 insertions, 305 deletions
diff --git a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs index f9af006..e8225e1 100644 --- a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs +++ b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs | |||
@@ -48,7 +48,7 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
48 | return new DbGridConfig(); | 48 | return new DbGridConfig(); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// A DB4o based Gridserver configuration object | 53 | /// A DB4o based Gridserver configuration object |
54 | /// </summary> | 54 | /// </summary> |
@@ -57,15 +57,15 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
57 | /// <summary> | 57 | /// <summary> |
58 | /// The DB4o Database | 58 | /// The DB4o Database |
59 | /// </summary> | 59 | /// </summary> |
60 | private IObjectContainer db; | 60 | private IObjectContainer db; |
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// User configuration for the Grid Config interfaces | 63 | /// User configuration for the Grid Config interfaces |
64 | /// </summary> | 64 | /// </summary> |
65 | public void LoadDefaults() | 65 | public void LoadDefaults() |
66 | { | 66 | { |
67 | MainLog.Instance.Notice("DbGridConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); | 67 | MainLog.Instance.Notice("DbGridConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); |
68 | 68 | ||
69 | // About the grid options | 69 | // About the grid options |
70 | this.GridOwner = MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); | 70 | this.GridOwner = MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); |
71 | 71 | ||
@@ -139,7 +139,7 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
139 | MainLog.Instance.Warn("DbGridConfig.cs:InitConfig() - Exception occured"); | 139 | MainLog.Instance.Warn("DbGridConfig.cs:InitConfig() - Exception occured"); |
140 | MainLog.Instance.Warn(e.ToString()); | 140 | MainLog.Instance.Warn(e.ToString()); |
141 | } | 141 | } |
142 | 142 | ||
143 | // Grid Settings | 143 | // Grid Settings |
144 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid settings loaded:"); | 144 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid settings loaded:"); |
145 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid owner: " + this.GridOwner); | 145 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Grid owner: " + this.GridOwner); |
@@ -158,7 +158,7 @@ namespace OpenGrid.Config.GridConfigDb4o | |||
158 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to sims: " + this.SimSendKey); | 158 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to send to sims: " + this.SimSendKey); |
159 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from sims: " + this.SimRecvKey); | 159 | MainLog.Instance.Verbose("DBGRIDCONFIG", "Key to expect from sims: " + this.SimRecvKey); |
160 | } | 160 | } |
161 | 161 | ||
162 | /// <summary> | 162 | /// <summary> |
163 | /// Closes down the database and releases filesystem locks | 163 | /// Closes down the database and releases filesystem locks |
164 | /// </summary> | 164 | /// </summary> |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServer.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServer.cs index b06f731..c8bc8c0 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServer.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServer.cs | |||
@@ -31,14 +31,11 @@ using System; | |||
31 | 31 | ||
32 | namespace OpenGridServices.Manager | 32 | namespace OpenGridServices.Manager |
33 | { | 33 | { |
34 | 34 | public partial class Connect to grid server : Gtk.Dialog | |
35 | 35 | { | |
36 | public partial class Connect to grid server : Gtk.Dialog | 36 | public Connect to grid server() |
37 | { | 37 | { |
38 | 38 | this.Build(); | |
39 | public Connect to grid server() | 39 | } |
40 | { | 40 | } |
41 | this.Build(); | ||
42 | } | ||
43 | } | ||
44 | } | 41 | } |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs index bb357a3..1bdb41e 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs | |||
@@ -29,29 +29,26 @@ | |||
29 | using Gtk; | 29 | using Gtk; |
30 | using System; | 30 | using System; |
31 | 31 | ||
32 | namespace OpenGridServices.Manager { | 32 | namespace OpenGridServices.Manager |
33 | public partial class ConnectToGridServerDialog : Gtk.Dialog | 33 | { |
34 | { | 34 | public partial class ConnectToGridServerDialog : Gtk.Dialog |
35 | 35 | { | |
36 | public ConnectToGridServerDialog() | 36 | public ConnectToGridServerDialog() |
37 | { | 37 | { |
38 | this.Build(); | 38 | this.Build(); |
39 | } | 39 | } |
40 | |||
41 | protected virtual void OnResponse(object o, Gtk.ResponseArgs args) | ||
42 | { | ||
43 | switch(args.ResponseId) { | ||
44 | case Gtk.ResponseType.Ok: | ||
45 | MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); | ||
46 | break; | ||
47 | |||
48 | case Gtk.ResponseType.Cancel: | ||
49 | break; | ||
50 | } | ||
51 | this.Hide(); | ||
52 | |||
53 | } | ||
54 | |||
55 | } | ||
56 | 40 | ||
41 | protected virtual void OnResponse(object o, Gtk.ResponseArgs args) | ||
42 | { | ||
43 | switch(args.ResponseId) { | ||
44 | case Gtk.ResponseType.Ok: | ||
45 | MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text); | ||
46 | break; | ||
47 | |||
48 | case Gtk.ResponseType.Cancel: | ||
49 | break; | ||
50 | } | ||
51 | this.Hide(); | ||
52 | } | ||
53 | } | ||
57 | } | 54 | } |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs index 2521e99..255c5e3 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/GridServerConnectionManager.cs | |||
@@ -37,98 +37,98 @@ using libsecondlife; | |||
37 | 37 | ||
38 | namespace OpenGridServices.Manager | 38 | namespace OpenGridServices.Manager |
39 | { | 39 | { |
40 | public class GridServerConnectionManager | 40 | public class GridServerConnectionManager |
41 | { | 41 | { |
42 | private string ServerURL; | 42 | private string ServerURL; |
43 | public LLUUID SessionID; | 43 | public LLUUID SessionID; |
44 | public bool connected=false; | 44 | public bool connected=false; |
45 | 45 | ||
46 | public RegionBlock[][] WorldMap; | 46 | public RegionBlock[][] WorldMap; |
47 | 47 | ||
48 | public bool Connect(string GridServerURL, string username, string password) | 48 | public bool Connect(string GridServerURL, string username, string password) |
49 | { | 49 | { |
50 | try { | 50 | try { |
51 | this.ServerURL=GridServerURL; | 51 | this.ServerURL=GridServerURL; |
52 | Hashtable LoginParamsHT = new Hashtable(); | 52 | Hashtable LoginParamsHT = new Hashtable(); |
53 | LoginParamsHT["username"]=username; | 53 | LoginParamsHT["username"]=username; |
54 | LoginParamsHT["password"]=password; | 54 | LoginParamsHT["password"]=password; |
55 | ArrayList LoginParams = new ArrayList(); | 55 | ArrayList LoginParams = new ArrayList(); |
56 | LoginParams.Add(LoginParamsHT); | 56 | LoginParams.Add(LoginParamsHT); |
57 | XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams); | 57 | XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams); |
58 | XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000); | 58 | XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000); |
59 | if(GridResp.IsFault) { | 59 | if(GridResp.IsFault) { |
60 | connected=false; | 60 | connected=false; |
61 | return false; | 61 | return false; |
62 | } else { | 62 | } else { |
63 | Hashtable gridrespData = (Hashtable)GridResp.Value; | 63 | Hashtable gridrespData = (Hashtable)GridResp.Value; |
64 | this.SessionID = new LLUUID((string)gridrespData["session_id"]); | 64 | this.SessionID = new LLUUID((string)gridrespData["session_id"]); |
65 | connected=true; | 65 | connected=true; |
66 | return true; | 66 | return true; |
67 | } | 67 | } |
68 | } catch(Exception e) { | 68 | } catch(Exception e) { |
69 | Console.WriteLine(e.ToString()); | 69 | Console.WriteLine(e.ToString()); |
70 | connected=false; | 70 | connected=false; |
71 | return false; | 71 | return false; |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | public void DownloadMap() | 75 | public void DownloadMap() |
76 | { | 76 | { |
77 | System.Net.WebClient mapdownloader = new WebClient(); | 77 | System.Net.WebClient mapdownloader = new WebClient(); |
78 | Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); | 78 | Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); |
79 | 79 | ||
80 | RegionBlock TempRegionData; | 80 | RegionBlock TempRegionData; |
81 | 81 | ||
82 | XmlDocument doc = new XmlDocument(); | 82 | XmlDocument doc = new XmlDocument(); |
83 | doc.Load(regionliststream); | 83 | doc.Load(regionliststream); |
84 | regionliststream.Close(); | 84 | regionliststream.Close(); |
85 | XmlNode rootnode = doc.FirstChild; | 85 | XmlNode rootnode = doc.FirstChild; |
86 | if (rootnode.Name != "regions") | 86 | if (rootnode.Name != "regions") |
87 | { | 87 | { |
88 | // TODO - ERROR! | 88 | // TODO - ERROR! |
89 | } | 89 | } |
90 | 90 | ||
91 | for(int i=0; i<=rootnode.ChildNodes.Count; i++) | 91 | for(int i=0; i<=rootnode.ChildNodes.Count; i++) |
92 | { | 92 | { |
93 | if(rootnode.ChildNodes.Item(i).Name != "region") { | 93 | if(rootnode.ChildNodes.Item(i).Name != "region") { |
94 | // TODO - ERROR! | 94 | // TODO - ERROR! |
95 | } else { | 95 | } else { |
96 | TempRegionData = new RegionBlock(); | 96 | TempRegionData = new RegionBlock(); |
97 | 97 | ||
98 | 98 | ||
99 | } | 99 | } |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | public bool RestartServer() | 103 | public bool RestartServer() |
104 | { | 104 | { |
105 | return true; | 105 | return true; |
106 | } | 106 | } |
107 | 107 | ||
108 | public bool ShutdownServer() | 108 | public bool ShutdownServer() |
109 | { | 109 | { |
110 | try { | 110 | try { |
111 | Hashtable ShutdownParamsHT = new Hashtable(); | 111 | Hashtable ShutdownParamsHT = new Hashtable(); |
112 | ArrayList ShutdownParams = new ArrayList(); | 112 | ArrayList ShutdownParams = new ArrayList(); |
113 | ShutdownParamsHT["session_id"]=this.SessionID.ToString(); | 113 | ShutdownParamsHT["session_id"]=this.SessionID.ToString(); |
114 | ShutdownParams.Add(ShutdownParamsHT); | 114 | ShutdownParams.Add(ShutdownParamsHT); |
115 | XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams); | 115 | XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams); |
116 | XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000); | 116 | XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000); |
117 | if(GridResp.IsFault) { | 117 | if(GridResp.IsFault) { |
118 | return false; | 118 | return false; |
119 | } else { | 119 | } else { |
120 | connected=false; | 120 | connected=false; |
121 | return true; | 121 | return true; |
122 | } | 122 | } |
123 | } catch(Exception e) { | 123 | } catch(Exception e) { |
124 | Console.WriteLine(e.ToString()); | 124 | Console.WriteLine(e.ToString()); |
125 | return false; | 125 | return false; |
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | public void DisconnectServer() | 129 | public void DisconnectServer() |
130 | { | 130 | { |
131 | this.connected=false; | 131 | this.connected=false; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | } | 134 | } |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs index 78b9761..a2334e1 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/Main.cs | |||
@@ -26,99 +26,98 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | // project created on 5/14/2007 at 2:04 PM | ||
30 | using System; | 29 | using System; |
31 | using System.Threading; | 30 | using System.Threading; |
32 | using Gtk; | 31 | using Gtk; |
33 | 32 | ||
34 | namespace OpenGridServices.Manager | 33 | namespace OpenGridServices.Manager |
35 | { | 34 | { |
36 | class MainClass | 35 | class MainClass |
37 | { | 36 | { |
38 | 37 | ||
39 | public static bool QuitReq=false; | 38 | public static bool QuitReq=false; |
40 | public static BlockingQueue<string> PendingOperations = new BlockingQueue<string>(); | 39 | public static BlockingQueue<string> PendingOperations = new BlockingQueue<string>(); |
41 | 40 | ||
42 | private static Thread OperationsRunner; | 41 | private static Thread OperationsRunner; |
43 | 42 | ||
44 | private static GridServerConnectionManager gridserverConn; | 43 | private static GridServerConnectionManager gridserverConn; |
45 | 44 | ||
46 | private static MainWindow win; | 45 | private static MainWindow win; |
47 | 46 | ||
48 | public static void DoMainLoop() | 47 | public static void DoMainLoop() |
49 | { | 48 | { |
50 | while(!QuitReq) | 49 | while(!QuitReq) |
51 | { | 50 | { |
52 | Application.RunIteration(); | 51 | Application.RunIteration(); |
53 | } | 52 | } |
54 | } | 53 | } |
55 | 54 | ||
56 | public static void RunOperations() | 55 | public static void RunOperations() |
57 | { | 56 | { |
58 | string operation; | 57 | string operation; |
59 | string cmd; | 58 | string cmd; |
60 | char[] sep = new char[1]; | 59 | char[] sep = new char[1]; |
61 | sep[0]=' '; | 60 | sep[0]=' '; |
62 | while(!QuitReq) | 61 | while(!QuitReq) |
63 | { | 62 | { |
64 | operation=PendingOperations.Dequeue(); | 63 | operation=PendingOperations.Dequeue(); |
65 | Console.WriteLine(operation); | 64 | Console.WriteLine(operation); |
66 | cmd = operation.Split(sep)[0]; | 65 | cmd = operation.Split(sep)[0]; |
67 | switch(cmd) { | 66 | switch(cmd) { |
68 | case "connect_to_gridserver": | 67 | case "connect_to_gridserver": |
69 | win.SetStatus("Connecting to grid server..."); | 68 | win.SetStatus("Connecting to grid server..."); |
70 | if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) { | 69 | if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) { |
71 | win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID); | 70 | win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID); |
72 | win.SetGridServerConnected(true); | 71 | win.SetGridServerConnected(true); |
73 | Thread.Sleep(3000); | 72 | Thread.Sleep(3000); |
74 | win.SetStatus("Downloading region maps..."); | 73 | win.SetStatus("Downloading region maps..."); |
75 | gridserverConn.DownloadMap(); | 74 | gridserverConn.DownloadMap(); |
76 | } else { | 75 | } else { |
77 | win.SetStatus("Could not connect"); | 76 | win.SetStatus("Could not connect"); |
78 | } | 77 | } |
79 | break; | 78 | break; |
80 | 79 | ||
81 | case "restart_gridserver": | 80 | case "restart_gridserver": |
82 | win.SetStatus("Restarting grid server..."); | 81 | win.SetStatus("Restarting grid server..."); |
83 | if(gridserverConn.RestartServer()) { | 82 | if(gridserverConn.RestartServer()) { |
84 | win.SetStatus("Restarted server OK"); | 83 | win.SetStatus("Restarted server OK"); |
85 | Thread.Sleep(3000); | 84 | Thread.Sleep(3000); |
86 | win.SetStatus(""); | 85 | win.SetStatus(""); |
87 | } else { | 86 | } else { |
88 | win.SetStatus("Error restarting grid server!!!"); | 87 | win.SetStatus("Error restarting grid server!!!"); |
89 | } | 88 | } |
90 | break; | 89 | break; |
91 | 90 | ||
92 | case "shutdown_gridserver": | 91 | case "shutdown_gridserver": |
93 | win.SetStatus("Shutting down grid server..."); | 92 | win.SetStatus("Shutting down grid server..."); |
94 | if(gridserverConn.ShutdownServer()) { | 93 | if(gridserverConn.ShutdownServer()) { |
95 | win.SetStatus("Grid server shutdown"); | 94 | win.SetStatus("Grid server shutdown"); |
96 | win.SetGridServerConnected(false); | 95 | win.SetGridServerConnected(false); |
97 | Thread.Sleep(3000); | 96 | Thread.Sleep(3000); |
98 | win.SetStatus(""); | 97 | win.SetStatus(""); |
99 | } else { | 98 | } else { |
100 | win.SetStatus("Could not shutdown grid server!!!"); | 99 | win.SetStatus("Could not shutdown grid server!!!"); |
101 | } | 100 | } |
102 | break; | 101 | break; |
103 | 102 | ||
104 | case "disconnect_gridserver": | 103 | case "disconnect_gridserver": |
105 | gridserverConn.DisconnectServer(); | 104 | gridserverConn.DisconnectServer(); |
106 | win.SetGridServerConnected(false); | 105 | win.SetGridServerConnected(false); |
107 | break; | 106 | break; |
108 | } | 107 | } |
109 | } | 108 | } |
110 | } | 109 | } |
111 | 110 | ||
112 | public static void Main (string[] args) | 111 | public static void Main (string[] args) |
113 | { | 112 | { |
114 | gridserverConn = new GridServerConnectionManager(); | 113 | gridserverConn = new GridServerConnectionManager(); |
115 | Application.Init (); | 114 | Application.Init (); |
116 | win = new MainWindow (); | 115 | win = new MainWindow (); |
117 | win.Show (); | 116 | win.Show (); |
118 | OperationsRunner = new Thread(new ThreadStart(RunOperations)); | 117 | OperationsRunner = new Thread(new ThreadStart(RunOperations)); |
119 | OperationsRunner.IsBackground=true; | 118 | OperationsRunner.IsBackground=true; |
120 | OperationsRunner.Start(); | 119 | OperationsRunner.Start(); |
121 | DoMainLoop(); | 120 | DoMainLoop(); |
122 | } | 121 | } |
123 | } | 122 | } |
124 | } | 123 | } |
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs index b9efe1d..312c347 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/MainWindow.cs | |||
@@ -29,76 +29,76 @@ | |||
29 | using System; | 29 | using System; |
30 | using Gtk; | 30 | using Gtk; |
31 | 31 | ||
32 | namespace OpenGridServices.Manager { | 32 | namespace OpenGridServices.Manager |
33 | public partial class MainWindow: Gtk.Window | 33 | { |
34 | { | 34 | public partial class MainWindow: Gtk.Window |
35 | public MainWindow (): base (Gtk.WindowType.Toplevel) | 35 | { |
36 | { | 36 | public MainWindow (): base (Gtk.WindowType.Toplevel) |
37 | Build (); | 37 | { |
38 | } | 38 | Build(); |
39 | 39 | } | |
40 | public void SetStatus(string statustext) | ||
41 | { | ||
42 | this.statusbar1.Pop(0); | ||
43 | this.statusbar1.Push(0,statustext); | ||
44 | } | ||
45 | 40 | ||
46 | public void DrawGrid(RegionBlock[][] regions) | 41 | public void SetStatus(string statustext) |
47 | { | 42 | { |
48 | for(int x=0; x<=regions.GetUpperBound(0); x++) { | 43 | this.statusbar1.Pop(0); |
49 | for(int y=0; y<=regions.GetUpperBound(1); y++) { | 44 | this.statusbar1.Push(0, statustext); |
50 | Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256); | 45 | } |
51 | this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256); | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | |||
56 | public void SetGridServerConnected(bool connected) | ||
57 | { | ||
58 | if(connected) { | ||
59 | this.ConnectToGridserver.Visible=false; | ||
60 | this.DisconnectFromGridServer.Visible=true; | ||
61 | } else { | ||
62 | this.ConnectToGridserver.Visible=true; | ||
63 | this.DisconnectFromGridServer.Visible=false; | ||
64 | } | ||
65 | } | ||
66 | |||
67 | protected void OnDeleteEvent (object sender, DeleteEventArgs a) | ||
68 | { | ||
69 | Application.Quit (); | ||
70 | MainClass.QuitReq=true; | ||
71 | a.RetVal = true; | ||
72 | } | ||
73 | |||
74 | protected virtual void QuitMenu(object sender, System.EventArgs e) | ||
75 | { | ||
76 | MainClass.QuitReq=true; | ||
77 | Application.Quit(); | ||
78 | } | ||
79 | |||
80 | protected virtual void ConnectToGridServerMenu(object sender, System.EventArgs e) | ||
81 | { | ||
82 | ConnectToGridServerDialog griddialog = new ConnectToGridServerDialog (); | ||
83 | griddialog.Show(); | ||
84 | } | ||
85 | 46 | ||
86 | protected virtual void RestartGridserverMenu(object sender, System.EventArgs e) | 47 | public void DrawGrid(RegionBlock[][] regions) |
87 | { | 48 | { |
88 | MainClass.PendingOperations.Enqueue("restart_gridserver"); | 49 | for (int x=0; x<=regions.GetUpperBound(0); x++) |
89 | } | 50 | { |
51 | for (int y=0; y<=regions.GetUpperBound(1); y++) | ||
52 | { | ||
53 | Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256); | ||
54 | this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256); | ||
55 | } | ||
56 | } | ||
57 | } | ||
90 | 58 | ||
91 | protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e) | 59 | public void SetGridServerConnected(bool connected) |
92 | { | 60 | { |
93 | MainClass.PendingOperations.Enqueue("shutdown_gridserver"); | 61 | if (connected) { |
94 | } | 62 | this.ConnectToGridserver.Visible=false; |
63 | this.DisconnectFromGridServer.Visible=true; | ||
64 | } else { | ||
65 | this.ConnectToGridserver.Visible=true; | ||
66 | this.DisconnectFromGridServer.Visible=false; | ||
67 | } | ||
68 | } | ||
95 | 69 | ||
96 | protected virtual void DisconnectGridServerMenu(object sender, System.EventArgs e) | 70 | protected void OnDeleteEvent (object sender, DeleteEventArgs a) |
97 | { | 71 | { |
98 | MainClass.PendingOperations.Enqueue("disconnect_gridserver"); | 72 | Application.Quit (); |
99 | } | 73 | MainClass.QuitReq=true; |
74 | a.RetVal = true; | ||
75 | } | ||
100 | 76 | ||
101 | } | 77 | protected virtual void QuitMenu(object sender, System.EventArgs e) |
102 | } | 78 | { |
79 | MainClass.QuitReq=true; | ||
80 | Application.Quit(); | ||
81 | } | ||
82 | |||
83 | protected virtual void ConnectToGridServerMenu(object sender, System.EventArgs e) | ||
84 | { | ||
85 | ConnectToGridServerDialog griddialog = new ConnectToGridServerDialog (); | ||
86 | griddialog.Show(); | ||
87 | } | ||
88 | |||
89 | protected virtual void RestartGridserverMenu(object sender, System.EventArgs e) | ||
90 | { | ||
91 | MainClass.PendingOperations.Enqueue("restart_gridserver"); | ||
92 | } | ||
103 | 93 | ||
104 | 94 | protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e) | |
95 | { | ||
96 | MainClass.PendingOperations.Enqueue("shutdown_gridserver"); | ||
97 | } | ||
98 | |||
99 | protected virtual void DisconnectGridServerMenu(object sender, System.EventArgs e) | ||
100 | { | ||
101 | MainClass.PendingOperations.Enqueue("disconnect_gridserver"); | ||
102 | } | ||
103 | } | ||
104 | } | ||
diff --git a/OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs b/OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs index 90e1ab6..ad28d65 100644 --- a/OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs +++ b/OpenSim/Grid/Manager/OpenGridServices.Manager/RegionBlock.cs | |||
@@ -33,33 +33,31 @@ using OpenSim.Framework.Utilities; | |||
33 | 33 | ||
34 | namespace OpenGridServices.Manager | 34 | namespace OpenGridServices.Manager |
35 | { | 35 | { |
36 | 36 | public class RegionBlock | |
37 | 37 | { | |
38 | public class RegionBlock | 38 | public uint regloc_x; |
39 | { | 39 | public uint regloc_y; |
40 | public uint regloc_x; | ||
41 | public uint regloc_y; | ||
42 | |||
43 | public string httpd_url; | ||
44 | |||
45 | public string region_name; | ||
46 | |||
47 | public ulong regionhandle { | ||
48 | get { return Util.UIntsToLong(regloc_x*256,regloc_y*256); } | ||
49 | } | ||
50 | 40 | ||
51 | public Gdk.Pixbuf MiniMap; | 41 | public string httpd_url; |
52 | |||
53 | public RegionBlock() | ||
54 | { | ||
55 | } | ||
56 | 42 | ||
57 | public void LoadFromXmlNode(XmlNode sourcenode) | 43 | public string region_name; |
58 | { | 44 | |
59 | this.regloc_x=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_x").Value); | 45 | public ulong regionhandle { |
60 | this.regloc_y=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_y").Value); | 46 | get { return Util.UIntsToLong(regloc_x*256,regloc_y*256); } |
61 | this.region_name=sourcenode.Attributes.GetNamedItem("region_name").Value; | 47 | } |
62 | this.httpd_url=sourcenode.Attributes.GetNamedItem("httpd_url").Value; | 48 | |
63 | } | 49 | public Gdk.Pixbuf MiniMap; |
64 | } | 50 | |
51 | public RegionBlock() | ||
52 | { | ||
53 | } | ||
54 | |||
55 | public void LoadFromXmlNode(XmlNode sourcenode) | ||
56 | { | ||
57 | this.regloc_x=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_x").Value); | ||
58 | this.regloc_y=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_y").Value); | ||
59 | this.region_name=sourcenode.Attributes.GetNamedItem("region_name").Value; | ||
60 | this.httpd_url=sourcenode.Attributes.GetNamedItem("httpd_url").Value; | ||
61 | } | ||
62 | } | ||
65 | } | 63 | } |
diff --git a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs index 552cd55..d2736c6 100644 --- a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs +++ b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs | |||
@@ -41,15 +41,15 @@ namespace OpenUser.Config.UserConfigDb4o | |||
41 | return ( new DbUserConfig()); | 41 | return ( new DbUserConfig()); |
42 | } | 42 | } |
43 | } | 43 | } |
44 | 44 | ||
45 | public class DbUserConfig : UserConfig | 45 | public class DbUserConfig : UserConfig |
46 | { | 46 | { |
47 | private IObjectContainer db; | 47 | private IObjectContainer db; |
48 | 48 | ||
49 | public void LoadDefaults() | 49 | public void LoadDefaults() |
50 | { | 50 | { |
51 | MainLog.Instance.Notice("DbUserConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); | 51 | MainLog.Instance.Notice("DbUserConfig.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); |
52 | 52 | ||
53 | this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); | 53 | this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); |
54 | 54 | ||
55 | this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/"); | 55 | this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/"); |
@@ -88,14 +88,14 @@ namespace OpenUser.Config.UserConfigDb4o | |||
88 | MainLog.Instance.Warn("DbUserConfig.cs:InitConfig() - Exception occured"); | 88 | MainLog.Instance.Warn("DbUserConfig.cs:InitConfig() - Exception occured"); |
89 | MainLog.Instance.Warn(e.ToString()); | 89 | MainLog.Instance.Warn(e.ToString()); |
90 | } | 90 | } |
91 | 91 | ||
92 | MainLog.Instance.Verbose("DBUSERCONFIG", "User settings loaded:"); | 92 | MainLog.Instance.Verbose("DBUSERCONFIG", "User settings loaded:"); |
93 | MainLog.Instance.Verbose("DBUSERCONFIG", "Default startup message: " + this.DefaultStartupMsg); | 93 | MainLog.Instance.Verbose("DBUSERCONFIG", "Default startup message: " + this.DefaultStartupMsg); |
94 | MainLog.Instance.Verbose("DBUSERCONFIG", "Grid server URL: " + this.GridServerURL); | 94 | MainLog.Instance.Verbose("DBUSERCONFIG", "Grid server URL: " + this.GridServerURL); |
95 | MainLog.Instance.Verbose("DBUSERCONFIG", "Key to send to grid: " + this.GridSendKey); | 95 | MainLog.Instance.Verbose("DBUSERCONFIG", "Key to send to grid: " + this.GridSendKey); |
96 | MainLog.Instance.Verbose("DBUSERCONFIG", "Key to expect from grid: " + this.GridRecvKey); | 96 | MainLog.Instance.Verbose("DBUSERCONFIG", "Key to expect from grid: " + this.GridRecvKey); |
97 | } | 97 | } |
98 | 98 | ||
99 | public void Shutdown() | 99 | public void Shutdown() |
100 | { | 100 | { |
101 | db.Close(); | 101 | db.Close(); |