aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices.GridServer/SimProfiles.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenGridServices.GridServer/SimProfiles.cs')
-rw-r--r--OpenGridServices.GridServer/SimProfiles.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenGridServices.GridServer/SimProfiles.cs b/OpenGridServices.GridServer/SimProfiles.cs
index 535f5a9..ce617af 100644
--- a/OpenGridServices.GridServer/SimProfiles.cs
+++ b/OpenGridServices.GridServer/SimProfiles.cs
@@ -73,6 +73,22 @@ namespace OpenGridServices.GridServer
73 } 73 }
74 74
75 public string GetXMLNeighbours(ulong reqhandle) { 75 public string GetXMLNeighbours(ulong reqhandle) {
76 string response="";
77 SimProfileBase central_region = GetProfileByHandle(reqhandle);
78 SimProfileBase neighbour;
79 for(int x=-1; x<2; x++) for(int y=-1; y<2; y++) {
80 if(GetProfileByHandle(Util.UIntsToLong((uint)((central_region.RegionLocX+x)*256), (uint)(central_region.RegionLocY+y)*256))!=null) {
81 neighbour=GetProfileByHandle(Util.UIntsToLong((uint)((central_region.RegionLocX+x)*256), (uint)(central_region.RegionLocY+y)*256));
82 response+="<neighbour>";
83 response+="<sim_ip>" + neighbour.sim_ip + "</sim_ip>";
84 response+="<sim_port>" + neighbour.sim_port.ToString() + "</sim_port>";
85 response+="<locx>" + neighbour.RegionLocX.ToString() + "</locx>";
86 response+="<locy>" + neighbour.RegionLocY.ToString() + "</locy>";
87 response+="<regionhandle>" + neighbour.regionhandle.ToString() + "</regionhandle>";
88 response+="</neighbour>";
89
90 }
91 }
76 return ""; 92 return "";
77 } 93 }
78 94