From 249ce4cf6f353dd59ebec27689e74a527c39a090 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 4 Jul 2007 05:49:12 +0000 Subject: * More cleaning - Sugilite now only has build errors for "value is never used" properties (which I presume will be filled in over time) --- OpenSim/Framework/General/Types/RegionHandle.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/General/Types/RegionHandle.cs b/OpenSim/Framework/General/Types/RegionHandle.cs index 409b05a..4a055ad 100644 --- a/OpenSim/Framework/General/Types/RegionHandle.cs +++ b/OpenSim/Framework/General/Types/RegionHandle.cs @@ -20,7 +20,10 @@ namespace OpenSim.Framework.Types { IPAddress addr = IPAddress.Parse(ip); - long baseHandle = addr.Address; + if (addr.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork) + throw new Exception("Bad RegionHandle Parameter - must be an IPv4 address"); + + uint baseHandle = BitConverter.ToUInt32(addr.GetAddressBytes(), 0); // Split the IP address in half short a = (short)((baseHandle << 16) & 0xFFFF); -- cgit v1.1