diff --git a/OpenGridServices.GridServer/SimProfiles.cs b/OpenGridServices.GridServer/SimProfiles.cs index 535f5a933c..ce617af7dc 100644 --- a/OpenGridServices.GridServer/SimProfiles.cs +++ b/OpenGridServices.GridServer/SimProfiles.cs @@ -73,6 +73,22 @@ namespace OpenGridServices.GridServer } public string GetXMLNeighbours(ulong reqhandle) { + string response=""; + SimProfileBase central_region = GetProfileByHandle(reqhandle); + SimProfileBase neighbour; + for(int x=-1; x<2; x++) for(int y=-1; y<2; y++) { + if(GetProfileByHandle(Util.UIntsToLong((uint)((central_region.RegionLocX+x)*256), (uint)(central_region.RegionLocY+y)*256))!=null) { + neighbour=GetProfileByHandle(Util.UIntsToLong((uint)((central_region.RegionLocX+x)*256), (uint)(central_region.RegionLocY+y)*256)); + response+=""; + response+="" + neighbour.sim_ip + ""; + response+="" + neighbour.sim_port.ToString() + ""; + response+="" + neighbour.RegionLocX.ToString() + ""; + response+="" + neighbour.RegionLocY.ToString() + ""; + response+="" + neighbour.regionhandle.ToString() + ""; + response+=""; + + } + } return ""; }