aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices.Manager
diff options
context:
space:
mode:
Diffstat (limited to 'OpenGridServices.Manager')
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs28
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/Main.cs3
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs7
-rw-r--r--OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp1
4 files changed, 37 insertions, 2 deletions
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs b/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
index 668a1b8..1694805 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/GridServerConnectionManager.cs
@@ -1,5 +1,8 @@
1using Nwc.XmlRpc; 1using Nwc.XmlRpc;
2using System; 2using System;
3using System.Net;
4using System.IO;
5using System.Xml;
3using System.Collections; 6using System.Collections;
4using System.Collections.Generic; 7using System.Collections.Generic;
5using libsecondlife; 8using libsecondlife;
@@ -12,6 +15,8 @@ namespace OpenGridServices.Manager
12 public LLUUID SessionID; 15 public LLUUID SessionID;
13 public bool connected=false; 16 public bool connected=false;
14 17
18 public RegionBlock[][] WorldMap;
19
15 public bool Connect(string GridServerURL, string username, string password) 20 public bool Connect(string GridServerURL, string username, string password)
16 { 21 {
17 try { 22 try {
@@ -39,6 +44,29 @@ namespace OpenGridServices.Manager
39 } 44 }
40 } 45 }
41 46
47 public void DownloadMap()
48 {
49 System.Net.WebClient mapdownloader = new WebClient();
50 Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist");
51
52
53 XmlDocument doc = new XmlDocument();
54 doc.Load(regionliststream);
55 XmlNode rootnode = doc.FirstChild;
56 if (rootnode.Name != "regions")
57 {
58 // TODO - ERROR!
59 }
60
61 for(int i=0; i<=rootnode.ChildNodes.Count; i++)
62 {
63 if(rootnode.ChildNodes.Item(i).Name != "region") {
64 // TODO - ERROR!
65 } else {
66 }
67 }
68 }
69
42 public bool RestartServer() 70 public bool RestartServer()
43 { 71 {
44 return true; 72 return true;
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
index c7c0dd7..42e09e0 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/Main.cs
@@ -43,7 +43,8 @@ namespace OpenGridServices.Manager
43 win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID); 43 win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID);
44 win.SetGridServerConnected(true); 44 win.SetGridServerConnected(true);
45 Thread.Sleep(3000); 45 Thread.Sleep(3000);
46 win.SetStatus(""); 46 win.SetStatus("Downloading region maps...");
47 gridserverConn.DownloadMap();
47 } else { 48 } else {
48 win.SetStatus("Could not connect"); 49 win.SetStatus("Could not connect");
49 } 50 }
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs b/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
index 598e380..1db38f0 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/MainWindow.cs
@@ -17,7 +17,12 @@ namespace OpenGridServices.Manager {
17 17
18 public void DrawGrid(RegionBlock[][] regions) 18 public void DrawGrid(RegionBlock[][] regions)
19 { 19 {
20 20 for(int x=0; x<=regions.GetUpperBound(0); x++) {
21 for(int y=0; y<=regions.GetUpperBound(1); y++) {
22 Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256);
23 this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256);
24 }
25 }
21 } 26 }
22 27
23 public void SetGridServerConnected(bool connected) 28 public void SetGridServerConnected(bool connected)
diff --git a/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp b/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp
index 3140034..cfdc085 100644
--- a/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp
+++ b/OpenGridServices.Manager/OpenGridServices.Manager/OpenGridServices.Manager.mdp
@@ -37,6 +37,7 @@
37 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> 37 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
38 <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" /> 38 <ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
39 <ProjectReference type="Assembly" localcopy="True" refto="../../bin/XMLRPC.dll" /> 39 <ProjectReference type="Assembly" localcopy="True" refto="../../bin/XMLRPC.dll" />
40 <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
40 </References> 41 </References>
41 <GtkDesignInfo partialTypes="True" /> 42 <GtkDesignInfo partialTypes="True" />
42</Project> \ No newline at end of file 43</Project> \ No newline at end of file