- Add Util.isUUID

- Add tests for Util.isUUID
- First part of the fix for protocol interoperability between viewer 1.20 and 1.21 for friend offers.
This commit is contained in:
Homer Horwitz
2008-11-02 13:07:57 +00:00
parent 6d4f8b38aa
commit 499f1428f7
3 changed files with 26 additions and 0 deletions

View File

@@ -64,6 +64,8 @@ namespace OpenSim.Framework
private static readonly DateTime unixEpoch =
DateTime.ParseExact("1970-01-01 00:00:00 +0", "yyyy-MM-dd hh:mm:ss z", DateTimeFormatInfo.InvariantInfo).ToUniversalTime();
private static readonly Regex UUIDPattern = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
#region Vector Equations
/// <summary>
@@ -796,5 +798,10 @@ namespace OpenSim.Framework
x += rx;
y += ry;
}
public static bool isUUID(string s)
{
return UUIDPattern.IsMatch(s);
}
}
}